provide usefull default specifications for identifier_spec and

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.
This commit is contained in:
Tim Janik
1998-05-17 11:35:55 +00:00
committed by Tim Janik
parent 9256ac8a62
commit 04a70261a4
5 changed files with 40 additions and 3 deletions

View File

@@ -1,8 +1,16 @@
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>

View File

@@ -518,6 +518,8 @@ guint g_list_length (GList *list);
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)
@@ -558,6 +560,8 @@ guint g_slist_length (GSList *list);
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)

View File

@@ -300,6 +300,16 @@ g_list_nth (GList *list,
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)

View File

@@ -665,6 +665,11 @@ g_scanner_unexp_token (GScanner *scanner,
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);

View File

@@ -289,6 +289,16 @@ g_slist_nth (GSList *list,
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)