jabberd2
2.7.0
|
Go to the source code of this file.
Data Structures | |
struct | build_data |
parse a buffer into a nad More... | |
Functions | |
config_t | config_new (void) |
new config structure More... | |
static void | _config_startElement (void *arg, const char *name, const char **atts) |
static void | _config_endElement (void *arg, const char *name) |
static void | _config_charData (void *arg, const char *str, int len) |
static char * | _config_expandx (config_t c, const char *value, int l) |
int | config_load (config_t c, const char *file) |
turn an xml file into a config hash More... | |
int | config_load_with_id (config_t c, const char *file, const char *id) |
turn an xml file into a config hash More... | |
config_elem_t | config_get (config_t c, const char *key) |
get the config element for this key More... | |
const char * | config_get_one (config_t c, const char *key, int num) |
get config value n for this key More... | |
const char * | config_get_one_default (config_t c, const char *key, int num, const char *default_value) |
get config value n for this key, returns default_value if not found More... | |
int | config_count (config_t c, const char *key) |
how many values for this key? More... | |
char * | config_get_attr (config_t c, const char *key, int num, const char *attr) |
get an attr for this value More... | |
static void | _config_reaper (const char *key, int keylen, void *val, void *arg) |
cleanup helper More... | |
char * | config_expand (config_t c, const char *value) |
void | config_free (config_t c) |
cleanup More... | |
config_t config_new | ( | void | ) |
new config structure
Definition at line 25 of file config.c.
References config_st::hash, and xhash_new().
Referenced by JABBER_MAIN().
|
static |
Definition at line 42 of file config.c.
References build_data::depth, build_data::nad, nad_append_attr(), and nad_append_elem().
Referenced by config_load_with_id().
|
static |
Definition at line 57 of file config.c.
References build_data::depth.
Referenced by config_load_with_id().
|
static |
Definition at line 64 of file config.c.
References build_data::depth, build_data::nad, and nad_append_cdata().
Referenced by config_load_with_id().
|
static |
Definition at line 339 of file config.c.
References config_get_one(), config_st::hash, pstrdup(), and xhash_pool().
Referenced by config_expand(), and config_load_with_id().
int config_load | ( | config_t | c, |
const char * | file | ||
) |
turn an xml file into a config hash
Definition at line 74 of file config.c.
References config_load_with_id().
Referenced by JABBER_MAIN().
int config_load_with_id | ( | config_t | c, |
const char * | file, | ||
const char * | id | ||
) |
turn an xml file into a config hash
Definition at line 80 of file config.c.
References _config_charData(), _config_endElement(), _config_expandx(), _config_startElement(), nad_elem_st::attr, config_elem_st::attrs, build_data::depth, nad_elem_st::depth, config_st::hash, nad_elem_st::iname, nad_elem_st::lname, build_data::nad, config_st::nad, NAD_ANAME, NAD_ANAME_L, NAD_AVAL, NAD_AVAL_L, NAD_CDATA, NAD_CDATA_L, nad_free(), nad_new(), config_elem_st::nvalues, build_data::p, pmalloc(), pmalloco(), pstrdup(), pstrdupx(), config_elem_st::values, xhash_get(), xhash_pool(), and xhash_put().
Referenced by config_load(), and JABBER_MAIN().
config_elem_t config_get | ( | config_t | c, |
const char * | key | ||
) |
get the config element for this key
Definition at line 272 of file config.c.
References config_st::hash, and xhash_get().
Referenced by _c2s_config_expand(), _c2s_hosts_expand(), _c2s_sx_sasl_callback(), _help_disco_extend(), _router_config_expand(), _s2s_config_expand(), _s2s_hosts_expand(), _sm_config_expand(), _sm_hosts_expand(), JABBER_MAIN(), module_init(), and sess_start().
const char* config_get_one | ( | config_t | c, |
const char * | key, | ||
int | num | ||
) |
get config value n for this key
Definition at line 278 of file config.c.
References config_st::hash, config_elem_st::nvalues, config_elem_st::values, and xhash_get().
Referenced by _c2s_config_expand(), _c2s_pidfile(), _config_expandx(), _router_config_expand(), _router_pidfile(), _s2s_config_expand(), _s2s_pidfile(), _sm_config_expand(), _sm_pidfile(), authreg_init(), config_get_one_default(), filter_load(), mm_new(), module_init(), and user_table_load().
const char* config_get_one_default | ( | config_t | c, |
const char * | key, | ||
int | num, | ||
const char * | default_value | ||
) |
get config value n for this key, returns default_value if not found
Definition at line 292 of file config.c.
References config_get_one().
int config_count | ( | config_t | c, |
const char * | key | ||
) |
how many values for this key?
Definition at line 304 of file config.c.
References config_st::hash, config_elem_st::nvalues, and xhash_get().
Referenced by _s2s_config_expand().
char* config_get_attr | ( | config_t | c, |
const char * | key, | ||
int | num, | ||
const char * | attr | ||
) |
get an attr for this value
Definition at line 315 of file config.c.
References nad_elem_st::attr, config_elem_st::attrs, config_st::hash, j_attr(), config_elem_st::nvalues, and xhash_get().
Referenced by _c2s_config_expand(), _router_config_expand(), _s2s_config_expand(), and _sm_config_expand().
|
static |
cleanup helper
Definition at line 326 of file config.c.
References config_elem_st::attrs, and config_elem_st::values.
Referenced by config_free().
char* config_expand | ( | config_t | c, |
const char * | value | ||
) |
Definition at line 334 of file config.c.
References _config_expandx().
void config_free | ( | config_t | c | ) |
cleanup
Replaces $(some.value) with config_get_one(c, "some.value", 0)
Definition at line 411 of file config.c.
References _config_reaper(), config_st::hash, config_st::nad, nad_free(), xhash_free(), and xhash_walk().
Referenced by JABBER_MAIN().