$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 "
pthread_mutex_t Lock
Lists all currently defined macros to the given connection.
void ER_macro_list ( sk_conn_st* condat )
- sk_conn_st* condat
- connection data structure
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 )
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)
(Re)Define a macro.
void ER_make_macro ( char* name, char* def )
- char* name
- macro name
- char* def
- macro contents
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 )
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 )
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)
static char* asctime_r ( const struct tm* __tm, char* __buf )
static char* ctime_r ( const time_t* __time, char* __buf )
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
static int getlogin_r ( char* __name, int __len )
static int readdir_r ( DIR* __dp, struct dirent* __ent, struct dirent** __res )
static int sigwait ( const sigset_t* __setp, int* __signo )
static int ttyname_r ( int __fildes, char* __buf, size_t __size )