


COM_ERR(3)                                             COM_ERR(3)


NNAAMMEE
       com_err - common error display routine

SSYYNNOOPPSSIISS
        #include <com_err.h>

       void com_err (whoami, code, format, ...);
            const char *whoami;
            long code;
            const char *format;

       proc = set_com_err_hook (proc);
       void  (*  _p_r_o_c  )  (const  char  *,  long,  const  char *,
       va_list);

       proc = reset_com_err_hook ();

       void initialize_XXXX_error_table ();

DDEESSCCRRIIPPTTIIOONN
       _C_o_m___e_r_r displays an error message on  the  standard  error
       stream  _s_t_d_e_r_r  (see  _s_t_d_i_o(3S))  composed  of  the _w_h_o_a_m_i
       string, which should specify the program name or some sub-
       portion  of a program, followed by an error message gener-
       ated from the _c_o_d_e value (derived from _c_o_m_p_i_l_e___e_t(1)), and
       a  string produced using the _f_o_r_m_a_t string and any follow-
       ing arguments, in the same style as _f_p_r_i_n_t_f(3).

       The  behavior   of   _c_o_m___e_r_r   can   be   modified   using
       _s_e_t___c_o_m___e_r_r___h_o_o_k_; this defines a procedure which is called
       with the arguments  passed  to  _c_o_m___e_r_r_,  instead  of  the
       default  internal procedure which sends the formatted text
       to error output.  Thus the error messages from  a  program
       can  all  easily be diverted to another form of diagnostic
       logging, such as  _s_y_s_l_o_g(3).   _R_e_s_e_t___c_o_m___e_r_r___h_o_o_k  may  be
       used  to  restore  the  behavior of _c_o_m___e_r_r to its default
       form.  Both procedures return the previous ``hook'' value.
       These  ``hook'' procedures must have the declaration given
       for _p_r_o_c above in the synopsis.

       The  _i_n_i_t_i_a_l_i_z_e___X_X_X_X___e_r_r_o_r___t_a_b_l_e  routine   is   generated
       mechanically  by _c_o_m_p_i_l_e___e_t(1) from a source file contain-
       ing names and associated strings.  Each table has  a  name
       of  up  to  four characters, which is used in place of the
       XXXXXXXX in the name of the routine.  These routines should be
       called  before  any  of  the corresponding error codes are
       used, so that the _c_o_m___e_r_r  library  will  recognize  error
       codes from these tables when they are used.

       The ccoomm__eerrrr..hh header file should be included in any source
       file that uses routines from  the  _c_o_m___e_r_r  library;  exe-
       cutable  files must be linked using _`_`_-_l_c_o_m___e_r_r_'_' in order
       to cause the _c_o_m___e_r_r library to be included.




SIPB                       22 Nov 1988                          1





COM_ERR(3)                                             COM_ERR(3)


SSEEEE AALLSSOO
       compile_et (1), syslog (3).

       Ken Raeburn,  "A  Common  Error  Description  Library  for
       UNIX".




















































SIPB                       22 Nov 1988                          2


