# HG changeset patch # User Paul Aurich # Date 1251513387 0 # Node ID 1662dbdac18c49eb7043bf94a6707e59a75563b9 # Parent caa94dfa37f143f8289900b9204c44ea549a6655 Add two XMLNode accessors for iterating through the children of an XMLNode. Closes #10130. diff -r caa94dfa37f1 -r 1662dbdac18c ChangeLog.API --- a/ChangeLog.API Sat Aug 29 02:32:16 2009 +0000 +++ b/ChangeLog.API Sat Aug 29 02:36:27 2009 +0000 @@ -1,5 +1,14 @@ 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 diff -r caa94dfa37f1 -r 1662dbdac18c libpurple/plugins/perl/common/XMLNode.xs --- a/libpurple/plugins/perl/common/XMLNode.xs Sat Aug 29 02:32:16 2009 +0000 +++ b/libpurple/plugins/perl/common/XMLNode.xs Sat Aug 29 02:36:27 2009 +0000 @@ -32,6 +32,18 @@ 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 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