changeset 28297:491af22d8a01

Fix the Perl XMLNode API so that calls don't need to explicitly pass the class when it doesn't make sense (and lengths are never passed). Fixes #9931 (more or less). committer: Paul Aurich <paul@darkrain42.org>
author Etan Reisner <pidgin@unreliablesource.net>
date Tue, 18 Aug 2009 06:23:44 +0000
parents 703b20fa6c5c
children ba57b7deb58a
files ChangeLog.API libpurple/plugins/perl/common/XMLNode.xs
diffstat 2 files changed, 19 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog.API	Tue Aug 18 04:34:30 2009 +0000
+++ b/ChangeLog.API	Tue Aug 18 06:23:44 2009 +0000
@@ -167,6 +167,12 @@
 			* Purple::Request::Field::list_new
 			* Purple::Request::Field::string_new
 			* Purple::Request::Field::group_new
+		* Make the XMLNode API more perl-like. Don't pass len
+		  parameters and call them like:
+			* $xmlnode->copy()
+			* $xmlnode->to_str()
+			* $xmlnode->to_formatted_str()
+			* Purple::XMLNode::from_str(...)
 
 version 2.5.8 (06/27/2009):
 	No changes
--- a/libpurple/plugins/perl/common/XMLNode.xs	Tue Aug 18 04:34:30 2009 +0000
+++ b/libpurple/plugins/perl/common/XMLNode.xs	Tue Aug 18 06:23:44 2009 +0000
@@ -4,21 +4,16 @@
 PROTOTYPES: ENABLE
 
 Purple::XMLNode
-xmlnode_copy(class, src)
+xmlnode_copy(src)
 	Purple::XMLNode src
-    C_ARGS:
-	src
 
 void
 xmlnode_free(node)
 	Purple::XMLNode node
 
 Purple::XMLNode
-xmlnode_from_str(class, str, size)
-	const char *str
-	gssize size
-    C_ARGS:
-	str, size
+xmlnode_from_str(const char *str, gssize length(str))
+    PROTOTYPE: $
 
 const char *
 xmlnode_get_attrib(node, attr)
@@ -78,11 +73,17 @@
 	const char *value
 
 gchar_own *
-xmlnode_to_formatted_str(node, len)
+xmlnode_to_formatted_str(node)
 	Purple::XMLNode node
-	int *len
+    CODE:
+	RETVAL = xmlnode_to_formatted_str(node, NULL);
+    OUTPUT:
+	RETVAL
 
 gchar_own *
-xmlnode_to_str(node, len)
+xmlnode_to_str(node)
 	Purple::XMLNode node
-	int *len
+    CODE:
+	RETVAL = xmlnode_to_str(node, NULL);
+    OUTPUT:
+	RETVAL