[Pidgin] #10130: Missing Perl method allowing recursive walk through all children of a XMLNode.

Pidgin trac at pidgin.im
Fri Aug 28 12:09:58 EDT 2009


#10130: Missing Perl method allowing recursive walk through all children of a
XMLNode.
-------------------+--------------------------------------------------------
 Reporter:  mcepl  |        Owner:         
     Type:  patch  |       Status:  new    
Milestone:  2.6.2  |    Component:  plugins
  Version:  2.6.1  |   Resolution:         
 Keywords:         |  
-------------------+--------------------------------------------------------
Changes (by darkrain42):

  * type:  defect => patch
  * milestone:  => 2.6.2


Comment:

 {{{
 #
 # old_revision [8e3f07ee41e0a06ef01e353e2162d8fcf3d6bb33]
 #
 # patch "libpurple/plugins/perl/common/XMLNode.xs"
 #  from [f10a6afcd4503fcf379f243066c66ce1395f61bc]
 #    to [4bb972c6b73f23655e413424324fb74569f2f2f2]
 #
 ============================================================
 --- 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

 }}}

-- 
Ticket URL: <http://developer.pidgin.im/ticket/10130#comment:1>
Pidgin <http://pidgin.im>
Pidgin


More information about the Tracker mailing list