version 1.19, 2004/05/19 02:32:35 |
version 1.20, 2004/09/25 09:19:35 |
|
|
private const char hdr[] = |
private const char hdr[] = |
"cont\toffset\ttype\topcode\tmask\tvalue\tdesc"; |
"cont\toffset\ttype\topcode\tmask\tvalue\tdesc"; |
FILE *f; |
FILE *f; |
char line[BUFSIZ+1]; |
char line[BUFSIZ]; |
int lineno; |
int lineno; |
int errs = 0; |
int errs = 0; |
|
|
|
|
(void)fprintf(stderr, "%s\n", hdr); |
(void)fprintf(stderr, "%s\n", hdr); |
|
|
/* parse it */ |
/* parse it */ |
for (lineno = 1; fgets(line, BUFSIZ, f) != NULL; lineno++) { |
for (lineno = 1; fgets(line, sizeof(line), f) != NULL; lineno++) { |
if (line[0]=='#') /* comment, do not parse */ |
if (line[0]=='#') /* comment, do not parse */ |
continue; |
continue; |
if (strlen(line) <= (unsigned)1) /* null line, garbage, etc */ |
if (strlen(line) <= (unsigned)1) /* null line, garbage, etc */ |