File src/read_sched.c

Reads in a show schedule and sets up the ALLSHOWS 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 WEEK

An array that holds all of the half-hour slots for an entire week, which is the period of time that the ubs runs off of. This array contains integers which correspond to show ID's

int WEEK[7][48]
Included from include/ubs-sched.h


Global Variable ALLSHOWS

All the known shows

struct show* ALLSHOWS
Included from include/ubs-sched.h


Global Variable SCHED

ubs_table SCHED
Included from include/ubs-sched.h

Global Function read_sched()

Reads in the schedule and does all the gruntwork. This is mostly accomplished by using a rather large state machine to determine where we are in the file, and set the according values in the ALLSHOWS array.

int read_sched ( char* config_fname )

int read_sched
Returns NO on success (same as OK), YES if invalid shows were found, and NO_MEM for memory errors
char* config_fname
The name of the schedule to parse
Prototyped in: include/ubs-sched.h
Calls: log_error_msg()lib/logging.c
  read_config()lib/read_config.c
  ubs_table_data()lib/table.c
  ubs_table_exists()lib/table.c
  ubs_table_init()lib/table.c
  atoi(), bzero(), fprintf(), malloc(), snprintf(), strcasecmp(), strchr(), strcmp(), strncpy()