diff --git a/ChangeLog b/ChangeLog index 6286236f2..81e4caaff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Jun 12 15:39:06 1998 Tim Janik + + * glib.h (GScanner): cleanups of the structure fields (binary + incompatible). + Fri Jun 12 00:39:28 1998 Josh MacDonald * glib.h: add new hash and equal functions g_int_*. complement diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 6286236f2..81e4caaff 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,8 @@ +Fri Jun 12 15:39:06 1998 Tim Janik + + * glib.h (GScanner): cleanups of the structure fields (binary + incompatible). + Fri Jun 12 00:39:28 1998 Josh MacDonald * glib.h: add new hash and equal functions g_int_*. complement diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 6286236f2..81e4caaff 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +Fri Jun 12 15:39:06 1998 Tim Janik + + * glib.h (GScanner): cleanups of the structure fields (binary + incompatible). + Fri Jun 12 00:39:28 1998 Josh MacDonald * glib.h: add new hash and equal functions g_int_*. complement diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 6286236f2..81e4caaff 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,8 @@ +Fri Jun 12 15:39:06 1998 Tim Janik + + * glib.h (GScanner): cleanups of the structure fields (binary + incompatible). + Fri Jun 12 00:39:28 1998 Josh MacDonald * glib.h: add new hash and equal functions g_int_*. complement diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 6286236f2..81e4caaff 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,8 @@ +Fri Jun 12 15:39:06 1998 Tim Janik + + * glib.h (GScanner): cleanups of the structure fields (binary + incompatible). + Fri Jun 12 00:39:28 1998 Josh MacDonald * glib.h: add new hash and equal functions g_int_*. complement diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 6286236f2..81e4caaff 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,8 @@ +Fri Jun 12 15:39:06 1998 Tim Janik + + * glib.h (GScanner): cleanups of the structure fields (binary + incompatible). + Fri Jun 12 00:39:28 1998 Josh MacDonald * glib.h: add new hash and equal functions g_int_*. complement diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 6286236f2..81e4caaff 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,8 @@ +Fri Jun 12 15:39:06 1998 Tim Janik + + * glib.h (GScanner): cleanups of the structure fields (binary + incompatible). + Fri Jun 12 00:39:28 1998 Josh MacDonald * glib.h: add new hash and equal functions g_int_*. complement diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 6286236f2..81e4caaff 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,8 @@ +Fri Jun 12 15:39:06 1998 Tim Janik + + * glib.h (GScanner): cleanups of the structure fields (binary + incompatible). + Fri Jun 12 00:39:28 1998 Josh MacDonald * glib.h: add new hash and equal functions g_int_*. complement diff --git a/glib.h b/glib.h index c3733d440..cac097fc5 100644 --- a/glib.h +++ b/glib.h @@ -1118,30 +1118,42 @@ struct _GScannerConfig struct _GScanner { - /* unused portions */ + /* unused fields */ gpointer user_data; - const gchar *input_name; - guint parse_errors; guint max_parse_errors; - - /* maintained/used by the g_scanner_*() functions */ + + /* g_scanner_error() increments this field */ + guint parse_errors; + + /* name of input stream, featured by the default message handler */ + const gchar *input_name; + + /* data pointer for derived structures */ + gpointer derived_data; + + /* link into the scanner configuration */ GScannerConfig *config; + + /* fields filled in after g_scanner_get_next_token() */ GTokenType token; GValue value; guint line; guint position; - - /* to be considered private */ + + /* fields filled in after g_scanner_peek_next_token() */ GTokenType next_token; GValue next_value; guint next_line; guint next_position; + + /* to be considered private */ GHashTable *symbol_table; const gchar *text; guint text_len; gint input_fd; gint peeked_char; + /* handler function for _warn and _error */ GScannerMsgFunc msg_handler; }; diff --git a/glib/glib.h b/glib/glib.h index c3733d440..cac097fc5 100644 --- a/glib/glib.h +++ b/glib/glib.h @@ -1118,30 +1118,42 @@ struct _GScannerConfig struct _GScanner { - /* unused portions */ + /* unused fields */ gpointer user_data; - const gchar *input_name; - guint parse_errors; guint max_parse_errors; - - /* maintained/used by the g_scanner_*() functions */ + + /* g_scanner_error() increments this field */ + guint parse_errors; + + /* name of input stream, featured by the default message handler */ + const gchar *input_name; + + /* data pointer for derived structures */ + gpointer derived_data; + + /* link into the scanner configuration */ GScannerConfig *config; + + /* fields filled in after g_scanner_get_next_token() */ GTokenType token; GValue value; guint line; guint position; - - /* to be considered private */ + + /* fields filled in after g_scanner_peek_next_token() */ GTokenType next_token; GValue next_value; guint next_line; guint next_position; + + /* to be considered private */ GHashTable *symbol_table; const gchar *text; guint text_len; gint input_fd; gint peeked_char; + /* handler function for _warn and _error */ GScannerMsgFunc msg_handler; }; diff --git a/glib/gscanner.c b/glib/gscanner.c index ccb696053..41fcb4a2b 100644 --- a/glib/gscanner.c +++ b/glib/gscanner.c @@ -159,9 +159,10 @@ g_scanner_new (GScannerConfig *config_templ) scanner = g_new0 (GScanner, 1); scanner->user_data = NULL; - scanner->input_name = NULL; - scanner->parse_errors = 0; scanner->max_parse_errors = 0; + scanner->parse_errors = 0; + scanner->input_name = NULL; + scanner->derived_data = NULL; scanner->config = g_new0 (GScannerConfig, 1); @@ -199,7 +200,7 @@ g_scanner_new (GScannerConfig *config_templ) scanner->next_value.v_int = 0; scanner->next_line = 1; scanner->next_position = 0; - + scanner->symbol_table = g_hash_table_new (g_str_hash, g_str_equal); scanner->text = NULL; scanner->text_len = 0; diff --git a/gscanner.c b/gscanner.c index ccb696053..41fcb4a2b 100644 --- a/gscanner.c +++ b/gscanner.c @@ -159,9 +159,10 @@ g_scanner_new (GScannerConfig *config_templ) scanner = g_new0 (GScanner, 1); scanner->user_data = NULL; - scanner->input_name = NULL; - scanner->parse_errors = 0; scanner->max_parse_errors = 0; + scanner->parse_errors = 0; + scanner->input_name = NULL; + scanner->derived_data = NULL; scanner->config = g_new0 (GScannerConfig, 1); @@ -199,7 +200,7 @@ g_scanner_new (GScannerConfig *config_templ) scanner->next_value.v_int = 0; scanner->next_line = 1; scanner->next_position = 0; - + scanner->symbol_table = g_hash_table_new (g_str_hash, g_str_equal); scanner->text = NULL; scanner->text_len = 0;