Top   Types   Functions   Classes   Index   Sources 

include/error/style-quotes.h


  1  /* -*- Mode: C -*- */
  2  
  3  #ifndef ERR_STYLE_QUOTES_34234_H
  4  #define ERR_STYLE_QUOTES_34234_H
  5  
  6  #ifdef __cplusplus
  7  extern "C" {
  8  #endif
  9  
 10  /* This also uses the following variables from plain style:
 11   *    err_style_plain_show_pid
 12   *    err_style_plain_line_break
 13   *    err_style_plain_color
 14   */
 15  
 16  extern err_style_t const err_style_quotes_s;
 17  #define err_style_quotes (&err_style_quotes_s)
 18     /* This is the default style that is used for printing.
 19      *
 20      * The format() function uses the following template to print
 21      * an error message:
 22      *
 23      *    "file:line: progname[pid].subsystem: tag_string number: text"
 24      *
 25      * If tag      == C_TAG_NONE, only "text"            is printed.
 26      * If file     == NULL,       "file:line: "          is not printed.
 27      * If line     <= 0,          "line:"                is not printed.
 28      * If progname == NULL,       "progname[pid]: "      is not printed.
 29      * If subsystem is unknown,   ".subsystem"           is not printed.
 30      * If pid < 0,                "[pid]"                is not printed.
 31      * If number   <= 0,          " number"              is not printed.
 32      * If tag      == C_TAG_MORE, "tag_string number: "  is not printed.
 33      *
 34      * This function also replaces all \n in the text by \t\n.
 35      *
 36      * The quotes style post_format () function always returns NULL.
 37      */
 38  
 39  /* The following functions may be used to compose your own error
 40   * styles: */
 41  
 42  extern void err_style_quotes_append_shell_quoted (
 43      err_v_char_t *,
 44      char const *);
 45      /* This puts the string into double quotes and does the quotation
 46       * just like a (possibly interactive) shell would expect it.  The
 47       * interactive shell is special wrt. to the character !.
 48       *
 49       * Note: althought the string is in double quotes, it is *NOT* C-string
 50       *       quoted!
 51       *
 52       * Examples:
 53       *    Literal        Shell            (C-String)
 54       *    abs.txt        "abs.txt"        "abs.txt"          (trivial)
 55       *    A"B            "A\"B"           "A\"B"             (shell = C)
 56       *    C:\A.TEST      "C:\A.TEST"      "C:\\A.TEST"       (shell != C)
 57       *    A'B            "A"'!'"B"        "A'B"              (shell != C)
 58       */
 59  
 60  extern void err_style_quotes_format_marked_up (
 61      err_markup_t * /*markup*/,
 62      err_formatted_stream_t *,
 63      err_v_char_t * /*target*/,
 64      int /*tag*/, int /*orig_tag*/, int /*orig_number*/,
 65      err_msg_info_t,
 66      err_location_t const * /*location*/,
 67      char const * /*progname*/, char const * /*hostname*/, int /*pid*/,
 68      char const * /*text*/);
 69      /* This is the format function for plain style. */
 70  
 71  extern void err_style_quotes_format (
 72      err_formatted_stream_t *,
 73      err_v_char_t * /*target*/,
 74      int /*tag*/, int /*orig_tag*/, int /*orig_number*/,
 75      err_msg_info_t,
 76      err_location_t const * /*location*/,
 77      char const * /*progname*/, char const * /*hostname*/, int /*pid*/,
 78      char const * /*text*/);
 79      /* This is the format function for quotes style. */
 80  
 81  /* The following are functions that are used by err_style_quotes_format() any
 82   * which might be useful for the user in order to compose their own styles. */
 83  extern int err_style_quotes_format_area (
 84      err_markup_t * /*markup*/,
 85      err_formatted_stream_t *stream,
 86      err_v_char_t *,
 87      int /*tag*/, int /*orig_tag*/,
 88      err_area_t const *);
 89     /* This prints the first part of the error message in quotes format, i.e.,
 90      *
 91      *    "FILE", line LINE(pos)
 92      * or
 93      *    "FILE", line LINE(pos..pos)
 94      * or
 95      *    "FILE", lines LINE(pos)..LINE(pos)
 96      * or the like.
 97      *
 98      * Currently only prints the first part, since Emacs cannot mark ranges.
 99      */
100  
101  /*
102   * The following functions are currently identical to the err_style_plain versions */
103  extern int err_style_quotes_format_address_range (
104      err_markup_t * /*markup*/,
105      err_formatted_stream_t *stream,
106      err_v_char_t *,
107      int /*tag*/, int /*orig_tag*/,
108      err_location_t const *);
109      /* simply invokes err_style_plain_post_format (but this may change in the future) */
110  
111  extern int err_style_quotes_format_progname (
112      err_markup_t * /*markup*/,
113      err_formatted_stream_t *stream,
114      err_v_char_t *,
115      int /*tag*/, int /*orig_tag*/,
116      char const * /*progname*/, char const * /*hostname*/, int /*pid*/);
117      /* simply invokes err_style_plain_post_format (but this may change in the future) */
118  
119  extern int err_style_quotes_format_tag (
120      err_markup_t * /*markup*/,
121      err_formatted_stream_t *,
122      err_v_char_t *, int /*tag*/, int /*orig_tag*/, int /*number*/);
123      /* simply invokes err_style_plain_post_format (but this may change in the future) */
124  
125  extern err_v_char_t *err_style_quotes_post_format (
126      err_formatted_stream_t *,
127      int /*tag*/, int /*orig_tag*/, err_v_char_t const *);
128      /* simply invokes err_style_plain_post_format (but this may change in the future) */
129  
130  
131  
132  #ifdef __cplusplus
133  }
134  #endif
135  
136  #endif /* ERR_STYLE_QUOTES_34234_H */

Index

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