File src/read_events.c

This file reads in the ubs.conf file, looking for anything in the events context, then adding these events to the ALLEVENTS array.


Included Files


Global Variable PROCNAME

char PROCNAME[128]
Included from include/ubs.h

Global Variable CUR_TIME

struct tm* CUR_TIME
Included from include/ubs.h

Global Variable GLOBAL

ubs_table GLOBAL
Included from include/ubs.h

Global Variable LOGLEVEL

int LOGLEVEL
Included from include/ubs.h

Global Variable ALLEVENTS

All known events which were parsed in the configuration file

struct event* ALLEVENTS
Included from include/ubs-event.h


Global Variable EVENT

ubs_table EVENT
Included from include/ubs-event.h

Global Function read_events()

Open up a configuration file and put the events into an array. This function expects each event will be on a line, in the form event = time.

int read_events ( char* config_fname )

int read_events
Returns NO on success (same as OK), YES if one or more events is invalid, NO_MEM for memory allocation errors, FAIL if 0 events were found
char* config_fname
The filename of the configuration file to parse
Prototyped in: include/ubs-event.h
Calls: log_error_msg()lib/logging.c
  read_config()lib/read_config.c
  ubs_table_data()lib/table.c
  ubs_table_init()lib/table.c
  atoi(), fprintf(), malloc(), snprintf(), strchr(), strdup(), strncpy()