config.cc File Reference

handle the configuration file More...

#include "jabberd.h"
#include <iostream>

Data Structures

struct  shutdown_list
struct  cfg_struct

Defines

#define MAX_INCLUDE_NESTING   20

Typedefs

typedef struct shutdown_list _sd_list
typedef struct shutdown_listsd_list
typedef struct cfg_structcfg
typedef struct cfg_struct _cfg

Functions

int configurate (char *file, xht cmd_line, int is_restart)
void register_config (pool p, char const *node, cfhandler f, void *arg)
void instance_shutdown (instance i)
int configo (int exec)
void shutdown_callbacks (void)
void register_shutdown (shutdown_func f, void *arg)

Variables

xht instance__ids = NULL
sd_list shutdown__list = NULL
xmlnode greymatter__ = NULL
cfg cfhandlers__ = NULL

Detailed Description

handle the configuration file


Define Documentation

#define MAX_INCLUDE_NESTING   20

the maximum number of nexted <jabberd:include/> elements in the configuration


Typedef Documentation

typedef struct cfg_struct _cfg
typedef struct shutdown_list _sd_list

list element to hold a registered shutdown callback

typedef struct cfg_struct * cfg

private config handler list element

typedef struct shutdown_list * sd_list

Function Documentation

int configo ( int  exec  ) 

execute configuration file

Parameters:
exec 0 for the first validation pass, 1 for real startup
Returns:
0 on success, 1 on error

References instance__ids, NTYPE_TAG, xhash_new(), xmlnode_get_firstchild(), xmlnode_get_name(), xmlnode_get_nextsibling(), and xmlnode_get_type().

Referenced by main().

int configurate ( char *  file,
xht  cmd_line,
int  is_restart 
)

parse the configuration file, do inclusions and command line replacements

Parameters:
file the file to parse (NULL to use the default)
cmd_line the command line arguments
is_restart 0 if it is the initial configuration processing, 1 if it is a restart
Returns:
1 on error, 0 on success

References deliver_config_filter(), messages_set_mapping(), NS_JABBERD_CONFIGFILE, xhash_free(), xhash_get(), xhash_new(), xhash_put(), xmlnode_file(), xmlnode_file_borked(), xmlnode_free(), xmlnode_get_attrib_ns(), xmlnode_get_tags(), xmlnode_insert_cdata(), xmlnode_insert_tag_node(), xmlnode_insert_tag_ns(), and xmlnode_put_attrib_ns().

Referenced by main().

void instance_shutdown ( instance  i  ) 

shuts down a single instance, or all the instances, if i == NULL

Parameters:
i which instance to shut down

References instance_struct::hds, instance_struct::id, instance__ids, handel_struct::next, instance_struct::p, handel_struct::p, pool_free(), unregister_instance(), xhash_walk(), and xhash_zap().

void register_config ( pool  p,
char const *  node,
cfhandler  f,
void *  arg 
)

register a function to handle that node in the config file

Parameters:
p memory pool used to allocate data belonging to this registration
node the node that should be handled by the handler
f the handler function that should be registered
arg argument, that should be passed to the handler function

References cfg_struct::arg, cfg_struct::f, cfg_struct::next, cfg_struct::node, pmalloco(), and pstrdup().

Referenced by base_accept(), base_connect(), base_dir(), base_file(), base_format(), base_importspool(), base_load(), base_null(), base_stderr(), base_stdout(), base_syslog(), base_to(), base_unsubscribe(), deliver_init(), mod_auth_crypt(), mod_auth_digest(), mod_auth_plain(), and mod_last().

void register_shutdown ( shutdown_func  f,
void *  arg 
)

register a function to be called on shutdown

Parameters:
f the function to be called on shutdown
arg the argument to be passed to the callback function

References shutdown_list::arg, shutdown_list::f, shutdown_list::next, shutdown_list::p, pmalloco(), and pool_new.

void shutdown_callbacks ( void   ) 

call all registered shutdown callbacks

References shutdown_list::arg, shutdown_list::f, shutdown_list::next, shutdown_list::p, and pool_free().

Referenced by main().


Variable Documentation

cfg cfhandlers__ = NULL

list of config handlers

this holds the parsed configuration file

hash of all created XML routing target instances (key is the id of the instance, value is the instance)

Referenced by configo(), and instance_shutdown().

list of registered shutdown callbacks


Generated on Sat Mar 13 06:00:06 2010 for jabberd14 by  doxygen 1.6.1