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