summaryrefslogtreecommitdiff
path: root/gcc/cppmain.c
diff options
context:
space:
mode:
authorbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>1996-06-07 03:06:57 +0000
committerbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>1996-06-07 03:06:57 +0000
commit0bd7d2565d4492b9c6422761f81230dfc32282b3 (patch)
treefa9e99e1929c258358b759079c8b22e0962230ce /gcc/cppmain.c
parentecc6ec84fe4df96a779e6688cad35d7eb93fb170 (diff)
downloadgcc-0bd7d2565d4492b9c6422761f81230dfc32282b3.tar.gz
* cppmain.c (main): Use CPP_SET_WRITTEN and cpp_fatal.
Use renamed function names, and return protocols. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@12203 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cppmain.c')
-rw-r--r--gcc/cppmain.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/gcc/cppmain.c b/gcc/cppmain.c
index 506ce05f7e8..50e31be85d6 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;