[evolution-data-server] Add e_cal_component_id_copy().



commit 0405aeb48483d9f83230d0f8263b9b955a6ed1de
Author: Matthew Barnes <mbarnes redhat com>
Date:   Thu Mar 14 14:53:50 2013 -0400

    Add e_cal_component_id_copy().

 calendar/libecal/e-cal-component.c                 |   25 ++++++++++++++++++++
 calendar/libecal/e-cal-component.h                 |    1 +
 .../calendar/libecal/libecal-sections.txt          |    1 +
 3 files changed, 27 insertions(+), 0 deletions(-)
---
diff --git a/calendar/libecal/e-cal-component.c b/calendar/libecal/e-cal-component.c
index 1243f80..f54ec45 100644
--- a/calendar/libecal/e-cal-component.c
+++ b/calendar/libecal/e-cal-component.c
@@ -5196,6 +5196,31 @@ e_cal_component_free_id (ECalComponentId *id)
 }
 
 /**
+ * e_cal_component_id_copy:
+ * @id: an #ECalComponentId
+ *
+ * Returns a newly-allocated copy of @id, which should be freed with
+ * e_cal_component_free_id().
+ *
+ * Returns: a newly-allocated copy of @id
+ *
+ * Since: 3.10
+ **/
+ECalComponentId *
+e_cal_component_id_copy (const ECalComponentId *id)
+{
+       ECalComponentId *copy;
+
+       g_return_val_if_fail (id != NULL, NULL);
+
+       copy = g_new0 (ECalComponentId, 1);
+       copy->uid = g_strdup (id->uid);
+       copy->rid = g_strdup (id->rid);
+
+       return copy;
+}
+
+/**
  * e_cal_component_free_text_list:
  * @text_list: (element-type ECalComponentText): List of #ECalComponentText
  * structures.
diff --git a/calendar/libecal/e-cal-component.h b/calendar/libecal/e-cal-component.h
index e004bf7..57df4d9 100644
--- a/calendar/libecal/e-cal-component.h
+++ b/calendar/libecal/e-cal-component.h
@@ -231,6 +231,7 @@ void e_cal_component_set_uid (ECalComponent *comp, const gchar *uid);
 
 ECalComponentId *e_cal_component_get_id (ECalComponent *comp);
 void e_cal_component_free_id (ECalComponentId *id);
+ECalComponentId *e_cal_component_id_copy (const ECalComponentId *id);
 
 void e_cal_component_get_categories (ECalComponent *comp, const gchar **categories);
 void e_cal_component_set_categories (ECalComponent *comp, const gchar *categories);
diff --git a/docs/reference/calendar/libecal/libecal-sections.txt 
b/docs/reference/calendar/libecal/libecal-sections.txt
index 63f9920..921a0ad 100644
--- a/docs/reference/calendar/libecal/libecal-sections.txt
+++ b/docs/reference/calendar/libecal/libecal-sections.txt
@@ -256,6 +256,7 @@ e_cal_component_get_uid
 e_cal_component_set_uid
 e_cal_component_get_id
 e_cal_component_free_id
+e_cal_component_id_copy
 e_cal_component_get_categories
 e_cal_component_set_categories
 e_cal_component_get_categories_list


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]