/soc/2013/ankitkv/gobjectification: 5c3970547cda: Added purple_g...

Ankit Vani a at nevitus.org
Thu Jul 18 17:22:05 EDT 2013


Changeset: 5c3970547cdaa7e2851be059726fb59b754a0b8e
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-07-19 02:28 +0530
Branch:	 soc.2013.gobjectification
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/5c3970547cda

Description:

Added purple_g_value_dup() to util

diffstat:

 libpurple/util.c |  16 +++++++++++++++-
 libpurple/util.h |   9 +++++++++
 2 files changed, 24 insertions(+), 1 deletions(-)

diffs (45 lines):

diff --git a/libpurple/util.c b/libpurple/util.c
--- a/libpurple/util.c
+++ b/libpurple/util.c
@@ -4757,7 +4757,21 @@ purple_g_value_new(GType type)
 	ret = g_new0(GValue, 1);
 	g_value_init(ret, type);
 
-	return 0;
+	return ret;
+}
+
+GValue *
+purple_g_value_dup(GValue *value)
+{
+	GValue *ret;
+
+	g_return_val_if_fail(value != NULL, NULL);
+
+	ret = g_new0(GValue, 1);
+	g_value_init(ret, G_VALUE_TYPE(value));
+	g_value_copy(value, ret);
+
+	return ret;
 }
 
 void
diff --git a/libpurple/util.h b/libpurple/util.h
--- a/libpurple/util.h
+++ b/libpurple/util.h
@@ -1441,6 +1441,15 @@ gchar *purple_uuid_random(void);
 GValue *purple_g_value_new(GType type);
 
 /**
+ * Duplicates a GValue.
+ *
+ * @param value  The GValue to duplicate
+ *
+ * @return  The duplicated GValue
+ */
+GValue *purple_g_value_dup(GValue *value);
+
+/**
  * Frees a GValue.
  *
  * @param value  The GValue to free.



More information about the Commits mailing list