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
This commit is contained in:
Christopher James Lahey
2000-07-09 03:55:42 +00:00
committed by Chris Lahey
parent 10b1fc590b
commit e35ba583fa
3 changed files with 23 additions and 0 deletions

View File

@ -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

View File

@ -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)
{

View File

@ -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);