X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=main.c;h=5a58d7497d283944c4ae4d59c3a1e280af6a901b;hb=d85a04555ea643285364ee0f922d0260f26f2599;hp=5e2c7bc9a2f3fa6b48172ad9e4d5e3cc8e4a661a;hpb=5fa879eb4cc6e5187e1e673e154b11f5a6f813ce;p=cparser diff --git a/main.c b/main.c index 5e2c7bc..5a58d74 100644 --- a/main.c +++ b/main.c @@ -1191,6 +1191,24 @@ int main(int argc, char **argv) mode = PrintCaml; } else if (streq(option, "print-jna")) { mode = PrintJna; + } else if (streq(option, "jna-limit")) { + ++i; + if (i >= argc) { + fprintf(stderr, "error: " + "expected argument after '--jna-limit'\n"); + argument_errors = true; + break; + } + jna_limit_output(argv[i]); + } else if (streq(option, "jna-libname")) { + ++i; + if (i >= argc) { + fprintf(stderr, "error: " + "expected argument after '--jna-libname'\n"); + argument_errors = true; + break; + } + jna_set_libname(argv[i]); } else if (streq(option, "time")) { do_timing = true; } else if (streq(option, "version")) { @@ -1268,7 +1286,7 @@ int main(int argc, char **argv) if (print_file_name_file != NULL) { print_file_name(print_file_name_file); - return 0; + return EXIT_SUCCESS; } if (files == NULL) { fprintf(stderr, "error: no input files specified\n"); @@ -1277,7 +1295,7 @@ int main(int argc, char **argv) if (argument_errors) { usage(argv[0]); - return 1; + return EXIT_FAILURE; } /* we do the lowering in ast2firm */ @@ -1364,7 +1382,7 @@ int main(int argc, char **argv) if (out == NULL) { fprintf(stderr, "Couldn't open '%s' for writing: %s\n", outname, strerror(errno)); - return 1; + return EXIT_FAILURE; } } @@ -1566,13 +1584,13 @@ graph_built: dump_ir_graph_file(out, irg); fclose(out); - exit(0); + exit(EXIT_SUCCESS); } if (mode == CompileExportIR) { fclose(out); ir_export(outname); - exit(0); + exit(EXIT_SUCCESS); } gen_firm_finish(asm_out, filename, have_const_functions); @@ -1673,7 +1691,7 @@ graph_built: int err = system(commandline); if (err != EXIT_SUCCESS) { fprintf(stderr, "linker reported an error\n"); - exit(1); + exit(EXIT_FAILURE); } } @@ -1693,5 +1711,5 @@ graph_built: exit_types(); exit_tokens(); exit_symbol_table(); - return 0; + return EXIT_SUCCESS; }