version 1.9, 1997/07/25 21:56:22 |
version 1.10, 1997/09/05 00:02:30 |
|
|
(void)fclose(cfile); |
(void)fclose(cfile); |
return (0); |
return (0); |
} |
} |
while ((c=getc(cfile)) != EOF) |
while ((c = fgetc(cfile)) != EOF) |
if (c != ' ' && c != '\t') |
if (c != ' ' && c != '\t') |
break; |
break; |
if (c == EOF || c == '\n') { |
if (c == EOF || c == '\n') { |
|
|
} |
} |
tmp = macros[macnum].mac_name; |
tmp = macros[macnum].mac_name; |
*tmp++ = c; |
*tmp++ = c; |
for (i=0; i < 8 && (c=getc(cfile)) != EOF && |
for (i=0; i < 8 && (c = fgetc(cfile)) != EOF && |
!isspace(c); ++i) { |
!isspace(c); ++i) { |
*tmp++ = c; |
*tmp++ = c; |
} |
} |
|
|
} |
} |
*tmp = '\0'; |
*tmp = '\0'; |
if (c != '\n') { |
if (c != '\n') { |
while ((c=getc(cfile)) != EOF && c != '\n'); |
while ((c = fgetc(cfile)) != EOF && c != '\n'); |
} |
} |
if (c == EOF) { |
if (c == EOF) { |
fputs( |
fputs( |
|
|
} |
} |
tmp = macros[macnum].mac_start; |
tmp = macros[macnum].mac_start; |
while (tmp != macbuf + 4096) { |
while (tmp != macbuf + 4096) { |
if ((c=getc(cfile)) == EOF) { |
if ((c = fgetc(cfile)) == EOF) { |
fputs( |
fputs( |
"Macro definition missing null line terminator.\n", ttyout); |
"Macro definition missing null line terminator.\n", ttyout); |
goto bad; |
goto bad; |
|
|
|
|
if (feof(cfile) || ferror(cfile)) |
if (feof(cfile) || ferror(cfile)) |
return (0); |
return (0); |
while ((c = getc(cfile)) != EOF && |
while ((c = fgetc(cfile)) != EOF && |
(c == '\n' || c == '\t' || c == ' ' || c == ',')) |
(c == '\n' || c == '\t' || c == ' ' || c == ',')) |
continue; |
continue; |
if (c == EOF) |
if (c == EOF) |
return (0); |
return (0); |
cp = tokval; |
cp = tokval; |
if (c == '"') { |
if (c == '"') { |
while ((c = getc(cfile)) != EOF && c != '"') { |
while ((c = fgetc(cfile)) != EOF && c != '"') { |
if (c == '\\') |
if (c == '\\') |
c = getc(cfile); |
c = fgetc(cfile); |
*cp++ = c; |
*cp++ = c; |
} |
} |
} else { |
} else { |
*cp++ = c; |
*cp++ = c; |
while ((c = getc(cfile)) != EOF |
while ((c = fgetc(cfile)) != EOF |
&& c != '\n' && c != '\t' && c != ' ' && c != ',') { |
&& c != '\n' && c != '\t' && c != ' ' && c != ',') { |
if (c == '\\') |
if (c == '\\') |
c = getc(cfile); |
c = fgetc(cfile); |
*cp++ = c; |
*cp++ = c; |
} |
} |
} |
} |