Top   Types   Functions   Classes   Index   Sources 

include/error/style-plain.h


  1  /* -*- Mode: C -*- */
  2  
  3  #ifndef ERR_STYLE_PLAIN_34234_H
  4  #define ERR_STYLE_PLAIN_34234_H
  5  
  6  #ifdef __cplusplus
  7  extern "C" {
  8  #endif
  9  
 10  #define ERR_STYLE_PLAIN_COLON  ERR_STYLE_COLON
 11  #define ERR_STYLE_PLAIN_QUOTES ERR_STYLE_QUOTES
 12  
 13  extern int err_style_plain_redirect; /* = ERR_STYLE_PLAIN_QUOTES; */
 14  
 15  extern err_style_t const err_style_plain_s;
 16  #define err_style_plain (&err_style_plain_s)
 17     /* This is the default style that is used for printing.
 18      *
 19      * Depending on err_style_plain_redirect, this is either plain-colon
 20      * or plain quotes.
 21      *
 22      * The format() function uses the following template to print
 23      * an error message:
 24      *
 25      *    "file:line: progname[pid].subsystem: tag_string number: text"
 26      *
 27      * If tag      == C_TAG_NONE, only "text"            is printed.
 28      * If file     == NULL,       "file:line: "          is not printed.
 29      * If line     <= 0,          "line:"                is not printed.
 30      * If progname == NULL,       "progname[pid]: "      is not printed.
 31      * If subsystem is unknown,   ".subsystem"           is not printed.
 32      * If pid < 0,                "[pid]"                is not printed.
 33      * If number   <= 0,          " number"              is not printed.
 34      * If tag      == C_TAG_MORE, "tag_string number: "  is not printed.
 35      *
 36      * This function also replaces all \n in the text by \t\n.
 37      *
 38      * The plain style post_format () function always returns NULL.
 39      */
 40  
 41  extern err_markup_t *err_markup_plain;
 42  
 43  extern char const *err_markup_plain_color (err_markup_t *, int, int, ERR_BOOL);
 44  
 45  extern void err_markup_plain_begin_part (
 46      err_markup_t *,
 47      err_formatted_stream_t *,
 48      err_v_char_t *,
 49      int,
 50      int);
 51  
 52  /* **********************************************************************
 53   * The following functions and variables are shared by all plain styles: */
 54  
 55  extern int          err_style_plain_line_break;    /* = ERR_STYLE_LINE_BREAK_TOO_LONG */
 56  extern ERR_BOOL     err_style_plain_show_pid;      /* = ERR_ERWIN_TRUE */
 57  extern ERR_BOOL     err_style_plain_show_hostname; /* = ERR_ERWIN_TRUE */
 58     /* if enabled in configure, decides whether to show hostname. */
 59  extern int          err_style_plain_show_time;     /* = ERR_STYLE_TIME_PROGRESS */
 60  extern ERR_BOOL     err_style_plain_show_date;     /* = 0 */
 61  extern int          err_style_plain_color;         /* = ERR_STYLE_COLOR_IF_TTY */
 62  extern char const * err_style_plain_tab;           /* = "        "; */
 63  
 64  extern int err_style_plain_format_progname (
 65      err_markup_t *,
 66      err_formatted_stream_t *,
 67      err_v_char_t *,
 68      int /*tag*/, int /*orig_tag*/,
 69      char const * /*progname*/, char const * /*hostname*/, int /*pid*/);
 70     /* This prints the first part of the error message in plain format, i.e.,
 71      *
 72      *    "progname[host.pid]: "
 73      */
 74  
 75  extern int err_style_plain_format_tag (
 76      err_markup_t *,
 77      err_formatted_stream_t *,
 78      err_v_char_t *, int /*tag*/, int /*orig_tag*/, int /*number*/);
 79      /* This prints the tag and the number in plain format. */
 80  
 81  /* Print an address (range). */
 82  extern int err_style_plain_format_address_range (
 83      err_markup_t *,
 84      err_formatted_stream_t *,
 85      err_v_char_t *,
 86      int /*tag*/, int /*orig_tag*/,
 87      err_area_t const *);
 88     /* Prints an address:
 89      *
 90      *    "At address ...: "
 91      */
 92  
 93  /* Print an address (range). */
 94  extern int err_style_plain_format_time (
 95      err_markup_t *,
 96      err_formatted_stream_t *,
 97      err_v_char_t *,
 98      int /*tag*/, int /*orig_tag*/,
 99      time_t /*time*/);
100     /* Prints the time:
101      *    "[12:53:60]"
102      */
103  
104  extern void err_style_plain_append_cr_perhaps (
105      err_v_char_t *,
106      ERR_BOOL /* loc_valid */,
107      int * /* nentries */,
108      char const * /* text */);
109  
110  extern err_v_char_t *err_style_plain_post_format (
111      err_formatted_stream_t *,
112      int /*tag*/, int /*orig_tag*/, err_v_char_t const *);
113      /* This is the post-format function for plain style. */
114  
115  /* **********************************************************************
116   * The following functions redirect plain style to some of the plain
117   * styles. */
118  
119  extern void err_style_plain_format (
120      err_formatted_stream_t *,
121      err_v_char_t * /*target*/,
122      int /*tag*/, int /*orig_tag*/, int /*orig_number*/,
123      err_msg_info_t,
124      err_location_t const * /*location*/,
125      char const * /*progname*/, char const * /*hostname*/, int /*pid*/,
126      char const * /*text*/);
127      /* This is the format function for plain style. */
128  
129  extern void err_style_plain_format_marked_up (
130      err_markup_t * /*markup*/,
131      err_formatted_stream_t *,
132      err_v_char_t * /*target*/,
133      int /*tag*/, int /*orig_tag*/, int /*orig_number*/,
134      err_msg_info_t,
135      err_location_t const * /*location*/,
136      char const * /*progname*/, char const * /*hostname*/, int /*pid*/,
137      char const * /*text*/);
138      /* This is the format function for plain style. */
139  
140  /* The following are functions that are used by err_style_plain_format() any
141   * which might be useful for the user in order to compose their own styles. */
142  extern int err_style_plain_format_area (
143      err_markup_t *,
144      err_formatted_stream_t *,
145      err_v_char_t *,
146      int /*tag*/, int /*orig_tag*/,
147      err_area_t const *);
148     /* This prints the first part of the error message in plain format, i.e.,
149      *
150      *    "file:line:pos: "
151      * or
152      *    "file:line:pos:..line:pos: "
153      * or the like.
154      *
155      * Currently only prints the first part, since Emacs cannot mark ranges.
156      */
157  
158  #ifdef __cplusplus
159  }
160  #endif
161  
162  #endif /* ERR_STYLE_PLAIN_34234_H */

Index

Stoppt die Vorratsdatenspeicherung
November 26th, 2007
Comments? Suggestions? Corrections? You can drop me a line.
zpentrabvagiktu@theiling.de
Schwerpunktpraxis