Main Page | Modules | Data Structures | File List | Data Fields | Globals | Related Pages

lcas_setup.c File Reference

setup the LCAS environment More...

#include "lcas_config.h"
#include <syslog.h>
#include <errno.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "lcas_setup.h"
#include "_lcas_utils.h"
#include "_lcas_log.h"

Go to the source code of this file.

Functions

int lcas_setup (const char *config_file)
 Setup of the LCAS environment.


Detailed Description

setup the LCAS environment

Author:
Martijn Steenbakkers for the EU DataGrid.
This file contains the routines to setup the LCAS environment. The procedure is as follows: 1. If a configuration file is given, parameters will be read from there and the corresponding environment variables will be set. 2. Variables that are not set in the configuration file, but that are set already as an environment variable will be left untouched. 3. Variables that are not set in the configuration file and that are not set in the environment yet, will be set to (sensible) default values and the corresponding environment variables will be set.

  1. lcas_setup(): set the lcas environment

Definition in file lcas_setup.c.


Function Documentation

int lcas_setup const char *  config_file  ) 
 

Setup of the LCAS environment.

This function sets the following environment variables:

  1. LCAS_LOG_FILE: Name and location of the logfile
  2. LCAS_LOG_TYPE: Type of logging (logfile, syslog, both or none)
  3. LCAS_LOG_STRING: Log string to be prepended to the logging lines
  4. LCAS_DB_FILE: Name of the lcas policy file
  5. LCAS_DEBUG_LEVEL: Debug level (0-5)
  6. LCAS_MOD_DIR: Location of the LCAS library
  7. LCAS_DIR: Location of the LCAS config files
  8. LCAS_ETC_DIR: Location of the LCAS config files (=LCAS_DIR)

Parameters:
config_file name of the configuration file that contains the parameters to be read
Return values:
0 setup succeeded.
1 setup failed.

Definition at line 155 of file lcas_setup.c.

References DO_SYSLOG, DO_USRLOG, lcas_genfilename(), LCAS_MAXARGS, LCAS_SETUP_ERROR_ARGUMENT, LCAS_SETUP_ERROR_CLOSE, LCAS_SETUP_ERROR_OPEN, LCAS_SETUP_ERROR_PARSE, LCAS_SETUP_ERROR_READ, LCAS_SETUP_ERROR_READ_SIZE, and lcas_tokenize().


Generated on Fri May 27 18:10:49 2005 for lcas by doxygen 1.3.5