# HG changeset patch # User Paul Aurich # Date 1227380028 0 # Node ID 18fdbe507fddc1cc06c1f56ac12bf338f1964744 # Parent 1b64942c5fb2192ef8dbc9cfab2ac14a11bd2c82 Make capstable caps.c-only and add a jabber_caps_uninit() function diff -r 1b64942c5fb2 -r 18fdbe507fdd libpurple/protocols/jabber/caps.c --- a/libpurple/protocols/jabber/caps.c Sat Nov 22 18:30:01 2008 +0000 +++ b/libpurple/protocols/jabber/caps.c Sat Nov 22 18:53:48 2008 +0000 @@ -41,7 +41,7 @@ char *hash; } JabberCapsKey; -GHashTable *capstable = NULL; /* JabberCapsKey -> JabberCapsClientInfo */ +static GHashTable *capstable = NULL; /* JabberCapsKey -> JabberCapsClientInfo */ /** * Processes a query-node and returns a JabberCapsClientInfo object with all relevant info. @@ -136,11 +136,18 @@ static void jabber_caps_load(void); -void jabber_caps_init(void) { +void jabber_caps_init(void) +{ capstable = g_hash_table_new_full(jabber_caps_hash, jabber_caps_compare, jabber_caps_destroy_key, jabber_caps_client_info_destroy); jabber_caps_load(); } +void jabber_caps_uninit(void) +{ + g_hash_table_destroy(capstable); + capstable = NULL; +} + static void jabber_caps_load(void) { xmlnode *capsdata = purple_util_read_xml_from_file(JABBER_CAPS_FILENAME, "XMPP capabilities cache"); xmlnode *client; diff -r 1b64942c5fb2 -r 18fdbe507fdd libpurple/protocols/jabber/caps.h --- a/libpurple/protocols/jabber/caps.h Sat Nov 22 18:30:01 2008 +0000 +++ b/libpurple/protocols/jabber/caps.h Sat Nov 22 18:53:48 2008 +0000 @@ -26,8 +26,7 @@ #include "jabber.h" -/* Implementation of XEP-0115 */ -extern GHashTable *capstable; +/* Implementation of XEP-0115 - Entity Capabilities */ struct _JabberCapsClientInfo { GList *identities; /* JabberIdentity */ @@ -42,6 +41,7 @@ typedef void (*jabber_caps_get_info_cb)(JabberCapsClientInfo *info, gpointer user_data); void jabber_caps_init(void); +void jabber_caps_uninit(void); void jabber_caps_destroy_key(gpointer value);