File modules/er/er.c

  $Revision: 1.22 $

Error reporting (er) er.c - library of functions to uniformly report errors.
Status: NOT REVUED, PARTLY TESTED
NOTE: MALLOC ALERT!!! THE REPORTING FUNCTIONS MAY NOT USE DYNAMIC MEMORY!!! for one: they wouldn't work if we run out of memory... for two: the memory wrappers may have logging enabled, and it would loop.
Design and implementation by: Marek Bukowy
References Variables: AC_mod_errmodules/er/er.c
  ER_mod_errmodules/er/er.c
  IP_mod_errmodules/er/er.c
  MM_mod_errmodules/er/er.c
  PA_mod_errmodules/er/er.c
  PC_mod_errmodules/er/er.c
  PM_mod_errmodules/er/er.c
  PW_mod_errmodules/er/er.c
  QC_mod_errmodules/er/er.c
  QI_mod_errmodules/er/er.c
  RP_mod_errmodules/er/er.c
  RX_mod_errmodules/er/er.c
  SK_mod_errmodules/er/er.c
  SQ_mod_errmodules/er/er.c
  SV_mod_errmodules/er/er.c
  TH_mod_errmodules/er/er.c
  UD_mod_errmodules/er/er.c
  UP_mod_errmodules/er/er.c
  UT_mod_errmodules/er/er.c
  WH_mod_errmodules/er/er.c

Included Files


Preprocessor definitions

#define ER_IMPL

#define PIP_WR 1

#define PIP_RD 0


Global Variable er_pathtypes

char* er_pathtypes[]
Included from modules/er/erroutines.h
Visible in:  modules/er/er.c

Global Variable RX_mod_err

er_list_t RX_mod_err[]
Included from include/er_RX_errors.h
Visible in:  modules/er/er.c
Used in:  modules/er/er.c

Global Variable ER_mod_err

er_list_t ER_mod_err[]
Included from modules/er/er_ER_errors.h
Visible in:  modules/er/er.c
Used in:  modules/er/er.c

Global Variable IP_mod_err

er_list_t IP_mod_err[]
Included from include/er_IP_errors.h
Visible in:  modules/er/er.c
Used in:  modules/er/er.c

Global Variable UP_mod_err

er_list_t UP_mod_err[]
Included from include/er_UP_errors.h
Visible in:  modules/er/er.c
Used in:  modules/er/er.c

Global Variable UT_mod_err

er_list_t UT_mod_err[]
Included from include/er_UT_errors.h
Visible in:  modules/er/er.c
Used in:  modules/er/er.c

Global Variable WH_mod_err

er_list_t WH_mod_err[]
Included from include/er_WH_errors.h
Visible in:  modules/er/er.c
Used in:  modules/er/er.c

Global Variable RP_mod_err

er_list_t RP_mod_err[]
Included from include/er_RP_errors.h
Visible in:  modules/er/er.c
Used in:  modules/er/er.c

Global Variable QI_mod_err

er_list_t QI_mod_err[]
Included from include/er_QI_errors.h
Visible in:  modules/er/er.c
Used in:  modules/er/er.c

Global Variable QC_mod_err

er_list_t QC_mod_err[]
Included from include/er_QC_errors.h
Visible in:  modules/er/er.c
Used in:  modules/er/er.c

Global Variable PW_mod_err

er_list_t PW_mod_err[]
Included from include/er_PW_errors.h
Visible in:  modules/er/er.c
Used in:  modules/er/er.c

Global Variable SK_mod_err

er_list_t SK_mod_err[]
Included from include/er_SK_errors.h
Visible in:  modules/er/er.c
Used in:  modules/er/er.c

Global Variable TH_mod_err

er_list_t TH_mod_err[]
Included from include/er_TH_errors.h
Visible in:  modules/er/er.c
Used in:  modules/er/er.c

Global Variable SQ_mod_err

er_list_t SQ_mod_err[]
Included from include/er_SQ_errors.h
Visible in:  modules/er/er.c
Used in:  modules/er/er.c

