File lib/read_config.c

Reads in the ubs.conf file, and stores any information parsed from a specific section into a ubs_table data structure.


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 Function read_config()

Reads in the configuration file for a given context

int read_config ( char* fname, char* section, ubs_table* table )

int read_config
Returns NO if no errors occurred during parsing, NO_FILE if the configuration file could not be opened, or YES if any error occurred during parsing.
char* fname
The name of the configuration file to read
char* section
The context name to parse
ubs_table* table
Data structure where the data is to be stored
Prototyped in: include/ubs.h
Calls: chomp_line()lib/parse_line.c
  parse_line()lib/parse_line.c
  fclose(), fgets(), fopen(), printf(), snprintf(), strcasecmp(), strchr(), strncpy(), ubs_table_add(), ubs_table_data()