pidgin: d05a7130: Add two XMLNode accessors for iterating ...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Fri Aug 28 23:00:56 EDT 2009


-----------------------------------------------------------------
Revision: d05a71308f2d09a24eae2b38940b5ab221f70448
Ancestor: a8027dd0843d6009e71c1926a080aad4f2078acf
Author: darkrain42 at pidgin.im
Date: 2009-08-29T02:36:27
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/d05a71308f2d09a24eae2b38940b5ab221f70448

Modified files:
        ChangeLog.API libpurple/plugins/perl/common/XMLNode.xs

ChangeLog: 

Add two XMLNode accessors for iterating through the children of an XMLNode.

Closes #10130.

-------------- next part --------------
============================================================
--- ChangeLog.API	0c82eaa4e57494be81c426ce39b9e2c479b214cb
+++ ChangeLog.API	943a9176727a3081604a77de346e3fd8d00f20e2
@@ -1,5 +1,14 @@ Pidgin and Finch: The Pimpin' Penguin IM
 Pidgin and Finch: The Pimpin' Penguin IM Clients That're Good for the Soul
 
+version 2.6.2 (09/??/2009):
+	Perl:
+		Added:
+		* Purple::XMLNode::get_next(), which returns the next neighbor tag of
+		  the current node.
+		Changed:
+		* Purple::XMLNode::get_child() will return the first child node if
+		  passed "" or undef as the name of the node.
+
 version 2.6.1 (08/18/2009):
 	No changes
 
============================================================
--- libpurple/plugins/perl/common/XMLNode.xs	f10a6afcd4503fcf379f243066c66ce1395f61bc
+++ libpurple/plugins/perl/common/XMLNode.xs	4bb972c6b73f23655e413424324fb74569f2f2f2
@@ -32,6 +32,18 @@ xmlnode_get_child(parent, name)
 xmlnode_get_child(parent, name)
 	Purple::XMLNode parent
 	const char *name
+PREINIT:
+	xmlnode *tmp;
+CODE:
+	if (!name || *name == '\0') {
+		tmp = parent->child;
+		while (tmp && tmp->type != XMLNODE_TYPE_TAG)
+			tmp = tmp->next;
+		RETVAL = tmp;
+	} else
+		RETVAL = xmlnode_get_child(parent, name);
+OUTPUT:
+	RETVAL
 
 Purple::XMLNode
 xmlnode_get_child_with_namespace(parent, name, xmlns)
@@ -44,6 +56,19 @@ Purple::XMLNode
 	Purple::XMLNode node
 
 Purple::XMLNode
+xmlnode_get_next(node)
+	Purple::XMLNode node
+PREINIT:
+	xmlnode *tmp;
+CODE:
+	tmp = node->next;
+	while (tmp && tmp->type != XMLNODE_TYPE_TAG)
+		tmp = tmp->next;
+	RETVAL = tmp;
+OUTPUT:
+	RETVAL
+
+Purple::XMLNode
 xmlnode_get_next_twin(node)
 	Purple::XMLNode node
 


More information about the Commits mailing list