From 764dbbf2ddb0b5602ae03f0ecb2c8078587e41dd Mon Sep 17 00:00:00 2001 From: Gabriel Dos Reis Date: Tue, 6 Jun 2000 20:11:40 +0000 Subject: diagnostic.c (output_maximum_width): Remove. 2000-06-06 Gabriel Dos Reis * diagnostic.c (output_maximum_width): Remove. (doing_line_wrapping): Tweak. (diagnostic_buffer): New object. (global_output_buffer): New object. (output_destroy_prefix): New function. (default_initialize_buffer): Likewise. (reshape_diagnostic_buffer): Likewise. (initialize_diagnostics): Likewise. (output_clear): Tweak. (line_wrapper_printf): Adjust call to init_output_buffer. (vline_wrapper_message_with_location): Likewise. Use output_destroy_prefix. (v_message_with_decl): Likewise. * diagnostic.h (struct output_buffer): Constify prefix. (init_output_buffer, output_get_prefix): Constify. (diagnostic_message_length_per_line): Likewise. (reshape_diagnostic_buffer): Declare. (default_initialize_buffer): Declare. (initialize_diagnostics): Declare. (diagnostic_buffer): Declare new obbject. * toplev.c: #include diagnostic.h (display_help): Document diagnostic formatting options. (decode_f_option): Handle diagnostic formatting options. (main): Setup initialization for diagnostic messages outputter. * toplev.h (set_message_length): Remove. * Makefile.in (toplev.o): Depends upon diagnostic.h * invoke.texi : Document diagnostics formatting options. cp/ 2000-06-06 Gabriel Dos Reis * lex.c (lang_init_options): Tweak. * decl2.c: Remove #inclusion of diagnostic.h (lang_decode_option): Move diagnostic formatting options to toplevel. * lang-options.h: Remove documentation for diagnostic options. * Makefile.in (lex.o): Depends upon diagnostic.h From-SVN: r34435 --- gcc/diagnostic.h | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'gcc/diagnostic.h') diff --git a/gcc/diagnostic.h b/gcc/diagnostic.h index 38edfc9..e8a2d67 100644 --- a/gcc/diagnostic.h +++ b/gcc/diagnostic.h @@ -44,7 +44,7 @@ struct output_buffer /* The obstack where the text is built up. */ struct obstack obstack; /* The prefix for each new line. */ - char *prefix; + const char *prefix; /* The amount of characters output so far. */ int line_length; /* The real upper bound of number of characters per line, taking into @@ -83,11 +83,24 @@ struct output_buffer extern printer_fn lang_printer; +extern int diagnostic_message_length_per_line; + +/* This output buffer is used by front-ends that directly output + diagnostic messages without going through `error', `warning', + and simillar functions. In general, such usage should be + avoided. This global buffer will go away, once all such usage + has been removed. */ +extern output_buffer *diagnostic_buffer; + /* Prototypes */ -void init_output_buffer PARAMS ((output_buffer *, char *, int)); +void initialize_diagnostics PARAMS ((void)); +void reshape_diagnostic_buffer PARAMS ((void)); +void default_initialize_buffer PARAMS ((output_buffer *)); +void init_output_buffer PARAMS ((output_buffer *, const char *, int)); void output_clear PARAMS ((output_buffer *)); -char *output_get_prefix PARAMS ((const output_buffer *)); -void output_set_prefix PARAMS ((output_buffer *, char *)); +const char *output_get_prefix PARAMS ((const output_buffer *)); +void output_set_prefix PARAMS ((output_buffer *, const char *)); +void output_destroy_prefix PARAMS ((output_buffer *)); void output_set_maximum_length PARAMS ((output_buffer *, int)); void output_emit_prefix PARAMS ((output_buffer *)); void output_add_newline PARAMS ((output_buffer *)); -- cgit v1.1