mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-26 15:36:14 +01:00
new function g_slist_copy() to duplicate a list with all its data
Sun Nov 22 17:07:03 1998 Tim Janik <timj@gtk.org> * glib.h: * gslist.c: new function g_slist_copy() to duplicate a list with all its data pointers. * glist.c: new function g_list_copy.
This commit is contained in:
parent
3556db2054
commit
70a6dbff87
@ -1,3 +1,10 @@
|
|||||||
|
Sun Nov 22 17:07:03 1998 Tim Janik <timj@gtk.org>
|
||||||
|
|
||||||
|
* glib.h:
|
||||||
|
* gslist.c: new function g_slist_copy() to duplicate a list with all its
|
||||||
|
data pointers.
|
||||||
|
* glist.c: new function g_list_copy.
|
||||||
|
|
||||||
Sat Nov 21 14:57:39 CST 1998 Shawn T. Amundson <amundson@gtk.org>
|
Sat Nov 21 14:57:39 CST 1998 Shawn T. Amundson <amundson@gtk.org>
|
||||||
|
|
||||||
* INSTALL:
|
* INSTALL:
|
||||||
@ -9,6 +16,7 @@ Sat Nov 21 14:57:39 CST 1998 Shawn T. Amundson <amundson@gtk.org>
|
|||||||
* Released GLib 1.1.5
|
* Released GLib 1.1.5
|
||||||
|
|
||||||
Wed Nov 18 1998 Elliot Lee <sopwith@redhat.com>
|
Wed Nov 18 1998 Elliot Lee <sopwith@redhat.com>
|
||||||
|
|
||||||
* gdataset.c: There was a code path into g_data_set_internal
|
* gdataset.c: There was a code path into g_data_set_internal
|
||||||
through a function (g_datalist_id_set_full). Neither function
|
through a function (g_datalist_id_set_full). Neither function
|
||||||
checked for g_dataset_init having been run, but
|
checked for g_dataset_init having been run, but
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
Sun Nov 22 17:07:03 1998 Tim Janik <timj@gtk.org>
|
||||||
|
|
||||||
|
* glib.h:
|
||||||
|
* gslist.c: new function g_slist_copy() to duplicate a list with all its
|
||||||
|
data pointers.
|
||||||
|
* glist.c: new function g_list_copy.
|
||||||
|
|
||||||
Sat Nov 21 14:57:39 CST 1998 Shawn T. Amundson <amundson@gtk.org>
|
Sat Nov 21 14:57:39 CST 1998 Shawn T. Amundson <amundson@gtk.org>
|
||||||
|
|
||||||
* INSTALL:
|
* INSTALL:
|
||||||
@ -9,6 +16,7 @@ Sat Nov 21 14:57:39 CST 1998 Shawn T. Amundson <amundson@gtk.org>
|
|||||||
* Released GLib 1.1.5
|
* Released GLib 1.1.5
|
||||||
|
|
||||||
Wed Nov 18 1998 Elliot Lee <sopwith@redhat.com>
|
Wed Nov 18 1998 Elliot Lee <sopwith@redhat.com>
|
||||||
|
|
||||||
* gdataset.c: There was a code path into g_data_set_internal
|
* gdataset.c: There was a code path into g_data_set_internal
|
||||||
through a function (g_datalist_id_set_full). Neither function
|
through a function (g_datalist_id_set_full). Neither function
|
||||||
checked for g_dataset_init having been run, but
|
checked for g_dataset_init having been run, but
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
Sun Nov 22 17:07:03 1998 Tim Janik <timj@gtk.org>
|
||||||
|
|
||||||
|
* glib.h:
|
||||||
|
* gslist.c: new function g_slist_copy() to duplicate a list with all its
|
||||||
|
data pointers.
|
||||||
|
* glist.c: new function g_list_copy.
|
||||||
|
|
||||||
Sat Nov 21 14:57:39 CST 1998 Shawn T. Amundson <amundson@gtk.org>
|
Sat Nov 21 14:57:39 CST 1998 Shawn T. Amundson <amundson@gtk.org>
|
||||||
|
|
||||||
* INSTALL:
|
* INSTALL:
|
||||||
@ -9,6 +16,7 @@ Sat Nov 21 14:57:39 CST 1998 Shawn T. Amundson <amundson@gtk.org>
|
|||||||
* Released GLib 1.1.5
|
* Released GLib 1.1.5
|
||||||
|
|
||||||
Wed Nov 18 1998 Elliot Lee <sopwith@redhat.com>
|
Wed Nov 18 1998 Elliot Lee <sopwith@redhat.com>
|
||||||
|
|
||||||
* gdataset.c: There was a code path into g_data_set_internal
|
* gdataset.c: There was a code path into g_data_set_internal
|
||||||
through a function (g_datalist_id_set_full). Neither function
|
through a function (g_datalist_id_set_full). Neither function
|
||||||
checked for g_dataset_init having been run, but
|
checked for g_dataset_init having been run, but
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
Sun Nov 22 17:07:03 1998 Tim Janik <timj@gtk.org>
|
||||||
|
|
||||||
|
* glib.h:
|
||||||
|
* gslist.c: new function g_slist_copy() to duplicate a list with all its
|
||||||
|
data pointers.
|
||||||
|
* glist.c: new function g_list_copy.
|
||||||
|
|
||||||
Sat Nov 21 14:57:39 CST 1998 Shawn T. Amundson <amundson@gtk.org>
|
Sat Nov 21 14:57:39 CST 1998 Shawn T. Amundson <amundson@gtk.org>
|
||||||
|
|
||||||
* INSTALL:
|
* INSTALL:
|
||||||
@ -9,6 +16,7 @@ Sat Nov 21 14:57:39 CST 1998 Shawn T. Amundson <amundson@gtk.org>
|
|||||||
* Released GLib 1.1.5
|
* Released GLib 1.1.5
|
||||||
|
|
||||||
Wed Nov 18 1998 Elliot Lee <sopwith@redhat.com>
|
Wed Nov 18 1998 Elliot Lee <sopwith@redhat.com>
|
||||||
|
|
||||||
* gdataset.c: There was a code path into g_data_set_internal
|
* gdataset.c: There was a code path into g_data_set_internal
|
||||||
through a function (g_datalist_id_set_full). Neither function
|
through a function (g_datalist_id_set_full). Neither function
|
||||||
checked for g_dataset_init having been run, but
|
checked for g_dataset_init having been run, but
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
Sun Nov 22 17:07:03 1998 Tim Janik <timj@gtk.org>
|
||||||
|
|
||||||
|
* glib.h:
|
||||||
|
* gslist.c: new function g_slist_copy() to duplicate a list with all its
|
||||||
|
data pointers.
|
||||||
|
* glist.c: new function g_list_copy.
|
||||||
|
|
||||||
Sat Nov 21 14:57:39 CST 1998 Shawn T. Amundson <amundson@gtk.org>
|
Sat Nov 21 14:57:39 CST 1998 Shawn T. Amundson <amundson@gtk.org>
|
||||||
|
|
||||||
* INSTALL:
|
* INSTALL:
|
||||||
@ -9,6 +16,7 @@ Sat Nov 21 14:57:39 CST 1998 Shawn T. Amundson <amundson@gtk.org>
|
|||||||
* Released GLib 1.1.5
|
* Released GLib 1.1.5
|
||||||
|
|
||||||
Wed Nov 18 1998 Elliot Lee <sopwith@redhat.com>
|
Wed Nov 18 1998 Elliot Lee <sopwith@redhat.com>
|
||||||
|
|
||||||
* gdataset.c: There was a code path into g_data_set_internal
|
* gdataset.c: There was a code path into g_data_set_internal
|
||||||
through a function (g_datalist_id_set_full). Neither function
|
through a function (g_datalist_id_set_full). Neither function
|
||||||
checked for g_dataset_init having been run, but
|
checked for g_dataset_init having been run, but
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
Sun Nov 22 17:07:03 1998 Tim Janik <timj@gtk.org>
|
||||||
|
|
||||||
|
* glib.h:
|
||||||
|
* gslist.c: new function g_slist_copy() to duplicate a list with all its
|
||||||
|
data pointers.
|
||||||
|
* glist.c: new function g_list_copy.
|
||||||
|
|
||||||
Sat Nov 21 14:57:39 CST 1998 Shawn T. Amundson <amundson@gtk.org>
|
Sat Nov 21 14:57:39 CST 1998 Shawn T. Amundson <amundson@gtk.org>
|
||||||
|
|
||||||
* INSTALL:
|
* INSTALL:
|
||||||
@ -9,6 +16,7 @@ Sat Nov 21 14:57:39 CST 1998 Shawn T. Amundson <amundson@gtk.org>
|
|||||||
* Released GLib 1.1.5
|
* Released GLib 1.1.5
|
||||||
|
|
||||||
Wed Nov 18 1998 Elliot Lee <sopwith@redhat.com>
|
Wed Nov 18 1998 Elliot Lee <sopwith@redhat.com>
|
||||||
|
|
||||||
* gdataset.c: There was a code path into g_data_set_internal
|
* gdataset.c: There was a code path into g_data_set_internal
|
||||||
through a function (g_datalist_id_set_full). Neither function
|
through a function (g_datalist_id_set_full). Neither function
|
||||||
checked for g_dataset_init having been run, but
|
checked for g_dataset_init having been run, but
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
Sun Nov 22 17:07:03 1998 Tim Janik <timj@gtk.org>
|
||||||
|
|
||||||
|
* glib.h:
|
||||||
|
* gslist.c: new function g_slist_copy() to duplicate a list with all its
|
||||||
|
data pointers.
|
||||||
|
* glist.c: new function g_list_copy.
|
||||||
|
|
||||||
Sat Nov 21 14:57:39 CST 1998 Shawn T. Amundson <amundson@gtk.org>
|
Sat Nov 21 14:57:39 CST 1998 Shawn T. Amundson <amundson@gtk.org>
|
||||||
|
|
||||||
* INSTALL:
|
* INSTALL:
|
||||||
@ -9,6 +16,7 @@ Sat Nov 21 14:57:39 CST 1998 Shawn T. Amundson <amundson@gtk.org>
|
|||||||
* Released GLib 1.1.5
|
* Released GLib 1.1.5
|
||||||
|
|
||||||
Wed Nov 18 1998 Elliot Lee <sopwith@redhat.com>
|
Wed Nov 18 1998 Elliot Lee <sopwith@redhat.com>
|
||||||
|
|
||||||
* gdataset.c: There was a code path into g_data_set_internal
|
* gdataset.c: There was a code path into g_data_set_internal
|
||||||
through a function (g_datalist_id_set_full). Neither function
|
through a function (g_datalist_id_set_full). Neither function
|
||||||
checked for g_dataset_init having been run, but
|
checked for g_dataset_init having been run, but
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
Sun Nov 22 17:07:03 1998 Tim Janik <timj@gtk.org>
|
||||||
|
|
||||||
|
* glib.h:
|
||||||
|
* gslist.c: new function g_slist_copy() to duplicate a list with all its
|
||||||
|
data pointers.
|
||||||
|
* glist.c: new function g_list_copy.
|
||||||
|
|
||||||
Sat Nov 21 14:57:39 CST 1998 Shawn T. Amundson <amundson@gtk.org>
|
Sat Nov 21 14:57:39 CST 1998 Shawn T. Amundson <amundson@gtk.org>
|
||||||
|
|
||||||
* INSTALL:
|
* INSTALL:
|
||||||
@ -9,6 +16,7 @@ Sat Nov 21 14:57:39 CST 1998 Shawn T. Amundson <amundson@gtk.org>
|
|||||||
* Released GLib 1.1.5
|
* Released GLib 1.1.5
|
||||||
|
|
||||||
Wed Nov 18 1998 Elliot Lee <sopwith@redhat.com>
|
Wed Nov 18 1998 Elliot Lee <sopwith@redhat.com>
|
||||||
|
|
||||||
* gdataset.c: There was a code path into g_data_set_internal
|
* gdataset.c: There was a code path into g_data_set_internal
|
||||||
through a function (g_datalist_id_set_full). Neither function
|
through a function (g_datalist_id_set_full). Neither function
|
||||||
checked for g_dataset_init having been run, but
|
checked for g_dataset_init having been run, but
|
||||||
|
2
glib.h
2
glib.h
@ -885,6 +885,7 @@ GList* g_list_remove (GList *list,
|
|||||||
GList* g_list_remove_link (GList *list,
|
GList* g_list_remove_link (GList *list,
|
||||||
GList *llink);
|
GList *llink);
|
||||||
GList* g_list_reverse (GList *list);
|
GList* g_list_reverse (GList *list);
|
||||||
|
GList* g_list_copy (GList *list);
|
||||||
GList* g_list_nth (GList *list,
|
GList* g_list_nth (GList *list,
|
||||||
guint n);
|
guint n);
|
||||||
GList* g_list_find (GList *list,
|
GList* g_list_find (GList *list,
|
||||||
@ -932,6 +933,7 @@ GSList* g_slist_remove (GSList *list,
|
|||||||
GSList* g_slist_remove_link (GSList *list,
|
GSList* g_slist_remove_link (GSList *list,
|
||||||
GSList *llink);
|
GSList *llink);
|
||||||
GSList* g_slist_reverse (GSList *list);
|
GSList* g_slist_reverse (GSList *list);
|
||||||
|
GSList* g_slist_copy (GSList *list);
|
||||||
GSList* g_slist_nth (GSList *list,
|
GSList* g_slist_nth (GSList *list,
|
||||||
guint n);
|
guint n);
|
||||||
GSList* g_slist_find (GSList *list,
|
GSList* g_slist_find (GSList *list,
|
||||||
|
@ -885,6 +885,7 @@ GList* g_list_remove (GList *list,
|
|||||||
GList* g_list_remove_link (GList *list,
|
GList* g_list_remove_link (GList *list,
|
||||||
GList *llink);
|
GList *llink);
|
||||||
GList* g_list_reverse (GList *list);
|
GList* g_list_reverse (GList *list);
|
||||||
|
GList* g_list_copy (GList *list);
|
||||||
GList* g_list_nth (GList *list,
|
GList* g_list_nth (GList *list,
|
||||||
guint n);
|
guint n);
|
||||||
GList* g_list_find (GList *list,
|
GList* g_list_find (GList *list,
|
||||||
@ -932,6 +933,7 @@ GSList* g_slist_remove (GSList *list,
|
|||||||
GSList* g_slist_remove_link (GSList *list,
|
GSList* g_slist_remove_link (GSList *list,
|
||||||
GSList *llink);
|
GSList *llink);
|
||||||
GSList* g_slist_reverse (GSList *list);
|
GSList* g_slist_reverse (GSList *list);
|
||||||
|
GSList* g_slist_copy (GSList *list);
|
||||||
GSList* g_slist_nth (GSList *list,
|
GSList* g_slist_nth (GSList *list,
|
||||||
guint n);
|
guint n);
|
||||||
GSList* g_slist_find (GSList *list,
|
GSList* g_slist_find (GSList *list,
|
||||||
|
26
glib/glist.c
26
glib/glist.c
@ -273,6 +273,32 @@ g_list_remove_link (GList *list,
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GList*
|
||||||
|
g_list_copy (GList *list)
|
||||||
|
{
|
||||||
|
GList *new_list = NULL;
|
||||||
|
|
||||||
|
if (list)
|
||||||
|
{
|
||||||
|
GList *last;
|
||||||
|
|
||||||
|
new_list = g_list_alloc ();
|
||||||
|
new_list->data = list->data;
|
||||||
|
last = new_list;
|
||||||
|
list = list->next;
|
||||||
|
while (list)
|
||||||
|
{
|
||||||
|
last->next = g_list_alloc ();
|
||||||
|
last->next->prev = last;
|
||||||
|
last = last->next;
|
||||||
|
last->data = list->data;
|
||||||
|
list = list->next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return new_list;
|
||||||
|
}
|
||||||
|
|
||||||
GList*
|
GList*
|
||||||
g_list_reverse (GList *list)
|
g_list_reverse (GList *list)
|
||||||
{
|
{
|
||||||
|
@ -255,6 +255,31 @@ g_slist_remove_link (GSList *list,
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GSList*
|
||||||
|
g_slist_copy (GSList *list)
|
||||||
|
{
|
||||||
|
GSList *new_list = NULL;
|
||||||
|
|
||||||
|
if (list)
|
||||||
|
{
|
||||||
|
GSList *last;
|
||||||
|
|
||||||
|
new_list = g_slist_alloc ();
|
||||||
|
new_list->data = list->data;
|
||||||
|
last = new_list;
|
||||||
|
list = list->next;
|
||||||
|
while (list)
|
||||||
|
{
|
||||||
|
last->next = g_slist_alloc ();
|
||||||
|
last = last->next;
|
||||||
|
last->data = list->data;
|
||||||
|
list = list->next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return new_list;
|
||||||
|
}
|
||||||
|
|
||||||
GSList*
|
GSList*
|
||||||
g_slist_reverse (GSList *list)
|
g_slist_reverse (GSList *list)
|
||||||
{
|
{
|
||||||
|
26
glist.c
26
glist.c
@ -273,6 +273,32 @@ g_list_remove_link (GList *list,
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GList*
|
||||||
|
g_list_copy (GList *list)
|
||||||
|
{
|
||||||
|
GList *new_list = NULL;
|
||||||
|
|
||||||
|
if (list)
|
||||||
|
{
|
||||||
|
GList *last;
|
||||||
|
|
||||||
|
new_list = g_list_alloc ();
|
||||||
|
new_list->data = list->data;
|
||||||
|
last = new_list;
|
||||||
|
list = list->next;
|
||||||
|
while (list)
|
||||||
|
{
|
||||||
|
last->next = g_list_alloc ();
|
||||||
|
last->next->prev = last;
|
||||||
|
last = last->next;
|
||||||
|
last->data = list->data;
|
||||||
|
list = list->next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return new_list;
|
||||||
|
}
|
||||||
|
|
||||||
GList*
|
GList*
|
||||||
g_list_reverse (GList *list)
|
g_list_reverse (GList *list)
|
||||||
{
|
{
|
||||||
|
25
gslist.c
25
gslist.c
@ -255,6 +255,31 @@ g_slist_remove_link (GSList *list,
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GSList*
|
||||||
|
g_slist_copy (GSList *list)
|
||||||
|
{
|
||||||
|
GSList *new_list = NULL;
|
||||||
|
|
||||||
|
if (list)
|
||||||
|
{
|
||||||
|
GSList *last;
|
||||||
|
|
||||||
|
new_list = g_slist_alloc ();
|
||||||
|
new_list->data = list->data;
|
||||||
|
last = new_list;
|
||||||
|
list = list->next;
|
||||||
|
while (list)
|
||||||
|
{
|
||||||
|
last->next = g_slist_alloc ();
|
||||||
|
last = last->next;
|
||||||
|
last->data = list->data;
|
||||||
|
list = list->next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return new_list;
|
||||||
|
}
|
||||||
|
|
||||||
GSList*
|
GSList*
|
||||||
g_slist_reverse (GSList *list)
|
g_slist_reverse (GSList *list)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user