+ FILE *file = fopen(headername, "r");
+ if (file != NULL) {
+ switch_input(file, headername);
+ return true;
+ }
+ }
+
+ assert(obstack_object_size(&symbol_obstack) == 0);
+ /* check searchpath */
+ for (searchpath_entry_t *entry = searchpath; entry != NULL;
+ entry = entry->next) {
+ const char *path = entry->path;
+ size_t len = strlen(path);
+ obstack_grow(&symbol_obstack, path, len);
+ if (path[len-1] != '/')
+ obstack_1grow(&symbol_obstack, '/');
+ obstack_grow(&symbol_obstack, headername, headername_len+1);
+
+ char *complete_path = obstack_finish(&symbol_obstack);
+ FILE *file = fopen(complete_path, "r");
+ if (file != NULL) {
+ const char *filename = identify_string(complete_path);
+ switch_input(file, filename);
+ return true;
+ } else {
+ obstack_free(&symbol_obstack, complete_path);
+ }
+ }
+
+ return false;
+}
+
+/* read till next newline character, only for parse_include_directive(),
+ * use eat_pp_directive() in all other cases */
+static void skip_till_newline(void)
+{
+ /* skip till newline */
+ while (true) {
+ switch (input.c) {
+ case NEWLINE:
+ case EOF:
+ return;
+ }
+ next_char();
+ }