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

configparser.h File Reference

configuration parser functions and datatypes More...

Go to the source code of this file.

Data Structures

struct  s_conf_opt
struct  s_configfile
struct  s_configuration
struct  s_handler_config
struct  s_module
struct  s_module_config
struct  s_name_value

Typedefs

typedef s_conf_opt t_conf_opt
typedef s_configfile t_configfile
typedef int(* t_take )(t_configfile *cfile, t_conf_opt *entry, u_char **args, int len)
typedef int(* t_take_default )(t_configfile *cfile, u_char **args, int len)
typedef s_name_value t_name_value
typedef s_configuration t_configuration
typedef s_handler_config t_handler_config
typedef void(* t_finish )(void)
typedef int(* t_cache_revalidator )(t_cf_hash *, t_configuration *, t_configuration *, time_t, int)
typedef int(* t_header_hook )(t_cf_hash *, t_cf_hash *, t_configuration *, t_configuration *, int)
typedef time_t(* t_last_modified )(t_cf_hash *, t_configuration *, t_configuration *, int)
typedef s_module_config t_module_config
typedef s_module t_module

Functions

t_arrayget_conf_file (const u_char **which, size_t llen)
int read_config (t_configfile *conf, t_take_default deflt)
void cfg_init_file (t_configfile *conf, u_char *filename)
int cfg_register_options (t_configfile *conf, t_conf_opt *opts)
void cfg_cleanup_file (t_configfile *conf)
void cleanup_modules (t_array *modules)
int handle_command (t_configfile *cfile, t_conf_opt *opt, u_char **args, int argnum)
int add_module (t_configfile *cfile, t_conf_opt *opt, u_char **args, int argnum)
void cfg_cleanup (t_configuration *cfg)
t_name_valuecfg_get_value (t_configuration *cfg, const u_char *name)
void cfg_destroy_module (void *element)

Variables

t_configuration fo_default_conf
t_configuration fo_server_conf
t_configuration fo_view_conf
t_configuration fo_arcview_conf
t_configuration fo_post_conf
t_conf_opt default_options []
t_conf_opt fo_view_options []
t_conf_opt fo_post_options []
t_conf_opt fo_server_options []
t_conf_opt fo_arcview_options []
t_array Modules []


Detailed Description

configuration parser functions and datatypes

Author:
Christian Kruse, <cjk@wwwtech.de>
This file contains the configuration parser used by this project

Definition in file configparser.h.


Typedef Documentation

typedef int(* t_cache_revalidator)(t_cf_hash *,t_configuration *,t_configuration *,time_t,int)
 

This function type is used for cache revalidation

Definition at line 93 of file configparser.h.

typedef struct s_conf_opt t_conf_opt
 

look at s_conf_opt

Definition at line 25 of file configparser.h.

typedef struct s_configfile t_configfile
 

look at s_configfile

Definition at line 28 of file configparser.h.

typedef struct s_configuration t_configuration
 

A structure to save configuration data

typedef void(* t_finish)(void)
 

This function type is used for cleaning up module specific data

Definition at line 90 of file configparser.h.

typedef struct s_handler_config t_handler_config
 

Plugin API. This structure saves handler configurations

typedef int(* t_header_hook)(t_cf_hash *,t_cf_hash *,t_configuration *,t_configuration *,int)
 

This function type is used for the HTTP header hook

Definition at line 96 of file configparser.h.

typedef time_t(* t_last_modified)(t_cf_hash *,t_configuration *,t_configuration *,int)
 

This function type is used for the Last Modified header revalidation

Definition at line 99 of file configparser.h.

typedef struct s_module t_module
 

This structure saves the information of all modules in a linked list

typedef struct s_module_config t_module_config
 

This structure saves a configuration of a module

typedef struct s_name_value t_name_value
 

A list of name-value-pairs

typedef int(* t_take)(t_configfile *cfile,t_conf_opt *entry,u_char **args,int len)
 

This type of function is expected as a callback function

Parameters:
cfile The configuration file structure
entry The configuration option entry
args The directive arguments
len The length of the arguments array
Returns:
0 on success, any other value for failure

Definition at line 38 of file configparser.h.

typedef int(* t_take_default)(t_configfile *cfile,u_char **args,int len)
 

This type of function is expected as a standard callback function (if no configuration directive entry could be found)

