Main Page   Data Structures   File List   Data Fields   Globals   Related Pages  

conftable.h File Reference

PDepp's configuration table module. More...

#include "common.h"

Include dependency graph for conftable.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define CONFENTRY_KEY_ROOTDIR   "rootdir"
 standard configfile key for the rootdir.

#define CONFENTRY_KEY_PORT   "port"
 standard configfile key for the portnumber.

#define CONFENTRY_KEY_CONFIGFILE   "configfile"
 standard parameterkey for the configfile.

#define CONFENTRY_KEY_STDLOGFILE   "logfile"
 standard logfile (eg. the one given on the command line).

#define CONFENTRY_KEY_LOGFILE   "log%s.file"
 standard configfile key for the logfile.

#define CONFENTRY_KEY_LOGORIGINFLAGS   "log%s.origin"
 standard configfile key specifying the origin of the data logged.

#define CONFENTRY_KEY_LOGFORMAT   "log%s.format"
 standard configfile key for the logfile format (used also as "logformatN").

#define CONFENTRY_KEY_MIMETYPES   "mimetypes"
 standard configfile key for the mimetypes-file.

#define CONFENTRY_KEY_USER   "user"
 standard configfile key for "user".

#define CONFENTRY_KEY_GROUP   "group"
 standard configfile key for "group".

#define CONFENTRY_KEY_REPLYSERVERNAME   "replyservername"
 standard configfile key for a boolean value if servername should be replied.

#define CONFENTRY_KEY_SENDBUFFER   "sendbuffer"
 standard configfile key for the sendbuffer size.

#define CONFENTRY_KEY_RECVBUFFER   "recievebuffer"
 standard configfile key for the recieve buffer size.

#define CONFENTRY_KEY_CONNTIMEOUT   "connectiontimeout"
 specify a connection idle timeout in seconds.

#define CONFENTRY_KEY_CONNMAXCOUNT   "connectionmaxcount"
 number of maximum concurrent connections allowed.

#define CONFENTRY_KEY_INDEXHTML   "standardfile"
 standard configfile key for the standardfile to be returned.

#define STD_CONFENTRY_VAL_PORT   1952
 standard port (remember D.A. ;) ).

#define STD_CONFENTRY_VAL_CONFIGFILE   "pdepp.conf"
 standard config file.

#define STD_CONFENTRY_VAL_LOGFILE   "pdepp.log"
 standard log file.

#define STD_CONFENTRY_VAL_LOGORIGINFLAGS   "aA"
 standard log content.

#define STD_CONFENTRY_VAL_LOGFORMAT   "%Y-%M-%D %w %h:%m:%s -%S: %L"
 standard logfile format.

#define STD_CONFENTRY_VAL_SENDBUFFER   16000
 standard send buffer size.

#define STD_CONFENTRY_VAL_RECVBUFFER   4096
 standard recieve buffer size.

#define STD_CONFENTRY_VAL_MIMETYPES   "mime.types"
 standard mime types file.

#define STD_CONFENTRY_VAL_INDEXHTML   "index.html"
 standard open file.

#define STD_CONFENTRY_VAL_USER   "nobody"
 standard user.

#define STD_CONFENTRY_VAL_GROUP   "nogroup"
 standard group.

#define STD_CONFENTRY_VAL_REPLYSERVERNAME   "true"
 standardvalue to reply servername.

#define STD_CONFENTRY_VAL_CONNTIMEOUT   60
 standard "idle connection timeout" value in secs.

#define STD_CONFENTRY_VAL_CONNMAXCOUNT   1000
 standard maxmimum number of concurrent connections.

#define CONFENTRY_VAL_TRUE   "true"
 symbolic name for a string representing the boolean value "true".

#define CONFENTRY_VAL_FALSE   "false"
 symbolic name for a string representing the boolean value "false".

#define PRIO_CFGFILE   1
 Priority configfile (does not overwrite old value).

#define PRIO_CMDLINE   2
 Priority comandline (overwrites old value).

#define PRIO_PRGCALL   3
 Priority call from program (overwrites old value).


Functions

int initConftable ()
 inits the Conftable.

int terminateConftable ()
 terminates the Conftable and frees the allocated memory.

int setEntry (const int priority, char *const key, char *const value)
 Adds or sets a new key-value-pair. More...