Global Variable PM_mod_err

er_list_t PM_mod_err[]
Included from include/er_PM_errors.h
Visible in:  modules/er/er.c
Used in:  modules/er/er.c

Global Variable MM_mod_err

er_list_t MM_mod_err[]
Included from include/er_MM_errors.h
Visible in:  modules/er/er.c
Used in:  modules/er/er.c

Global Variable SV_mod_err

er_list_t SV_mod_err[]
Included from include/er_SV_errors.h
Visible in:  modules/er/er.c
Used in:  modules/er/er.c

Global Variable AC_mod_err

er_list_t AC_mod_err[]
Included from include/er_AC_errors.h
Visible in:  modules/er/er.c
Used in:  modules/er/er.c

Global Variable UD_mod_err

er_list_t UD_mod_err[]
Included from include/er_UD_errors.h
Visible in:  modules/er/er.c
Used in:  modules/er/er.c

Global Variable PA_mod_err

er_list_t PA_mod_err[]
Included from include/er_PA_errors.h
Visible in:  modules/er/er.c
Used in:  modules/er/er.c

Global Variable PC_mod_err

er_list_t PC_mod_err[]
Included from include/er_PC_errors.h
Visible in:  modules/er/er.c
Used in:  modules/er/er.c

Global Variable er_fac_err

er_fac_t er_fac_err[]
Included from modules/er/er_facilities.h
Visible in:  modules/er/er.c
Used in: er_format_line()modules/er/er.c

Global Variable er_asparr

er_aspstr_t er_asparr[]
Included from modules/er/er_aspects.h
Visible in:  modules/er/er.c

Global Variable er_formarr

er_form_el er_formarr[]
Included from modules/er/er_formats.h
Visible in:  modules/er/er.c

Global Variable er_level_a

er_level_t er_level_a[]
Included from modules/er/erroutines.h
Visible in:  modules/er/er.c

Global Variable er_pathlist

GList* er_pathlist
Included from modules/er/erroutines.h
Visible in:  modules/er/er.c
Used in: er_logit()modules/er/er.c

Global Variable er_asparray

er_mask_t er_asparray[FAC_LAST]
Included from modules/er/erroutines.h
Visible in:  modules/er/er.c
Used in: ER_is_traced()modules/er/er.c

Global Variable er_progname

char er_progname[32]
Included from modules/er/erroutines.h
Visible in:  modules/er/er.c
Used in: ER_init()modules/er/er.c
  er_format_line()modules/er/er.c

Global Variable er_pid

char er_pid[16]
Included from modules/er/erroutines.h
Visible in:  modules/er/er.c
Used in: ER_init()modules/er/er.c
  er_format_line()modules/er/er.c

Global Variable er_pathlist_mutex

pthread_mutex_t er_pathlist_mutex
Included from modules/er/erroutines.h
Visible in:  modules/er/er.c

Global Function ER_asp_va()

void ER_asp_va ( er_fac_code_t facwhere, int sev, er_mask_t asp, char* txt, va_list args )
Calls: er_getmsg_parts()modules/er/er.c
  er_logit()modules/er/er.c
Called by: ER_inf_va()modules/er/er.c

Global Function ER_dbg_va()

void ER_dbg_va ( er_fac_code_t facwhere, er_mask_t asp, char* txt, ... )
Prototyped in: modules/er/erroutines.h
Calls: ER_is_traced()modules/er/er.c
  er_getmsg_parts()modules/er/er.c
  er_logit()modules/er/er.c
  __builtin_next_arg(), __builtin_saveregs()
Called by: AC_decay()modules/ac/access_control.c

Global Function ER_inf_va()

void ER_inf_va ( er_fac_code_t facwhere, er_mask_t asp, char* txt, ... )
Prototyped in: modules/er/erroutines.h
Calls: ER_asp_va()modules/er/er.c
  __builtin_next_arg(), __builtin_saveregs()
Called by: AC_ban_set()modules/ac/access_control.c

