/* the main preprocessor parsing loop */ int wpp_parse( const char *input, FILE *output ) { int ret; pp_status.input = NULL; pp_push_define_state(); add_cmdline_defines(); add_special_defines(); if (!input) ppin = stdin; else if (!(ppin = fopen(input, "rt"))) { fprintf(stderr,"Could not open %s\n", input); exit(2); } pp_status.input = input; ppout = output; fprintf(ppout, "# 1 \"%s\" 1\n", input ? input : ""); ret = ppparse(); if (input) fclose(ppin); pp_pop_define_state(); return ret; }