+static char *get_ifndef_sym(char *line)
+{
+ line += strspn(line, SPACE_CHARS);
+ if (line[0] == '#')
+ {
+ line++;
+ line += strspn(line, SPACE_CHARS);
+ if (strstarts(line, "ifndef") && isspace(line[6]))
+ return line+6+strspn(line+6, SPACE_CHARS);
+ else if (strstarts(line, "if"))
+ {
+ line += 2;
+ line += strspn(line, SPACE_CHARS);
+ if (line[0] == '!')
+ {
+ line++;
+ line += strspn(line, SPACE_CHARS);
+ if (strstarts(line, "defined"))
+ {
+ line += 7;
+ line += strspn(line, SPACE_CHARS);
+ if (line[0] == '(')
+ {
+ line++;
+ line += strspn(line,
+ SPACE_CHARS);
+ }
+ return line;
+ }
+ }
+ }
+ }
+ return NULL;
+}
+
+static int is_define(char *line, char *id, size_t id_len)
+{
+ line += strspn(line, SPACE_CHARS);
+ if (line[0] == '#')
+ {
+ line++;
+ line += strspn(line, SPACE_CHARS);
+ if (strstarts(line, "define") && isspace(line[6]))
+ {
+ line += 6;
+ line += strspn(line, SPACE_CHARS);
+ if (strspn(line, IDENT_CHARS) == id_len &&
+ memcmp(id, line, id_len) == 0)
+ return 1;
+ }
+ }
+ return 0;
+}
+