int setEntryL (const int priority, char *const key, const long value)
 Adds or sets a new key-value-pair with 'long int' parameter. More...

const char * getEntry (const char *const key)
 Returns a value to a given key. More...

const char * getEntryDefl (const char *const key, const char *const defl_data)
 returns a value to a given key or defl_data of the key cannot be found. More...

long getEntryL (const char *const key)
 Returns a value to a given key as 'long int'. More...

long int getEntryDeflL (const char *const key, long int defl_data)
 same as getEntryL, but if no value is found the defl_data is returned. More...

int getEntryI (const char *const key)
 Returns a value to a given key as 'int'. More...

int getEntryDeflI (const char *const key, int defl_data)
 same as getEntryI, but if no value is found the defl_data is returned. More...

unsigned int getEntryDeflUI (const char *const key, unsigned int defl_data)
 same as getEntryDeflI, but if value < 0 defl_data is returned. More...

int readConfigFile ()
 reads a given config file. More...


Detailed Description

PDepp's configuration table module.

Definition in file conftable.h.


Function Documentation

const char* getEntry const char *const    key
 

Returns a value to a given key.

Null is returned when key is not found, else the key-value is returned

Parameters:
key  The key to which an entry is requested
Return values:
NULL  Key not found.

Referenced by getEntryDefl(), getEntryL(), logfilesInit(), main(), and rhfModulePreInit().

const char* getEntryDefl const char *const    key,
const char *const    defl_data
 

returns a value to a given key or defl_data of the key cannot be found.

Parameters:
key  the key to which an entry is requested
Returns:
the data corresponding to the given key or defl_data if the key could not be found

Referenced by changeUserGroupID(), htModulePreInit(), logfilesInit(), readConfigFile(), and rhfModulePreInit().

int getEntryDeflI const char *const    key,
int    defl_data
 

same as getEntryI, but if no value is found the defl_data is returned.

Parameters:
key  the key, to which the entry is looked up
defl_data  the data returned, if no entry is found
Returns:
entry, if none, defl_data

Referenced by svMain().

long int getEntryDeflL const char *const    key,
long int    defl_data
 

same as getEntryL, but if no value is found the defl_data is returned.

Parameters:
key  the key, to which the entry is looked up
defl_data  the data returned, if no entry is found
Returns:
entry, if none, defl_data

Referenced by chModulePreInit().

unsigned int getEntryDeflUI const char *const    key,
unsigned int    defl_data
 

same as getEntryDeflI, but if value < 0 defl_data is returned.

Parameters:
key  the key, to which the entry is looked up
defl_data  the data returned, if no entry is found or entry < 0
Returns:
entry, if none or entry < 0, defl_data

Referenced by initServer(), and rhfModulePreInit().

int getEntryI const char *const    key
 

Returns a value to a given key as 'int'.

0 is returned when key is not found, else the key-value is returned

Parameters:
key  The key to which an entry is wanted
Return values:
0  Key not found. Errno gives further information.

Referenced by getEntryDeflI(), and getEntryDeflUI().

long getEntryL const char *const    key
 

Returns a value to a given key as 'long int'.

0 is returned when key is not found, else the key-value is returned

Parameters:
key  The key to which an entry is wanted
Return values:
0  Key not found. Errno gives further information.

Referenced by getEntryDeflL(), and getEntryI().

int readConfigFile  
 

reads a given config file.

the config file given by "configfile" is parsed and inserted to the internal conftable - structure

Returns:
0 on success -1 otherwise

int setEntry const int    priority,
char *const    key,
char *const    value
 

Adds or sets a new key-value-pair.

Parameters:
priority  Sets the priority of the passed value. A commandline value has a higher priority than a config file value!
key  Sets the 'key'
value  Sets the value corresponding to 'key'

Referenced by main(), readConfigFile(), and setEntryL().

int setEntryL const int    priority,
char *const    key,
const long    value
 

Adds or sets a new key-value-pair with 'long int' parameter.

Parameters:
priority  Sets the priority of the passed value. A commandline value has a higher priority than a config file value!
key  Sets the 'key'
value  Sets the value as 'long int' corresponding to 'key'
Return values:
-1  An error occured while passing the value
0  Everything worked fine

Referenced by main().


Generated on Fri Jan 25 22:40:43 2002 for PDepp Webserver by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001