diff options
author | Per Bothner <bothner@gcc.gnu.org> | 1996-06-06 20:06:57 -0700 |
---|---|---|
committer | Per Bothner <bothner@gcc.gnu.org> | 1996-06-06 20:06:57 -0700 |
commit | 59de0311654d467b4a36926456701d4b5ddf076b (patch) | |
tree | fa9e99e1929c258358b759079c8b22e0962230ce /gcc/cppmain.c | |
parent | a94c94be24475b20cc1af6b3a01b9fd683486e6c (diff) | |
download | gcc-59de0311654d467b4a36926456701d4b5ddf076b.zip gcc-59de0311654d467b4a36926456701d4b5ddf076b.tar.gz gcc-59de0311654d467b4a36926456701d4b5ddf076b.tar.bz2 |
cppmain.c (main): Use CPP_SET_WRITTEN and cpp_fatal.
* cppmain.c (main): Use CPP_SET_WRITTEN and cpp_fatal.
Use renamed function names, and return protocols.
From-SVN: r12203
Diffstat (limited to 'gcc/cppmain.c')
-rw-r--r-- | gcc/cppmain.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/gcc/cppmain.c b/gcc/cppmain.c index 506ce05..50e31be 100644 --- a/gcc/cppmain.c +++ b/gcc/cppmain.c @@ -58,19 +58,21 @@ main (argc, argv) while (p != argv[0] && p[-1] != '/') --p; progname = p; - init_parse_file (&parse_in); + cpp_reader_init (&parse_in); parse_in.data = opts; - init_parse_options (opts); + cpp_options_init (opts); argi += cpp_handle_options (&parse_in, argc - argi , argv + argi); + if (CPP_FATAL_ERRORS (&parse_in)) + exit (FATAL_EXIT_CODE); if (argi < argc) - fatal ("Invalid option `%s'", argv[argi]); + cpp_fatal (&parse_in, "Invalid option `%s'", argv[argi]); + parse_in.show_column = 1; - i = push_parse_file (&parse_in, opts->in_fname); - if (i != SUCCESS_EXIT_CODE) - return i; + if (! cpp_start_read (&parse_in, opts->in_fname)) + exit (FATAL_EXIT_CODE); /* Now that we know the input file is valid, open the output. */ @@ -86,7 +88,7 @@ main (argc, argv) { fwrite (parse_in.token_buffer, 1, CPP_WRITTEN (&parse_in), stdout); } - parse_in.limit = parse_in.token_buffer; + CPP_SET_WRITTEN (&parse_in, 0); kind = cpp_get_token (&parse_in); if (kind == CPP_EOF) break; |