Added g_slist_nth_data() to glib-new.o so that glib-1.0.x, x < 4, will work.

It seems that a stable version of the library received a new function. This
should help RedHat folks, since they seem to have glib-1.0.1.

svn path=/trunk/; revision=216
This commit is contained in:
Gilbert Ramirez 1999-03-20 04:41:04 +00:00
parent ca662881cb
commit f19fe6afea
2 changed files with 17 additions and 0 deletions

View File

@ -89,4 +89,17 @@ g_strjoin (const gchar *separator,
return string;
}
/* this was introduced sometime between glib-1.0.1 and glib-1.0.4 */
gpointer
g_slist_nth_data (GSList *list,
guint n)
{
while ((n-- > 0) && list)
list = list->next;
return list ? list->data : NULL;
}
#endif

View File

@ -24,3 +24,7 @@ g_memdup (const gpointer mem,
gchar*
g_strjoin (const gchar *separator,
...);
gpointer
g_slist_nth_data (GSList *list,
guint n);