*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
/* This should never happen */
#endif
-typedef gint32 gssize;
+typedef gint32 gssize;
typedef guint32 gsize;
-typedef gint32 gtime;
+typedef gint32 gtime;
typedef guint32 GQuark;
typedef struct _GList GList;
struct _GByteArray
{
guint8 *data;
- guint len;
+ guint len;
};
struct _GPtrArray
{
gpointer *pdata;
- guint len;
+ guint len;
};
struct _GTuples
struct _GDebugKey
{
gchar *key;
- guint value;
+ guint value;
};
struct _GCache { gint dummy; };
guint identifier_2_string : 1;
guint char_2_token : 1; /* return G_TOKEN_CHAR? */
guint symbol_2_token : 1;
+ guint scope_0_fallback : 1; /* try scope 0 on lookups? */
};
struct _GScanner
guint text_len;
gint input_fd;
gint peeked_char;
+ guint scope_id;
/* handler function for _warn and _error */
GScannerMsgFunc msg_handler;
guint g_scanner_cur_line (GScanner *scanner);
guint g_scanner_cur_position (GScanner *scanner);
gboolean g_scanner_eof (GScanner *scanner);
-void g_scanner_add_symbol (GScanner *scanner,
+guint g_scanner_set_scope (GScanner *scanner,
+ guint scope_id);
+void g_scanner_scope_add_symbol (GScanner *scanner,
+ guint scope_id,
const gchar *symbol,
gpointer value);
-gpointer g_scanner_lookup_symbol (GScanner *scanner,
+void g_scanner_scope_remove_symbol (GScanner *scanner,
+ guint scope_id,
+ const gchar *symbol);
+gpointer g_scanner_scope_lookup_symbol (GScanner *scanner,
+ guint scope_id,
const gchar *symbol);
-void g_scanner_foreach_symbol (GScanner *scanner,
+void g_scanner_scope_foreach_symbol (GScanner *scanner,
+ guint scope_id,
GHFunc func,
gpointer func_data);
-void g_scanner_remove_symbol (GScanner *scanner,
+gpointer g_scanner_lookup_symbol (GScanner *scanner,
const gchar *symbol);
void g_scanner_freeze_symbol_table (GScanner *scanner);
void g_scanner_thaw_symbol_table (GScanner *scanner);
const gchar *format,
...) G_GNUC_PRINTF (2,3);
gint g_scanner_stat_mode (const gchar *filename);
+/* keep downward source compatibility */
+#define g_scanner_add_symbol( scanner, symbol, value ) G_STMT_START { \
+ g_scanner_scope_add_symbol ((scanner), 0, (symbol), (value)); \
+} G_STMT_END
+#define g_scanner_remove_symbol( scanner, symbol ) G_STMT_START { \
+ g_scanner_scope_remove_symbol ((scanner), 0, (symbol)); \
+} G_STMT_END
+#define g_scanner_foreach_symbol( scanner, func, data ) G_STMT_START { \
+ g_scanner_scope_foreach_symbol ((scanner), 0, (func), (data)); \
+} G_STMT_END
+
/* Completion */