Browse Source

token function for bjt instance

pre-master-46
dwarning 19 years ago
parent
commit
888a934fc5
  1. 29
      src/misc/string.c
  2. 2
      src/misc/stringutil.h

29
src/misc/string.c

@ -264,6 +264,35 @@ gettok_noparens(char **s)
return (copy(buf));
}
char *
gettok_instance(char **s)
{
char buf[BSIZE_SP];
int i = 0;
char c;
while ( isspace(**s) )
(*s)++; /* iterate over whitespace */
if (!**s)
return (NULL); /* return NULL if we come to end of line */
while ((c = **s) &&
!isspace(c) &&
( **s != '(' ) &&
( **s != ')' )
) {
buf[i++] = *(*s)++;
}
buf[i] = '\0';
/* Now iterate up to next non-whitespace char */
while ( isspace(**s) )
(*s)++;
return (copy(buf));
}
/*-------------------------------------------------------------------------*
* gettok_node was added by SDB on 12.3.2003
* It acts like gettok, except that it treats parens and commas like

2
src/misc/stringutil.h

@ -18,6 +18,8 @@ int ciprefix(register char *p, register char *s);
void strtolower(char *str);
char * stripWhiteSpacesInsideParens(char *str);
char * gettok(char **s);
char * gettok_instance(char **);
#ifdef CIDER
/* cider integration */

Loading…
Cancel
Save