Main Page | Data Structures | Directories | File List | Data Fields | Globals

main.c File Reference

#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <debug.h>
#include <drive.h>
#include <drivers/drivers.h>
#include <recorder.h>
#include <conf.h>

Include dependency graph for main.c:

Include dependency graph

Go to the source code of this file.

Functions

RETSIGTYPE signal_handler (int signal)
 The signal handler for the process.
int main (int argc, char **argv)
 The main entry point.


Function Documentation

int main int  argc,
char **  argv
 

The main entry point.

One optional argument specifying the name of the configuration file to use is accepted. Any extra arguments will be silently ignored.

Parameters:
argc number of arguments
argv array of arguments
Return values:
0 success
-1 error

Definition at line 44 of file main.c.

References driver_t::alloc, conf, driver_t::drive, drive(), conf_t::driver, driver_t::free, read_conf(), recorder_export(), recorder_init(), and signal_handler().

Here is the call graph for this function:

RETSIGTYPE signal_handler int  signal  ) 
 

The signal handler for the process.

The main purpose for the signal handler is to override the default actions for SIGINT, SIGABRT, and SIGTERM. We must override the default exit behavior so that we may call recorder_export() before exit() is called.

Parameters:
signal signal number
Returns:
if RETSIGTYPE is non-void, then we return 0.

Definition at line 21 of file main.c.

References recorder_export().

Referenced by main().

Here is the call graph for this function:


Generated on Thu Sep 6 13:13:19 2007 for driver by  doxygen 1.3.9.1