/* 空行かコメント行であることを調べる。 * 空行=空文字列 or スペースとタブのみ。 * コメント行=スペースとタブに続いて;、;に続いて任意の文字 */ static int isingnorableline(const char *line) { int i; assert(line != NULL); for (i = 0; i < strlen(line); i++) { if (!isspacetab(line[i])) { if (line[i] == ';') { return 1; /* コメント行 */ } else { return 0; } } } return 1; /* 空行 */ }
/* Reads a directive, whose first character is given by "c", into "name". */ static bool readDirective (int c, char *const name, unsigned int maxLength) { unsigned int i; for (i = 0 ; i < maxLength - 1 ; ++i) { if (i > 0) { c = getcAndCollect (); if (c == EOF || ! isalpha (c)) { ungetcAndCollect (c); break; } } name [i] = c; } name [i] = '\0'; /* null terminate */ return (bool) isspacetab (c); }