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

lcmaps_setup.c File Reference

setup the LCMAPS environment More...

#include "lcmaps_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 <unistd.h>
#include "lcmaps_setup.h"
#include "_lcmaps_utils.h"
#include "_lcmaps_log.h"

Go to the source code of this file.

Functions

int lcmaps_setup (const char *config_file)
 Setup of the LCMAPS environment.


Detailed Description

setup the LCMAPS environment

Author:
Martijn Steenbakkers for the EU DataGrid.
This file contains the routines to setup the LCMAPS 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. lcmaps_setup(): set the lcmaps environment

Definition in file lcmaps_setup.c.


Function Documentation

lcmaps_setup const char *  config_file  ) 
 

Setup of the LCMAPS environment.

This function sets the following environment variables:

  1. LCMAPS_LOG_FILE: Name and location of the logfile
  2. LCMAPS_LOG_TYPE: Type of logging (logfile, syslog, both or none)
  3. LCMAPS_LOG_STRING: Log string to be prepended to the logging lines
  4. LCMAPS_DB_FILE: Name of the lcmaps policy file
  5. LCMAPS_DEBUG_LEVEL: Debug level (0-5)
  6. LCMAPS_MOD_DIR: Location of the LCMAPS library
  7. LCMAPS_DIR: Location of the LCMAPS config files
  8. LCMAPS_ETC_DIR: Location of the LCMAPS config files (=LCMAPS_DIR)
  9. LCMAPS_POLICY_STRING The list of policies (default = NULL)
  10. LCMAPS_POLICY_ACQ_STRING The list of acquisition policies (default = acquisition_policy)
  11. LCMAPS_POLICY_ENF_STRING The list of enforcement policies (default = enforcement_policy)

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 167 of file lcmaps_setup.c.

References DO_SYSLOG, DO_USRLOG, lcmaps_genfilename(), LCMAPS_MAXARGS, LCMAPS_SETUP_ERROR_ARGUMENT, LCMAPS_SETUP_ERROR_CLOSE, LCMAPS_SETUP_ERROR_OPEN, LCMAPS_SETUP_ERROR_PARSE, LCMAPS_SETUP_ERROR_READ, LCMAPS_SETUP_ERROR_READ_SIZE, and lcmaps_tokenize().


Generated on Sun May 29 21:22:12 2005 for lcmaps by doxygen 1.3.5