8 extern int yyparse(void);
11 extern char* current_file;
13 int main(int argc, char* argv[])
22 printf("Not enough arguments\n");
26 tempname = tempnam(NULL, "midl");
28 args[0] = strdup("/usr/bin/gcc");
29 args[1] = strdup("-x");
30 args[2] = strdup("c");
31 args[3] = strdup("-P");
32 args[4] = strdup("-E");
33 args[5] = strdup(argv[1]);
34 args[6] = strdup("-o");
35 args[7] = strdup(tempname);
38 if ((n = fork()) == 0)
40 execv("/usr/bin/gcc", args);
50 p = waitpid(n, &status, WUNTRACED);
51 if (p == -1 || p == 0 || !WIFEXITED(status))
56 if (WEXITSTATUS(status) != 0)
58 printf("midl: the preprocessor %s failed\n");
64 yyin = fopen(tempname, "r+b");
71 current_file = strdup(argv[1]);
73 if (yyparse() != 0 || nr_errors > 0)