Browse Source

Small code reformatting.

pre-master-46
pnenzi 23 years ago
parent
commit
00ccfec837
  1. 28
      src/spicelib/parser/inpgtok.c

28
src/spicelib/parser/inpgtok.c

@ -49,9 +49,9 @@ int INPgetTok(char **line, char **token, int gobble)
} }
/* mark beginning of token */ /* mark beginning of token */
*line = point; *line = point;
/* now find all good characters up to next occurance of a /* now find all good characters up to next occurance of a
separation character. */
separation character. */
signstate = 0; signstate = 0;
for (point = *line; *point != '\0'; point++) { for (point = *line; *point != '\0'; point++) {
if (*point == ' ') if (*point == ' ')
@ -59,7 +59,7 @@ int INPgetTok(char **line, char **token, int gobble)
if (*point == '\t') if (*point == '\t')
break; break;
if (*point == '\r') if (*point == '\r')
break;
break;
if (*point == '=') if (*point == '=')
break; break;
if (*point == '(') if (*point == '(')
@ -93,6 +93,7 @@ int INPgetTok(char **line, char **token, int gobble)
signstate = 3; signstate = 3;
} }
if (point == *line && *point) /* Weird items, 1 char */ if (point == *line && *point) /* Weird items, 1 char */
point++; point++;
*token = (char *) MALLOC(1 + point - *line); *token = (char *) MALLOC(1 + point - *line);
@ -101,6 +102,7 @@ int INPgetTok(char **line, char **token, int gobble)
(void) strncpy(*token, *line, point - *line); (void) strncpy(*token, *line, point - *line);
*(*token + (point - *line)) = '\0'; *(*token + (point - *line)) = '\0';
*line = point; *line = point;
/* gobble garbage to next token */ /* gobble garbage to next token */
for (; **line != '\0'; (*line)++) { for (; **line != '\0'; (*line)++) {
if (**line == ' ') if (**line == ' ')
@ -108,24 +110,23 @@ int INPgetTok(char **line, char **token, int gobble)
if (**line == '\t') if (**line == '\t')
continue; continue;
if (**line == '\r') if (**line == '\r')
continue;
continue;
if ((**line == '=') && gobble) if ((**line == '=') && gobble)
continue; continue;
if ((**line == ',') && gobble) if ((**line == ',') && gobble)
continue; continue;
break; break;
} }
#ifdef TRACE #ifdef TRACE
/* SDB debug statement */
/*printf("found generic token (%s) and rest of line (%s)\n",*token,*line); */
#endif
/* SDB debug statement */
/* printf("found generic token (%s) and rest of line (%s)\n", *token, *line); */
#endif
return (OK); return (OK);
} }
/*------------------------------------------------------------------- /*-------------------------------------------------------------------
* INPgetNetTok -- this fcn extracts an input netname token from * INPgetNetTok -- this fcn extracts an input netname token from
* 'line' and returns a pointer to it in 'token'. * 'line' and returns a pointer to it in 'token'.
@ -213,6 +214,7 @@ int INPgetNetTok(char **line, char **token, int gobble)
} }
/*------------------------------------------------------------------- /*-------------------------------------------------------------------
* INPgetUTok -- this fcn extracts an input refdes token from * INPgetUTok -- this fcn extracts an input refdes token from
* 'line' and returns a pointer to it in 'token'. * 'line' and returns a pointer to it in 'token'.
@ -323,11 +325,11 @@ int INPgetUTok(char **line, char **token, int gobble)
break; break;
} }
*line = point; *line = point;
#ifdef TRACE #ifdef TRACE
/* SDB debug statement */ /* SDB debug statement */
/* printf("found refdes token (%s) and rest of line (%s)\n",*token,*line); */ /* printf("found refdes token (%s) and rest of line (%s)\n",*token,*line); */
#endif
#endif
return (OK); return (OK);
} }
Loading…
Cancel
Save