+Sun May 17 10:48:27 1998 Tim Janik <timj@gtk.org>
+
+ * gscanner.c (g_scanner_unexp_token): provide usefull default
+ specifications for identifier_spec and symbol_spec.
+
+ * glib.h: new functions g_slist_nth_data and g_list_nth_data to return
+ the data of the nth element in the list.
+
Fri May 15 22:31:49 1998 Tim Janik <timj@gtk.org>
- * gscanner.c (g_scanner_unexp_token): removed sputious va_end(args) that
- for some reason didn't produce a compiler wrning on my machine (is
- va_end undefined for i386?).
+ * gscanner.c (g_scanner_unexp_token): removed spurious va_end(args)
+ that for some reason didn't produce a compiler wrning on my machine
+ (is va_end undefined for i386?).
Fri May 15 12:32:08 1998 rodo <doulik@karlin.mff.cuni.cz>
void g_list_foreach (GList *list,
GFunc func,
gpointer user_data);
+gpointer g_list_nth_data (GList *list,
+ guint n);
#define g_list_previous(list) ((list) ? (((GList *)list)->prev) : NULL)
#define g_list_next(list) ((list) ? (((GList *)list)->next) : NULL)
void g_slist_foreach (GSList *list,
GFunc func,
gpointer user_data);
+gpointer g_slist_nth_data (GSList *list,
+ guint n);
#define g_slist_next(list) ((list) ? (((GSList *)list)->next) : NULL)
return list;
}
+gpointer
+g_list_nth_data (GList *list,
+ guint n)
+{
+ while ((n-- > 0) && list)
+ list = list->next;
+
+ return list ? list->data : NULL;
+}
+
GList*
g_list_find (GList *list,
gpointer data)
msg_handler = g_scanner_error;
else
msg_handler = g_scanner_warn;
+
+ if (!identifier_spec)
+ identifier_spec = "identifier";
+ if (!symbol_spec)
+ symbol_spec = "symbol";
token_string_len = 56;
token_string = g_new (gchar, token_string_len + 1);
return list;
}
+gpointer
+g_slist_nth_data (GSList *list,
+ guint n)
+{
+ while ((n-- > 0) && list)
+ list = list->next;
+
+ return list ? list->data : NULL;
+}
+
GSList*
g_slist_find (GSList *list,
gpointer data)