1 | /*************************************** 2 | $Revision: 1.3 $ 3 | 4 | Error reporting (er) er_formats.{m4,h} - definition of error formats 5 | error reporting module. 6 | 7 | Status: NOT REVUED, TESTED, 8 | 9 | Design and implementation by: Marek Bukowy 10 | 11 | ******************/ /****************** 12 | Copyright (c) 1999,2000,2001,2002 RIPE NCC 13 | 14 | All Rights Reserved 15 | 16 | Permission to use, copy, modify, and distribute this software and its 17 | documentation for any purpose and without fee is hereby granted, 18 | provided that the above copyright notice appear in all copies and that 19 | both that copyright notice and this permission notice appear in 20 | supporting documentation, and that the name of the author not be 21 | used in advertising or publicity pertaining to distribution of the 22 | software without specific, written prior permission. 23 | 24 | THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 25 | ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL 26 | AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY 27 | DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 28 | AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 29 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 30 | ***************************************/ 31 | 32 | /* 33 | NOTE: modify the m4 file only, do not change the resulting .h !!! 34 | */ 35 | 36 | #ifndef ER_FORMATS_H 37 | #define ER_FORMATS_H 38 | 39 | 40 | typedef struct { 41 | char *n; 42 | int v; 43 | } er_form_el; 44 | 45 | #ifdef ER_IMPL 46 | #define EXTDEF 47 | #define EXTINI(a,b) a = b; 48 | #else 49 | #define EXTDEF extern 50 | #define EXTINI(a,b) extern a; 51 | #endif 52 | 53 | /* m4 macro: #define a symbol and put its string version into the array 54 | at the same time. The string version will have "ASP_" cut off if 55 | the string begins with it. The #defines are diverted to stream 9, so 56 | they appear later in the output (outside the /endif block) 57 | */ 58 | 59 | 60 | 61 | typedef enum { 62 | 63 | ER_M_SEVCHAR = (1<<0 ), 64 | ER_M_SEVLONG = (1<<1), 65 | ER_M_MNEMONIC = (1<<2), 66 | ER_M_TEXTLONG = (1<<3), 67 | ER_M_UIDUID = (1<<4), 68 | ER_M_UIDEUID = (1<<5), 69 | ER_M_PIDFULL = (1<<6), 70 | ER_M_FACSYMB = (1<<7), 71 | ER_M_PROGNAME = (1<<8), 72 | ER_M_DATETIME = (1<<9), 73 | ER_M_THR_ID = (1<<10), 74 | __ER_fmt_slack /* to close the list after the last comma */ 75 | 76 | } er_format_mt; 77 | 78 | 79 | EXTDEF 80 | er_form_el er_formarr[] 81 | #ifdef ER_IMPL 82 | = { 83 | /* m4 - paste the definitions here */ 84 | { "SEVCHAR", ER_M_SEVCHAR }, 85 | { "SEVLONG", ER_M_SEVLONG }, 86 | { "MNEMONIC", ER_M_MNEMONIC }, 87 | { "TEXTLONG", ER_M_TEXTLONG }, 88 | { "UIDUID", ER_M_UIDUID }, 89 | { "UIDEUID", ER_M_UIDEUID }, 90 | { "PIDFULL", ER_M_PIDFULL }, 91 | { "FACSYMB", ER_M_FACSYMB }, 92 | { "PROGNAME", ER_M_PROGNAME }, 93 | { "DATETIME", ER_M_DATETIME }, 94 | { "THR_ID", ER_M_THR_ID }, 95 | 96 | {NULL, 0} 97 | } 98 | #endif /* ER_IMPL */ 99 | ; 100 | 101 | 102 | #endif /* ER_FORMATS_H */