Source File modules/er/er_facilities.h

    1    | /***************************************
    2    |   $Revision: 1.4 $
    3    |
    4    |   Error reporting (er) er_facilities.h - list of facilities (modules)
    5    |
    6    |   Status: NOT REVUED, TESTED,
    7    |
    8    |   Design and implementation by: Marek Bukowy
    9    |
    10   |   ******************/ /******************
    11   |   Copyright (c) 1999                              RIPE NCC
    12   |
    13   |   All Rights Reserved
    14   |
    15   |   Permission to use, copy, modify, and distribute this software and its
    16   |   documentation for any purpose and without fee is hereby granted,
    17   |   provided that the above copyright notice appear in all copies and that
    18   |   both that copyright notice and this permission notice appear in
    19   |   supporting documentation, and that the name of the author not be
    20   |   used in advertising or publicity pertaining to distribution of the
    21   |   software without specific, written prior permission.
    22   |
    23   |   THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
    24   |   ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL
    25   |   AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
    26   |   DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
    27   |   AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
    28   |   OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
    29   |   ***************************************/
    30   |
    31   | /* this #include is just for cxref to not get lost completely :-) */
    32   | #include <erroutines.h>
    33   |
    34   | /* this is the file for adding new facilities.
    35   |    This requires three steps:
    36   |    1. Prepare and include a file with your error messages (see other files).
    37   | 	Please follow the filename convention er_??_errors.c
    38   |    2. Declare your facility number in the enum (before the FAC_LAST)
    39   |
    40   |    only when that's ready (for not to prevent other people from working)
    41   |
    42   |    3. Add your facility to the facility table, using the DEFFAC macro
    43   | 	(it takes a two-letter code and a description of the facility).
    44   | 	This will add a pointer to the module-specific error table
    45   | 	to the global table.
    46   |
    47   |    Order of codes in enum does NOT have to match the order of DEFFAC's.
    48   | */
    49   |
    50   | typedef enum {
    51   | 	FAC_NONE=0,
    52   | 	FAC_RX,
    53   | 	FAC_IP,
    54   | 	FAC_ER,
    55   | 	FAC_UT,
    56   | 	FAC_WH,
    57   | 	FAC_LAST
    58   | } er_fac_code_t;
    59   |
    60   | /* user code for each facility.
    61   | (kept in other files for easy maintenance) */
    62   |
    63   | #include "er_ER_errors.h"
    64   | #include "er_IP_errors.h"
    65   | #include "er_RX_errors.h"
    66   | #include "er_UT_errors.h"
    67   | #include "er_WH_errors.h"
    68   |
    69   | /* so much for user code */
    70   |
    71   | #ifndef ER_IMPL
    72   | /* just a declaration for modules using this */
    73   | #include "erroutines.h"
    74   | extern er_main_t *er_main_err;
    75   | #else
    76   |   er_main_t 	er_main_err[] = {
    77   | 	DEFFAC(RX, "radix tree indexing for IP/route objects"),
    78   | 	DEFFAC(IP, "IP conversion library"),
    79   | 	DEFFAC(ER, "error system") ,
    80   | 	DEFFAC(UT, "general utilities and wrappers") ,
    81   | 	DEFFAC(WH, "embedded whois client") ,
    82   | 	{FAC_NONE}
    83   |   };
    84   | #endif /* ER_IMPL */
    85   |