File er/er_macro.c

  $Revision: 1.12 $

Error reporting (er) er_macro.c - simple macro processor
Status: NOT REVUED, PARTLY TESTED
Design and implementation by: Marek Bukowy

Included Files


Preprocessor definitions

#define DBUPDLOG_FORMAT " FORMAT SEVCHAR|FACSYMB|TEXTLONG|DATETIME|PIDFULL|PROGNAME|MNEMONIC "

#define RIPLOG_FORMAT " FORMAT SEVCHAR|FACSYMB|TEXTLONG|DATETIME|PIDFULL|PROGNAME|THR_ID|MNEMONIC "


Global Variable Lock

pthread_mutex_t Lock
Included from /home/shane/code/RIP/include/ca_defs.h
Visible in:  aa/aa.c
   ac/access_control.c
   ca/ca_configFns.c
   ca/ca_initFn.c
   ca/ca_sanityCheck.c
   ca/ca_sourceLoader.c
   ca/ca_values.c
   co/constants.c
   df/defs.c
   er/er.c
   er/er_arrays.c
   er/er_macro.c
Used in: ca_get_adminIntElement()ca/ca_configFns.c
  ca_get_adminStrElement()ca/ca_configFns.c
  ca_get_boolean()ca/ca_configFns.c
  ca_get_dirlist()ca/ca_configFns.c
  ca_get_int()ca/ca_configFns.c
  ca_get_string()ca/ca_configFns.c
  ca_set_boolean()ca/ca_configFns.c
  ca_srchandle2Intelement()ca/ca_configFns.c
  ca_srchandle2Strelement()ca/ca_configFns.c

Global Function ER_macro_list()

  Lists all currently defined macros to the given connection.
void ER_macro_list ( sk_conn_st* condat )
sk_conn_st* condat
connection data structure
Prototyped in: /home/shane/code/RIP/include/er_macro.h
Calls: TH_acquire_read_lock(), TH_release_read_lock(), g_hash_table_foreach()
References Functions: er_macro_list_hook()er/er_macro.c

Global Function ER_macro_predef()

  predefine some macros useful for the whois_rip server.
  XXX - this should not be here, it should be done via the CA module!
void ER_macro_predef ( void )
Prototyped in: /home/shane/code/RIP/include/er_macro.h
Calls: ER_make_macro()er/er_macro.c
Called by: ER_init()er/er.c

Global Function ER_macro_spec()

  Take a text line and parse it as an error specification
  line. Optionally, if the first word is a macro, run the macro using
  other words as its arguments.  This is basically a wrapper around
  ER_process_split() that splits the string into argv and calls the
  ER_parse.

sets the errbuf to the result of ER_parse_spec.
int ER_macro_spec ( char* input, char** errbuf )
int ER_macro_spec
returns 0 on success, non-0 on failure.
char* input
input line
char** errbuf
storage for the result pointer (to allocated text)
Prototyped in: /home/shane/code/RIP/include/er_macro.h
Calls: ER_parse_spec()er/er.yacc.tab.c
  ER_process_split()er/er_macro.c
  UT_free_real(), UT_strdup_real(), g_strfreev(), g_strsplit(), ut_string_compress()
Called by: ER_proc_ca_err()er/er_macro.c

Global Function ER_make_macro()

  (Re)Define a macro.
void ER_make_macro ( char* name, char* def )
char* name
macro name
char* def
macro contents
Prototyped in: /home/shane/code/RIP/include/er_macro.h
Calls: TH_acquire_write_lock(), TH_release_write_lock(), UT_free_real(), UT_strdup_real(), g_hash_table_insert(), g_hash_table_lookup_extended(), g_hash_table_remove()
Called by: ER_macro_predef()er/er_macro.c
  ER_proc_ca_macro()er/er_macro.c

Global Function ER_proc_ca_err()

  Processes the error definitions from the config file. The
  definitions can be specified with the use of a macro or without.
void ER_proc_ca_err ( void )
Prototyped in: /home/shane/code/RIP/include/er_macro.h
Calls: ER_macro_spec()er/er_macro.c
  ca_get_string()ca/ca_configFns.c
  UT_free_real(), fprintf(), fputs(), strchr()
Called by: ER_init()er/er.c

Global Function ER_proc_ca_macro()

 Defines the macros with the definitions from the config file,
 overriding any currently defined ones if the same name is used.
void ER_proc_ca_macro ( void )
Prototyped in: /home/shane/code/RIP/include/er_macro.h
Calls: ER_make_macro()er/er_macro.c
  ca_get_string()ca/ca_configFns.c
  UT_free_real(), fprintf(), strchr(), strtok_r()
Called by: ER_init()er/er.c

Global Function ER_process_split()

  processes a macro call, i.e. executes one of the predefined macros
  selected by the 0th word of the array, using other words as
  arguments to that macro. Uses the er_macro_array[] to find the
  macro definition.  Allocates the result string and stores the
  pointer to it in **output.
int ER_process_split ( int argc, char** argv, char** output )
int ER_process_split
returns 0 on success, non-0 on failure.
int argc
number of words in the word array
char** argv
word array (pointers to strings)
char** output
storage for the result pointer (to allocated text)
Prototyped in: /home/shane/code/RIP/include/er_macro.h
Calls: TH_acquire_write_lock(), TH_release_write_lock(), g_hash_table_lookup(), g_string_append(), g_string_append_c(), g_string_free(), g_string_new(), strlen(), strstr()
Called by: ER_macro_spec()er/er_macro.c

Local Function asctime_r()

static char* asctime_r ( const struct tm* __tm, char* __buf )
Included from: /usr/include/time.h
Calls: __posix_asctime_r()

Local Function ctime_r()

static char* ctime_r ( const time_t* __time, char* __buf )
Included from: /usr/include/time.h
Calls: __posix_ctime_r()

Local Function er_macro_list_hook()

  Prints the arguments (key and value of a hash) to the given
  connection (used for listing the defined macros)
static void er_macro_list_hook ( void* key, void* value, void* condat )
void* key
hash key
void* value
hash value
void* condat
connection data structure
Calls: SK_cd_printf()
Used in: ER_macro_list()er/er_macro.c

Local Function getlogin_r()

static int getlogin_r ( char* __name, int __len )
Included from: /usr/include/unistd.h
Calls: __posix_getlogin_r()

Local Function readdir_r()

static int readdir_r ( DIR* __dp, struct dirent* __ent, struct dirent** __res )
Included from: /usr/include/dirent.h
Calls: __posix_readdir_r()

Local Function sigwait()

static int sigwait ( const sigset_t* __setp, int* __signo )
Included from: /usr/include/signal.h
Calls: __posix_sigwait()

Local Function ttyname_r()

static int ttyname_r ( int __fildes, char* __buf, size_t __size )
Included from: /usr/include/unistd.h
Calls: __posix_ttyname_r()