|
jabberd14
1.6.2
|
implements a hashmap using STL containers More...
#include <jabberdlib.h>Namespaces | |
| namespace | xmppd |
Functions | |
| xht | xhash_new (int prima) |
| void | xhash_put (xht h, const char *key, void *val) |
| void * | xhash_get (xht h, const char *key) |
| void * | xhash_get_by_domain (xht h, const char *domain) |
| void | xhash_zap (xht h, const char *key) |
| void | xhash_free (xht h) |
| void | xhash_walk (xht h, xhash_walker w, void *arg) |
| xmlnode | xhash_to_xml (xht h) |
| xht | xhash_from_xml (xmlnode hash, pool p) |
implements a hashmap using STL containers
| void xhash_free | ( | xht | h | ) |
free a xhash structure
| h | the xhash to free |
Referenced by _jsm_shutdown(), configurate(), deliver(), deliver_config_filter(), deliver_shutdown(), dialback(), dnsrv(), js_session_free_aux_data(), js_user_free_aux_data(), jsm_shutdown(), jutil_priority(), main(), mio_init(), mio_ssl_init(), register_instance(), xmppd::resolver::resend_service::resend_service(), xdb_file_cleanup(), xdb_file_phandler(), and xhash_from_xml().
| xht xhash_from_xml | ( | xmlnode | hash, |
| pool | p | ||
| ) |
convert the xmlnode representation of an xhash back to an xhash
| hash | the xhash in xml notation |
References j_atoi(), pstrdup(), xhash_free(), xhash_new(), xhash_put(), xmlnode_get_attrib_ns(), xmlnode_get_data(), xmlnode_get_list_item(), and xmlnode_get_tags().
Referenced by xdb_file_phandler().
| void* xhash_get | ( | xht | h, |
| const char * | key | ||
| ) |
retrive a value from a xhash
| h | the xhash to get the value from |
| key | which value to get |
Referenced by _dialback_miod_hash_cleanup(), _js_routed_packet(), _js_routed_session_control_packet(), configurate(), dialback_in_dbic_cleanup(), dialback_in_read_db(), dialback_in_verify(), dialback_ip_get(), dialback_ip_set(), dialback_out_connection(), dialback_out_packet(), dialback_out_read(), dnsrv_deliver(), dnsrv_lookup(), dnsrv_process_xstream_io(), js_deliver(), js_islocal(), js_packet(), js_user(), register_instance(), srv_lookup(), srv_xhash_join(), unregister_instance(), xdb_file_load(), and xmlnode_get_tags().
| void* xhash_get_by_domain | ( | xht | h, |
| const char * | domain | ||
| ) |
retrive a value from a xhash ... considering the key to be a domain
In contrast to xhash_get() this function interprets the key as a domain and checks all higher level domains, if the key is not found in the hash. If now higher level domains are found either, the key '*' is tried.
Example: For the domain 'a.example.com' the following lookups are done in this order until there is the first match: 'a.example.com', 'example.com', 'com', and '*'.
| h | the xhash to get the value from |
| domain | the domain which should be used as the key |
Referenced by dialback_check_settings(), dialback_in_read(), dialback_in_read_db(), and dialback_out_read().
| xht xhash_new | ( | int | prima | ) |
create a new xhash hash collection
| prime | size of the hash (use a prime number!) |
Referenced by _js_authreg_register(), _pool_new(), acl_get_users(), configo(), configurate(), deliver(), deliver_config_filter(), deliver_init(), dialback(), dnsrv(), js_packet(), js_sc_session_new(), js_session_new(), js_user(), jsm(), jutil_priority(), main(), mio_init(), mio_ssl_init(), xmppd::proxy65::proxy65::proxy65(), pthsock_client(), register_instance(), xmppd::resolver::resend_service::resend_service(), srv_lookup(), xdb_file(), xdb_sql(), and xhash_from_xml().
| void xhash_put | ( | xht | h, |
| const char * | key, | ||
| void * | val | ||
| ) |
put an entry in the xhash
| h | the hash to insert the entry in |
| key | with which key the value should be entered |
| val | the value, that should be entered |
Referenced by _js_authreg_register(), _pool_new(), acl_get_users(), configurate(), deliver(), deliver_config_filter(), dialback(), dialback_ip_set(), dialback_miod_hash(), dialback_out_connection(), dnsrv_lookup(), dnsrv_process_xstream_io(), js_packet(), js_sc_session_new(), js_user(), jsm(), jutil_priority(), main(), mio_init(), mio_ssl_init(), xmppd::proxy65::proxy65::proxy65(), pthsock_client(), register_instance(), xmppd::resolver::resend_service::resend_service(), srv_xhash_join(), unregister_instance(), xdb_file(), xdb_file_load(), xdb_sql(), and xhash_from_xml().
| xmlnode xhash_to_xml | ( | xht | h | ) |
write the contents of an xhash to an xmlnode
| h | the xhash to be converted |
References xhash_walk(), and xmlnode_new_tag_ns().
| void xhash_walk | ( | xht | h, |
| xhash_walker | w, | ||
| void * | arg | ||
| ) |
iterate over a xhash strucutre
| h | the xhash to iterave over |
| w | which function should be called for each value |
| arg | what to pass to the optional argument of the xhash_walker function |
Referenced by _js_hosts_del(), _jsm_shutdown(), deliver(), deliver_routed_hosts(), dialback_beat_idle(), dialback_out_beat_packets(), dnsrv_beat_packets(), instance_shutdown(), js_users_gc(), jsm_serialize(), jsm_shutdown(), xdb_file_purge(), and xhash_to_xml().
| void xhash_zap | ( | xht | h, |
| const char * | key | ||
| ) |
remove an entry from the xhash
| h | the xhash where a value should be removed |
| key | the key of the value, that should be removed |
Referenced by _dialback_miod_hash_cleanup(), _dnsrv_beat_packets(), _js_users_del(), _xdb_file_purge(), dialback_in_dbic_cleanup(), dialback_out_connection_cleanup(), dnsrv_deliver(), dnsrv_process_xstream_io(), instance_shutdown(), js_session_end(), pool_free(), unregister_instance(), and xdb_file_phandler().
1.7.6.1