Parameters:
cfile The configuration file structure
args The directive arguments
len The length of the directives array
Returns:
0 on success, any other value for failure

Definition at line 47 of file configparser.h.


Function Documentation

int add_module t_configfile cfile,
t_conf_opt opt,
u_char **  args,
int  argnum
 

This function adds a plugin into the program space

Parameters:
cfile The configuration file structure
opt The configuration option entry
args The argument list
argnum The number of arguments
Returns:
0 on success, any other value on error

Definition at line 501 of file configparser.c.

void cfg_cleanup t_configuration cfg  ) 
 

This function cleans up a configuration file structure

Parameters:
cfg The configuration file structure

Definition at line 565 of file configparser.c.

void cfg_cleanup_file t_configfile conf  ) 
 

This function cleans up a configuration file structure

Parameters:
conf The configuration file structure

Definition at line 681 of file configparser.c.

void cfg_destroy_module void *  element  ) 
 

destructor function for the modules array

Parameters:
element An array element

Definition at line 585 of file configparser.c.

t_name_value* cfg_get_value t_configuration cfg,
const u_char *  name
 

This function returns a configuration entry

Parameters:
cfg The configuration file structure
name The configuration entry name
Returns:
NULL if not found, the t_name_value structure on success

Definition at line 620 of file configparser.c.

void cfg_init_file t_configfile conf,
u_char *  filename
 

This function initializes a configuration file structure

Parameters:
conf The configuration file structure
filename The configuration file filename

Definition at line 642 of file configparser.c.

int cfg_register_options t_configfile conf,
t_conf_opt opts
 

This function registeres configuration options in the configuration file structure

Parameters:
conf The configuration file structure
opts The configuration options

Definition at line 657 of file configparser.c.

void cleanup_modules t_array modules  ) 
 

This function cleans up the modules structure

Parameters:
modules The modules array

Definition at line 603 of file configparser.c.

t_array* get_conf_file const u_char **  which,
size_t  llen
 

This function expects a list of config names (e.g. fo_default, fo_view, fo_post) and its length. It uses the CF_CONF_DIR environment variable to decide where the config files can be found. It returns successfully an array, when all wanted files could be found. It returns NULL if one of them could not be found.

Parameters:
which The list of wanted configuration files
llen The length of the list
Returns:
An array containing the full path to the config files in the order given by the list

Definition at line 226 of file configparser.c.

int handle_command t_configfile cfile,
t_conf_opt opt,
u_char **  args,
int  argnum
 

This function handles a configuration entry.

Parameters:
cfile The configuration file structure
opt The configuration option entry
args The argument list
argnum The length of the argument list
Returns:
0 on success, any other value on error

Definition at line 481 of file configparser.c.

int read_config t_configfile conf,
t_take_default  deflt
 

This function parses a configuration file.

Parameters:
conf The configuration file structure
deflt The default callback function
Returns:
0 on success, a value unequal 0 on failure

Definition at line 348 of file configparser.c.


Variable Documentation

t_conf_opt default_options[]
 

The default configuration options

Definition at line 124 of file configparser.h.

t_configuration fo_arcview_conf
 

The configuration data of the archive viewer

Definition at line 121 of file configparser.h.

t_conf_opt fo_arcview_options[]
 

The archiv viewer configuration options

Definition at line 128 of file configparser.h.

t_configuration fo_default_conf
 

The configuration data of the default configuration

Definition at line 118 of file configparser.h.

t_configuration fo_post_conf
 

The configuration data of the archive viewer

Definition at line 122 of file configparser.h.

t_conf_opt fo_post_options[]
 

The posting configuration options

Definition at line 126 of file configparser.h.

t_configuration fo_server_conf
 

The configuration data of the server

Definition at line 119 of file configparser.h.

t_conf_opt fo_server_options[]
 

The server configuration options

Definition at line 127 of file configparser.h.

t_configuration fo_view_conf
 

The configuration data of the forum viewer

Definition at line 120 of file configparser.h.

t_conf_opt fo_view_options[]
 

The client configuration options

Definition at line 125 of file configparser.h.

t_array Modules[]
 

The modules array

Definition at line 130 of file configparser.h.


Generated on Sun Apr 25 16:37:39 2004 for Classic Forum by doxygen 1.3.5