Global Function ER_init()

void ER_init ( char* progname, int processdefs )
Prototyped in: modules/er/erroutines.h
Calls: ER_macro_predef(), ER_proc_ca_err(), ER_proc_ca_macro(), getpid(), snprintf(), strncpy()
References Variables: er_pidmodules/er/er.c
  er_prognamemodules/er/er.c

Global Function ER_is_errorlogged()

int ER_is_errorlogged ( er_fac_code_t facwhere, int errcode )
Called by: ER_perror()modules/er/er.c

Global Function ER_is_traced()

int ER_is_traced ( er_fac_code_t facwhere, er_mask_t asp )
Prototyped in: modules/er/erroutines.h
Called by: ER_dbg_va()modules/er/er.c
References Variables: er_asparraymodules/er/er.c

Global Function ER_perror()

void ER_perror ( er_fac_code_t facwhere, int errcode, char* format, ... )
Prototyped in: modules/er/erroutines.h
Calls: ER_is_errorlogged()modules/er/er.c
  er_getmsg_parts()modules/er/er.c
  er_logit()modules/er/er.c
  __builtin_next_arg(), __builtin_saveregs()

Global Function NOERR()

int NOERR ( er_ret_t a )
Prototyped in: modules/er/erroutines.h
Called by: AC_asc_acl_command_set()modules/ac/access_control.c
  AC_asc_all_set()modules/ac/access_control.c
  AC_asc_ban_set()modules/ac/access_control.c
  AC_asc_set_nodeny()modules/ac/access_control.c
  AC_ban_set()modules/ac/access_control.c
  AC_commit()modules/ac/access_control.c
  AC_commit_credit()modules/ac/access_control.c
  AC_findcreate_acl_l()modules/ac/access_control.c

Global Function er_forkexec()

int er_forkexec ( char** argv, char* msg, int usepath )
Calls: close(), dup2(), execv(), execvp(), exit(), fork1(), perror(), pipe(), strlen(), wait(), write()
Called by: er_logtopath()modules/er/er.c

Global Function er_format_line()

char* er_format_line ( char* erbuf, er_fac_code_t facwhere, er_mask_t asp, int mode, int errcode, char* tmbuf )
Calls: __eprintf(), er_getfacsym(), er_getsevsym(), pthread_self(), snprintf(), sprintf()
Called by: er_logit()modules/er/er.c
References Variables: er_fac_errmodules/er/er.c
  er_pidmodules/er/er.c
  er_prognamemodules/er/er.c

Global Function er_get_printmode()

int er_get_printmode ( er_path_t* pathstruct )

Global Function er_getmsg_parts()

void er_getmsg_parts ( char* buf, int buflen, char* fmttxt, va_list args )
Calls: vsnprintf()
Called by: ER_asp_va()modules/er/er.c
  ER_dbg_va()modules/er/er.c
  ER_perror()modules/er/er.c

Global Function er_logit()

void er_logit ( er_fac_code_t facwhere, er_mask_t asp, int errcode, char* msg )
Calls: er_format_line()modules/er/er.c
  er_logtopath()modules/er/er.c
  er_msgsel()modules/er/er.c
  g_list_first(), gettimeofday(), localtime_r(), strftime()
Called by: ER_asp_va()modules/er/er.c
  ER_dbg_va()modules/er/er.c
  ER_perror()modules/er/er.c
References Variables: er_pathlistmodules/er/er.c

Global Function er_msgsel()

int er_msgsel ( er_filter_t* filtptr, er_fac_code_t facwhere, er_mask_t asp, er_ret_t errcode )
Calls: MA_isset(), pthread_self()
Called by: er_logit()modules/er/er.c

Local Function er_logtopath()

static void er_logtopath ( er_path_t* pathptr, char* form, char* msg )
Calls: er_forkexec()modules/er/er.c
  close(), fprintf(), gettimeofday(), localtime_r(), open(), perror(), strcat(), strcpy(), strftime(), strlen(), write()
Called by: er_logit()modules/er/er.c