/soc/2013/ankitkv/gobjectification: 686fa55b0deb: Replaced xmlno...

Ankit Vani a at nevitus.org
Fri Sep 6 14:52:27 EDT 2013


Changeset: 686fa55b0deb285952bd122594f91069adecbbbb
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-09-07 00:10 +0530
Branch:	 soc.2013.gobjectification
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/686fa55b0deb

Description:

Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API

diffstat:

 libpurple/account.c                                |  160 +++---
 libpurple/account.h                                |    2 +-
 libpurple/accounts.c                               |  152 +++---
 libpurple/buddylist.c                              |  218 ++++----
 libpurple/plugins/log_reader.c                     |   58 +-
 libpurple/plugins/perl/common/XMLNode.xs           |   52 +-
 libpurple/plugins/perl/common/module.h             |    4 +-
 libpurple/plugins/signals-test.c                   |   20 +-
 libpurple/pounce.c                                 |   76 +-
 libpurple/prefs.c                                  |   54 +-
 libpurple/protocols/bonjour/bonjour_ft.c           |  200 ++++----
 libpurple/protocols/bonjour/bonjour_ft.h           |    6 +-
 libpurple/protocols/bonjour/jabber.c               |  108 ++--
 libpurple/protocols/bonjour/jabber.h               |    6 +-
 libpurple/protocols/bonjour/parser.c               |   18 +-
 libpurple/protocols/gg/gg.c                        |   32 +-
 libpurple/protocols/gg/oauth/oauth-purple.c        |   12 +-
 libpurple/protocols/gg/pubdir-prpl.c               |   12 +-
 libpurple/protocols/gg/roster.c                    |   66 +-
 libpurple/protocols/gg/xml.c                       |   40 +-
 libpurple/protocols/gg/xml.h                       |   16 +-
 libpurple/protocols/jabber/adhoccommands.c         |  104 ++--
 libpurple/protocols/jabber/adhoccommands.h         |    4 +-
 libpurple/protocols/jabber/auth.c                  |  110 ++--
 libpurple/protocols/jabber/auth.h                  |   16 +-
 libpurple/protocols/jabber/auth_cyrus.c            |   54 +-
 libpurple/protocols/jabber/auth_digest_md5.c       |   26 +-
 libpurple/protocols/jabber/auth_plain.c            |   22 +-
 libpurple/protocols/jabber/auth_scram.c            |   40 +-
 libpurple/protocols/jabber/bosh.c                  |   38 +-
 libpurple/protocols/jabber/buddy.c                 |  342 +++++++-------
 libpurple/protocols/jabber/caps.c                  |  160 +++---
 libpurple/protocols/jabber/caps.h                  |    4 +-
 libpurple/protocols/jabber/chat.c                  |  264 +++++-----
 libpurple/protocols/jabber/data.c                  |   70 +-
 libpurple/protocols/jabber/data.h                  |    8 +-
 libpurple/protocols/jabber/disco.c                 |  158 +++---
 libpurple/protocols/jabber/disco.h                 |    4 +-
 libpurple/protocols/jabber/google/gmail.c          |   74 +-
 libpurple/protocols/jabber/google/gmail.h          |    2 +-
 libpurple/protocols/jabber/google/google_p2p.c     |   58 +-
 libpurple/protocols/jabber/google/google_p2p.h     |    4 +-
 libpurple/protocols/jabber/google/google_roster.c  |   66 +-
 libpurple/protocols/jabber/google/google_roster.h  |    4 +-
 libpurple/protocols/jabber/google/google_session.c |  196 ++++----
 libpurple/protocols/jabber/google/google_session.h |    4 +-
 libpurple/protocols/jabber/google/jingleinfo.c     |   28 +-
 libpurple/protocols/jabber/google/jingleinfo.h     |    2 +-
 libpurple/protocols/jabber/ibb.c                   |   78 +-
 libpurple/protocols/jabber/ibb.h                   |    6 +-
 libpurple/protocols/jabber/iq.c                    |  124 ++--
 libpurple/protocols/jabber/iq.h                    |    8 +-
 libpurple/protocols/jabber/jabber.c                |  392 ++++++++--------
 libpurple/protocols/jabber/jabber.h                |   16 +-
 libpurple/protocols/jabber/jingle/content.c        |   48 +-
 libpurple/protocols/jabber/jingle/content.h        |   12 +-
 libpurple/protocols/jabber/jingle/iceudp.c         |   76 +-
 libpurple/protocols/jabber/jingle/iceudp.h         |    4 +-
 libpurple/protocols/jabber/jingle/jingle.c         |  132 ++--
 libpurple/protocols/jabber/jingle/jingle.h         |    2 +-
 libpurple/protocols/jabber/jingle/rawudp.c         |   40 +-
 libpurple/protocols/jabber/jingle/rawudp.h         |    4 +-
 libpurple/protocols/jabber/jingle/rtp.c            |   86 +-
 libpurple/protocols/jabber/jingle/session.c        |   60 +-
 libpurple/protocols/jabber/jingle/session.h        |    6 +-
 libpurple/protocols/jabber/jingle/transport.c      |   24 +-
 libpurple/protocols/jabber/jingle/transport.h      |    8 +-
 libpurple/protocols/jabber/message.c               |  166 +++---
 libpurple/protocols/jabber/message.h               |    2 +-
 libpurple/protocols/jabber/oob.c                   |   30 +-
 libpurple/protocols/jabber/oob.h                   |    2 +-
 libpurple/protocols/jabber/parser.c                |   18 +-
 libpurple/protocols/jabber/pep.c                   |   56 +-
 libpurple/protocols/jabber/pep.h                   |    4 +-
 libpurple/protocols/jabber/ping.c                  |   24 +-
 libpurple/protocols/jabber/ping.h                  |    2 +-
 libpurple/protocols/jabber/presence.c              |  202 ++++----
 libpurple/protocols/jabber/presence.h              |   10 +-
 libpurple/protocols/jabber/roster.c                |   60 +-
 libpurple/protocols/jabber/roster.h                |    2 +-
 libpurple/protocols/jabber/si.c                    |  258 +++++-----
 libpurple/protocols/jabber/si.h                    |    4 +-
 libpurple/protocols/jabber/useravatar.c            |  120 ++--
 libpurple/protocols/jabber/usermood.c              |   28 +-
 libpurple/protocols/jabber/usernick.c              |   32 +-
 libpurple/protocols/jabber/usertune.c              |   44 +-
 libpurple/protocols/jabber/xdata.c                 |  132 ++--
 libpurple/protocols/jabber/xdata.h                 |   12 +-
 libpurple/protocols/msn/contact.c                  |  480 ++++++++++----------
 libpurple/protocols/msn/contact.h                  |    4 +-
 libpurple/protocols/msn/nexus.c                    |   58 +-
 libpurple/protocols/msn/notification.c             |  294 ++++++------
 libpurple/protocols/msn/oim.c                      |  116 ++--
 libpurple/protocols/msn/soap.c                     |   36 +-
 libpurple/protocols/msn/soap.h                     |    4 +-
 libpurple/protocols/msn/state.c                    |   46 +-
 libpurple/protocols/msn/state.h                    |    4 +-
 libpurple/protocols/myspace/markup.c               |   72 +-
 libpurple/protocols/oscar/clientlogin.c            |   98 ++--
 libpurple/protocols/oscar/oscar.c                  |   16 +-
 libpurple/protocols/simple/simple.c                |   50 +-
 libpurple/protocols/yahoo/libymsg.c                |   52 +-
 libpurple/protocols/yahoo/util.c                   |   52 +-
 libpurple/protocols/yahoo/yahoo_aliases.c          |   92 ++--
 libpurple/savedstatuses.c                          |  116 ++--
 libpurple/smiley.c                                 |   64 +-
 libpurple/sound-theme-loader.c                     |   28 +-
 libpurple/tests/check_libpurple.c                  |    2 +-
 libpurple/tests/test_jabber_caps.c                 |   14 +-
 libpurple/tests/test_xmlnode.c                     |   62 +-
 libpurple/tests/tests.h                            |    2 +-
 libpurple/upnp.c                                   |   66 +-
 libpurple/util.c                                   |    4 +-
 libpurple/util.h                                   |    8 +-
 libpurple/xmlnode.c                                |  300 ++++++------
 libpurple/xmlnode.h                                |  102 ++--
 pidgin/gtkblist-theme-loader.c                     |   58 +-
 pidgin/gtkconv-theme-loader.c                      |   24 +-
 pidgin/gtkicon-theme-loader.c                      |   26 +-
 pidgin/plugins/disco/xmppdisco.c                   |  140 +++---
 pidgin/plugins/xmppconsole.c                       |   40 +-
 121 files changed, 4019 insertions(+), 4019 deletions(-)

