Commit | Line | Data |
---|---|---|
3cd4b0f8 MW |
1 | #include "cparse.h" |
2 | #include <unistd.h> | |
3 | ||
4 | int main(int argc, char **argv) { | |
5 | int n; | |
6 | struct dump_state *dump; | |
7 | ||
8 | n = commandline(argc, argv); | |
9 | dump = dump_new(stdout); | |
10 | dump_locations(dump, 0); | |
11 | for(; n < argc; ++n) { | |
12 | struct external_declaration *tu; | |
13 | ||
14 | for(tu = parse(argv[n]); tu; tu = tu->next) | |
15 | if(tu->type == ed_function_definition | |
16 | && !(tu->u.function_definition->declaration->declaration_specifiers->storage_class_specifiers & SCS_STATIC)) { | |
17 | const struct function_definition *fd = tu->u.function_definition; | |
18 | ||
19 | if(dump_declaration(dump, fd->declaration, 0)) | |
20 | fatal(errno, "error writing to stdout"); | |
21 | } | |
22 | if(putchar('\n') < 0) fatal(errno, "error writing to stdout"); | |
23 | } | |
24 | if(fclose(stdout) < 0) fatal(errno, "error closing stdout"); | |
25 | return !!errors; | |
26 | } | |
27 | ||
28 | /* | |
29 | Local Variables: | |
30 | c-basic-offset:2 | |
31 | comment-column:40 | |
32 | End: | |
33 | */ |