After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 117994 - g_list_from_g_slist and viceversa
g_list_from_g_slist and viceversa
Status: RESOLVED DUPLICATE of bug 60198
Product: glib
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2003-07-21 15:27 UTC by Paolo Borelli
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Paolo Borelli 2003-07-21 15:27:00 UTC
I was reading through the eel extensions to glib and I noticed these two
functions that seem general and easy enaugh.
Maybe they are worth to be included in glib.
If you are interested I can prepare a patch (with the gtk coding style and
with inline docs)

GList *
g_list_from_g_slist (GSList *slist)
{
	GList *list;
	GSList *node;

	list = NULL;
	for (node = slist; node; node = node->next) {
		list = g_list_prepend (list, node->data);
	}
	return g_list_reverse (list);
}

GSList *
g_slist_from_g_list (GList *list)
{
	GSList *slist;
	GList *node;

	slist = NULL;
	for (node = list; node; node = node->next) {
		slist = g_slist_prepend (slist, node->data);
	}
	return g_slist_reverse (slist);
}
Comment 1 Matthias Clasen 2003-07-22 14:47:14 UTC

*** This bug has been marked as a duplicate of 60198 ***