/soc/2013/ankitkv/gobjectification: df49377a0778: Added GBoxed w...

Ankit Vani a at nevitus.org
Tue Jul 16 10:39:05 EDT 2013


Changeset: df49377a077878c3af65b98a70fb389085a72807
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-07-16 20:08 +0530
Branch:	 soc.2013.gobjectification
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/df49377a0778

Description:

Added GBoxed wrapping to xmlnode

diffstat:

 libpurple/xmlnode.c |  14 ++++++++++++++
 libpurple/xmlnode.h |   7 +++++++
 2 files changed, 21 insertions(+), 0 deletions(-)

diffs (45 lines):

diff --git a/libpurple/xmlnode.c b/libpurple/xmlnode.c
--- a/libpurple/xmlnode.c
+++ b/libpurple/xmlnode.c
@@ -967,3 +967,17 @@ xmlnode_get_next_twin(xmlnode *node)
 
 	return NULL;
 }
+
+GType
+xmlnode_get_type(void)
+{
+	static GType type = 0;
+
+	if (type == 0) {
+		type = g_boxed_type_register_static("xmlnode",
+				(GBoxedCopyFunc)xmlnode_copy,
+				(GBoxedFreeFunc)xmlnode_free);
+	}
+
+	return type;
+}
diff --git a/libpurple/xmlnode.h b/libpurple/xmlnode.h
--- a/libpurple/xmlnode.h
+++ b/libpurple/xmlnode.h
@@ -28,6 +28,8 @@
 
 #include <glib.h>
 
+#define PURPLE_TYPE_XMLNODE  (xmlnode_get_type())
+
 /**
  * The valid types for an xmlnode
  */
@@ -60,6 +62,11 @@ struct _xmlnode
 G_BEGIN_DECLS
 
 /**
+ * Returns the GType for the xmlnode boxed structure.
+ */
+GType xmlnode_get_type(void);
+
+/**
  * Creates a new xmlnode.
  *
  * @param name The name of the node.



More information about the Commits mailing list