diffs (truncated from 20674 to 300 lines):

diff --git a/libpurple/account.c b/libpurple/account.c
--- a/libpurple/account.c
+++ b/libpurple/account.c
@@ -2425,11 +2425,11 @@ purple_account_clear_current_error(Purpl
 	_purple_account_set_current_error(account, NULL);
 }
 
-static xmlnode *
+static PurpleXmlNode *
 status_attribute_to_xmlnode(const PurpleStatus *status, const PurpleStatusType *type,
 		const PurpleStatusAttribute *attr)
 {
-	xmlnode *node;
+	PurpleXmlNode *node;
 	const char *id;
 	char *value = NULL;
 	PurpleStatusAttribute *default_attr;
@@ -2487,61 +2487,61 @@ status_attribute_to_xmlnode(const Purple
 
 	g_return_val_if_fail(value, NULL);
 
-	node = xmlnode_new("attribute");
-
-	xmlnode_set_attrib(node, "id", id);
-	xmlnode_set_attrib(node, "value", value);
+	node = purple_xmlnode_new("attribute");
+
+	purple_xmlnode_set_attrib(node, "id", id);
+	purple_xmlnode_set_attrib(node, "value", value);
 
 	g_free(value);
 
 	return node;
 }
 
-static xmlnode *
+static PurpleXmlNode *
 status_attrs_to_xmlnode(const PurpleStatus *status)
 {
 	PurpleStatusType *type = purple_status_get_status_type(status);
-	xmlnode *node, *child;
+	PurpleXmlNode *node, *child;
 	GList *attrs, *attr;
 
-	node = xmlnode_new("attributes");
+	node = purple_xmlnode_new("attributes");
 
 	attrs = purple_status_type_get_attrs(type);
 	for (attr = attrs; attr != NULL; attr = attr->next)
 	{
 		child = status_attribute_to_xmlnode(status, type, (const PurpleStatusAttribute *)attr->data);
 		if (child)
-			xmlnode_insert_child(node, child);
+			purple_xmlnode_insert_child(node, child);
 	}
 
 	return node;
 }
 
-static xmlnode *
+static PurpleXmlNode *
 status_to_xmlnode(const PurpleStatus *status)
 {
-	xmlnode *node, *child;
-
-	node = xmlnode_new("status");
-	xmlnode_set_attrib(node, "type", purple_status_get_id(status));
+	PurpleXmlNode *node, *child;
+
+	node = purple_xmlnode_new("status");
+	purple_xmlnode_set_attrib(node, "type", purple_status_get_id(status));
 	if (purple_status_get_name(status) != NULL)
-		xmlnode_set_attrib(node, "name", purple_status_get_name(status));
-	xmlnode_set_attrib(node, "active", purple_status_is_active(status) ? "true" : "false");
+		purple_xmlnode_set_attrib(node, "name", purple_status_get_name(status));
+	purple_xmlnode_set_attrib(node, "active", purple_status_is_active(status) ? "true" : "false");
 
 	child = status_attrs_to_xmlnode(status);
-	xmlnode_insert_child(node, child);
+	purple_xmlnode_insert_child(node, child);
 
 	return node;
 }
 
-static xmlnode *
+static PurpleXmlNode *
 statuses_to_xmlnode(const PurplePresence *presence)
 {
-	xmlnode *node, *child;
+	PurpleXmlNode *node, *child;
 	GList *statuses;
 	PurpleStatus *status;
 
-	node = xmlnode_new("statuses");
+	node = purple_xmlnode_new("statuses");
 
 	statuses = purple_presence_get_statuses(presence);
 	for (; statuses != NULL; statuses = statuses->next)
@@ -2550,17 +2550,17 @@ statuses_to_xmlnode(const PurplePresence
 		if (purple_status_type_is_saveable(purple_status_get_status_type(status)))
 		{
 			child = status_to_xmlnode(status);
-			xmlnode_insert_child(node, child);
+			purple_xmlnode_insert_child(node, child);
 		}
 	}
 
 	return node;
 }
 
-static xmlnode *
+static PurpleXmlNode *
 proxy_settings_to_xmlnode(PurpleProxyInfo *proxy_info)
 {
-	xmlnode *node, *child;
+	PurpleXmlNode *node, *child;
 	PurpleProxyType proxy_type;
 	const char *value;
 	int int_value;
@@ -2568,10 +2568,10 @@ proxy_settings_to_xmlnode(PurpleProxyInf
 
 	proxy_type = purple_proxy_info_get_type(proxy_info);
 
-	node = xmlnode_new("proxy");
-
-	child = xmlnode_new_child(node, "type");
-	xmlnode_insert_data(child,
+	node = purple_xmlnode_new("proxy");
+
+	child = purple_xmlnode_new_child(node, "type");
+	purple_xmlnode_insert_data(child,
 			(proxy_type == PURPLE_PROXY_USE_GLOBAL ? "global" :
 			 proxy_type == PURPLE_PROXY_NONE       ? "none"   :
 			 proxy_type == PURPLE_PROXY_HTTP       ? "http"   :
@@ -2582,39 +2582,39 @@ proxy_settings_to_xmlnode(PurpleProxyInf
 
 	if ((value = purple_proxy_info_get_host(proxy_info)) != NULL)
 	{
-		child = xmlnode_new_child(node, "host");
-		xmlnode_insert_data(child, value, -1);
+		child = purple_xmlnode_new_child(node, "host");
+		purple_xmlnode_insert_data(child, value, -1);
 	}
 
 	if ((int_value = purple_proxy_info_get_port(proxy_info)) != 0)
 	{
 		g_snprintf(buf, sizeof(buf), "%d", int_value);
-		child = xmlnode_new_child(node, "port");
-		xmlnode_insert_data(child, buf, -1);
+		child = purple_xmlnode_new_child(node, "port");
+		purple_xmlnode_insert_data(child, buf, -1);
 	}
 
 	if ((value = purple_proxy_info_get_username(proxy_info)) != NULL)
 	{
-		child = xmlnode_new_child(node, "username");
-		xmlnode_insert_data(child, value, -1);
+		child = purple_xmlnode_new_child(node, "username");
+		purple_xmlnode_insert_data(child, value, -1);
 	}
 
 	if ((value = purple_proxy_info_get_password(proxy_info)) != NULL)
 	{
-		child = xmlnode_new_child(node, "password");
-		xmlnode_insert_data(child, value, -1);
+		child = purple_xmlnode_new_child(node, "password");
+		purple_xmlnode_insert_data(child, value, -1);
 	}
 
 	return node;
 }
 
-static xmlnode *
+static PurpleXmlNode *
 current_error_to_xmlnode(PurpleConnectionErrorInfo *err)
 {
-	xmlnode *node, *child;
+	PurpleXmlNode *node, *child;
 	char type_str[3];
 
-	node = xmlnode_new("current_error");
+	node = purple_xmlnode_new("current_error");
 
 	if(err == NULL)
 		return node;
@@ -2625,16 +2625,16 @@ current_error_to_xmlnode(PurpleConnectio
 	if(!purple_connection_error_is_fatal (err->type))
 		return node;
 
-	child = xmlnode_new_child(node, "type");
+	child = purple_xmlnode_new_child(node, "type");
 	g_snprintf(type_str, sizeof(type_str), "%u", err->type);
-	xmlnode_insert_data(child, type_str, -1);
-
-	child = xmlnode_new_child(node, "description");
+	purple_xmlnode_insert_data(child, type_str, -1);
+
+	child = purple_xmlnode_new_child(node, "description");
 	if(err->description) {
 		char *utf8ized = purple_utf8_try_convert(err->description);
 		if(utf8ized == NULL)
 			utf8ized = purple_utf8_salvage(err->description);
-		xmlnode_insert_data(child, utf8ized, -1);
+		purple_xmlnode_insert_data(child, utf8ized, -1);
 		g_free(utf8ized);
 	}
 
@@ -2646,29 +2646,29 @@ setting_to_xmlnode(gpointer key, gpointe
 {
 	const char *name;
 	PurpleAccountSetting *setting;
-	xmlnode *node, *child;
+	PurpleXmlNode *node, *child;
 	char buf[21];
 
 	name    = (const char *)key;
 	setting = (PurpleAccountSetting *)value;
-	node    = (xmlnode *)user_data;
-
-	child = xmlnode_new_child(node, "setting");
-	xmlnode_set_attrib(child, "name", name);
+	node    = (PurpleXmlNode *)user_data;
+
+	child = purple_xmlnode_new_child(node, "setting");
+	purple_xmlnode_set_attrib(child, "name", name);
 
 	if (G_VALUE_HOLDS_INT(&setting->value)) {
-		xmlnode_set_attrib(child, "type", "int");
+		purple_xmlnode_set_attrib(child, "type", "int");
 		g_snprintf(buf, sizeof(buf), "%d", g_value_get_int(&setting->value));
-		xmlnode_insert_data(child, buf, -1);
+		purple_xmlnode_insert_data(child, buf, -1);
 	}
 	else if (G_VALUE_HOLDS_STRING(&setting->value) && g_value_get_string(&setting->value) != NULL) {
-		xmlnode_set_attrib(child, "type", "string");
-		xmlnode_insert_data(child, g_value_get_string(&setting->value), -1);
+		purple_xmlnode_set_attrib(child, "type", "string");
+		purple_xmlnode_insert_data(child, g_value_get_string(&setting->value), -1);
 	}
 	else if (G_VALUE_HOLDS_BOOLEAN(&setting->value)) {
-		xmlnode_set_attrib(child, "type", "bool");
+		purple_xmlnode_set_attrib(child, "type", "bool");
 		g_snprintf(buf, sizeof(buf), "%d", g_value_get_boolean(&setting->value));
-		xmlnode_insert_data(child, buf, -1);
+		purple_xmlnode_insert_data(child, buf, -1);
 	}
 }
 
@@ -2677,36 +2677,36 @@ ui_setting_to_xmlnode(gpointer key, gpoi
 {
 	const char *ui;
 	GHashTable *table;
-	xmlnode *node, *child;
+	PurpleXmlNode *node, *child;
 
 	ui    = (const char *)key;
 	table = (GHashTable *)value;
-	node  = (xmlnode *)user_data;
+	node  = (PurpleXmlNode *)user_data;
 
 	if (g_hash_table_size(table) > 0)
 	{
-		child = xmlnode_new_child(node, "settings");
-		xmlnode_set_attrib(child, "ui", ui);
+		child = purple_xmlnode_new_child(node, "settings");
+		purple_xmlnode_set_attrib(child, "ui", ui);
 		g_hash_table_foreach(table, setting_to_xmlnode, child);
 	}
 }
 
-xmlnode *
+PurpleXmlNode *
 purple_account_to_xmlnode(PurpleAccount *account)
 {
-	xmlnode *node, *child;
+	PurpleXmlNode *node, *child;
 	const char *tmp;
 	PurplePresence *presence;
 	PurpleProxyInfo *proxy_info;
 	PurpleAccountPrivate *priv = PURPLE_ACCOUNT_GET_PRIVATE(account);
 
-	node = xmlnode_new("account");
-
-	child = xmlnode_new_child(node, "protocol");
-	xmlnode_insert_data(child, purple_account_get_protocol_id(account), -1);
-
-	child = xmlnode_new_child(node, "name");
-	xmlnode_insert_data(child, purple_account_get_username(account), -1);
+	node = purple_xmlnode_new("account");
+
+	child = purple_xmlnode_new_child(node, "protocol");
+	purple_xmlnode_insert_data(child, purple_account_get_protocol_id(account), -1);
+
+	child = purple_xmlnode_new_child(node, "name");
+	purple_xmlnode_insert_data(child, purple_account_get_username(account), -1);
 
 	if (purple_account_get_remember_password(account))
 	{
@@ -2724,13 +2724,13 @@ purple_account_to_xmlnode(PurpleAccount 
 				purple_account_get_username(account),



More information about the Commits mailing list