mirror of
https://git.code.sf.net/p/ngspice/ngspice
synced 2026-09-03 10:58:30 +02:00
Gxxx n1 n2 TABLE {expression} = (x0, y0) (x1, y1) (x2, y2)
This commit is contained in:
@@ -360,6 +360,40 @@ gettok_instance(char **s)
|
||||
return ( token ) ;
|
||||
}
|
||||
|
||||
/* get the next token starting at next non white spice, stopping
|
||||
at p, if inc_p is true, then including p, else excluding p
|
||||
*/
|
||||
char *
|
||||
gettok_char(char **s, char p, bool inc_p)
|
||||
{
|
||||
char c;
|
||||
char *token ; /* return token */
|
||||
SPICE_DSTRING buf ; /* allow any length string */
|
||||
|
||||
while ( isspace(**s) )
|
||||
(*s)++; /* iterate over whitespace */
|
||||
|
||||
if (!**s)
|
||||
return (NULL); /* return NULL if we come to end of line */
|
||||
|
||||
spice_dstring_init(&buf) ;
|
||||
while ((c = **s) != '\0' &&
|
||||
( **s != p )
|
||||
) {
|
||||
spice_dstring_append_char( &buf, *(*s)++ ) ;
|
||||
}
|
||||
if (inc_p)
|
||||
spice_dstring_append_char( &buf, *(*s)++ ) ;
|
||||
|
||||
/* Now iterate up to next non-whitespace char */
|
||||
while ( isspace(**s) )
|
||||
(*s)++;
|
||||
|
||||
token = copy( spice_dstring_value(&buf) ) ;
|
||||
spice_dstring_free(&buf) ;
|
||||
return ( token ) ;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*
|
||||
* gettok_node was added by SDB on 12.3.2003
|
||||
* It acts like gettok, except that it treats parens and commas like
|
||||
|
||||
Reference in New Issue
Block a user