cpw.darkrain42.xmpp.bosh: 991dad5d: Make capstable caps.c-only and add a jab...

paul at darkrain42.org paul at darkrain42.org
Sat Jan 17 23:56:41 EST 2009


-----------------------------------------------------------------
Revision: 991dad5d6581ce0fa49d9d000c4c892046d85cbc
Ancestor: cd1ae9de87cd7d5ca0f5e87a6d8b79bf561ebc5e
Author: paul at darkrain42.org
Date: 2008-11-22T18:53:48
Branch: im.pidgin.cpw.darkrain42.xmpp.bosh
URL: http://d.pidgin.im/viewmtn/revision/info/991dad5d6581ce0fa49d9d000c4c892046d85cbc

Modified files:
        libpurple/protocols/jabber/caps.c
        libpurple/protocols/jabber/caps.h

ChangeLog: 

Make capstable caps.c-only and add a jabber_caps_uninit() function

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/caps.c	1e97ca8fe8ffc636265d32300577ee1f274df6b7
+++ libpurple/protocols/jabber/caps.c	b6fa6f3e2d916abcde95bf0dbe73343231ee553e
@@ -41,7 +41,7 @@ typedef struct _JabberCapsKey {
 	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);
 
 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;
============================================================
--- libpurple/protocols/jabber/caps.h	0ea32ecb226e90fb55b5d207bb92d559285f637b
+++ libpurple/protocols/jabber/caps.h	3e4ab804c60f11e9e1d24d79762d92062d6c910e
@@ -26,8 +26,7 @@ typedef struct _JabberCapsClientInfo Jab
 
 #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 @@ void jabber_caps_init(void);
 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);
 


More information about the Commits mailing list