void xfclose(XFILE *xfp);
int xgettok(XFILE *xfp, char sepa, char *tok, int len);
char xgetc(XFILE *xfp);
-void xungetc(char c, XFILE *xfp);
+void xungetc(int c, XFILE *xfp);
void xskip(XFILE *xfp, char *str);
char xskipcomment(XFILE *xfp);
while (i < len && (c = xgetc(xfp)) != EOF && c != sepa && !isspace(c))
tok[i++] = c;
if (c == '\n')
- ungetc(c, xfp->x_fp);
+ xungetc(c, xfp->x_fp);
if (!i)
return 0;
if (i >= len || (sepa && c != sepa))
}
void
-xungetc(char c, XFILE *xfp)
+xungetc(int c, XFILE *xfp)
{
- if (c != EOF)
+ if (c != EOF) {
ungetc(c, xfp->x_fp);
+ if (c == '\n')
+ xfp->x_line--;
+ }
}
void