File src/ubs-event.c

Controls events handling for the UBS, which generally includes special things that must be played at regular intervals. This will be of great use to actual radio stations, but may be strictly optional for regular users. Events have been modularized from internal functions to separate executable programs. Events need not be concerned with playing music; they can also do regular maintainance jobs for the UBS such as recache the search engine and such things. The events scheduler is meant to act as a very primitive cron for the UBS, doing things at certain times every hour. It would be nice to rework the modules of the UBS so they are not so dependent on each other. For instance, home users who don't want to run the events scheduler at all should be able to do so with no hassle. Also, this code is very antiquated, and works by way of things being hardcoded. A flexible events scheduling mechanism is planned to replace this.


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 main()

The main function.

int main ( int argc, char* argv[] )

int main
Returns OK on success
int argc
Should be empty; ignores all arguments
char* argv[]
Should be empty; ignores all arguments
Calls: check_running()lib/common.c
  console_error()lib/logging.c
  gettime()lib/logging.c
  log_error_msg()lib/logging.c
  read_config()lib/read_config.c
  read_events()src/read_events.c
  record_pid()lib/logging.c
  record_status()lib/logging.c
  run_event()src/run_event.c
  ubs_init()lib/common.c
  ubs_table_add()lib/table.c
  ubs_table_data()lib/table.c
  ubs_table_init()lib/table.c
  atoi(), chdir(), exit(), fork(), geteuid(), getgid(), getpid(), setsid(), sleep(), umask()