changeset 25762:18fdbe507fdd

Make capstable caps.c-only and add a jabber_caps_uninit() function
author Paul Aurich <paul@darkrain42.org>
date Sat, 22 Nov 2008 18:53:48 +0000
parents 1b64942c5fb2
children 860ebaf275ae
files libpurple/protocols/jabber/caps.c libpurple/protocols/jabber/caps.h
diffstat 2 files changed, 11 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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;
--- 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);