aboutsummaryrefslogtreecommitdiffstats
path: root/e-util
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-07-09 11:55:42 +0800
committerChris Lahey <clahey@src.gnome.org>2000-07-09 11:55:42 +0800
commite35ba583fa539cc4ececde8c190cabe42f292472 (patch)
treec8aa3980511082782df5e19057781a619c962736 /e-util
parent10b1fc590bf3204088215c2531a550197ee3db70 (diff)
downloadgsoc2013-evolution-e35ba583fa539cc4ececde8c190cabe42f292472.tar
gsoc2013-evolution-e35ba583fa539cc4ececde8c190cabe42f292472.tar.gz
gsoc2013-evolution-e35ba583fa539cc4ececde8c190cabe42f292472.tar.bz2
gsoc2013-evolution-e35ba583fa539cc4ececde8c190cabe42f292472.tar.lz
gsoc2013-evolution-e35ba583fa539cc4ececde8c190cabe42f292472.tar.xz
gsoc2013-evolution-e35ba583fa539cc4ececde8c190cabe42f292472.tar.zst
gsoc2013-evolution-e35ba583fa539cc4ececde8c190cabe42f292472.zip
Added e_list_duplicate.
2000-07-08 Christopher James Lahey <clahey@helixcode.com> * e-list.c, e-list.h: Added e_list_duplicate. svn path=/trunk/; revision=4002
Diffstat (limited to 'e-util')
-rw-r--r--e-util/ChangeLog4
-rw-r--r--e-util/e-list.c18
-rw-r--r--e-util/e-list.h1
3 files changed, 23 insertions, 0 deletions
diff --git a/e-util/ChangeLog b/e-util/ChangeLog
index 582155a13f..7a54bd6c17 100644
--- a/e-util/ChangeLog
+++ b/e-util/ChangeLog
@@ -1,3 +1,7 @@
+2000-07-08 Christopher James Lahey <clahey@helixcode.com>
+
+ * e-list.c, e-list.h: Added e_list_duplicate.
+
2000-07-07 Christopher James Lahey <clahey@helixcode.com>
* e-util.c, e-util.h: Added e_strsplit to work around a bug in
diff --git a/e-util/e-list.c b/e-util/e-list.c
index bc5769fb38..2a6f842888 100644
--- a/e-util/e-list.c
+++ b/e-util/e-list.c
@@ -87,6 +87,24 @@ e_list_new (EListCopyFunc copy, EListFreeFunc free, void *closure)
return list;
}
+EList *
+e_list_duplicate (EList *old)
+{
+ EList *list = gtk_type_new(e_list_get_type());
+
+ list->copy = old->copy;
+ list->free = old->free;
+ list->closure = old->closure;
+ list->list = g_list_copy(old->list);
+ if (list->copy) {
+ GList *listlist;
+ for (listlist = list->list; listlist; listlist = listlist->next) {
+ listlist->data = list->copy (listlist->data, list->closure);
+ }
+ }
+ return list;
+}
+
EIterator *
e_list_get_iterator (EList *list)
{
diff --git a/e-util/e-list.h b/e-util/e-list.h
index 545798fbf9..7a0170970f 100644
--- a/e-util/e-list.h
+++ b/e-util/e-list.h
@@ -43,6 +43,7 @@ struct _EListClass {
EList *e_list_new (EListCopyFunc copy,
EListFreeFunc free,
void *closure);
+EList *e_list_duplicate (EList *list);
EIterator *e_list_get_iterator (EList *list);
void e_list_append (EList *list,
const void *data);