From e35ba583fa539cc4ececde8c190cabe42f292472 Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Sun, 9 Jul 2000 03:55:42 +0000 Subject: Added e_list_duplicate. 2000-07-08 Christopher James Lahey * e-list.c, e-list.h: Added e_list_duplicate. svn path=/trunk/; revision=4002 --- e-util/e-list.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'e-util/e-list.c') 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) { -- cgit v1.2.3