<refentry id="glib-Lexical-Scanner">
<refmeta>
<refentrytitle>Lexical Scanner</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GLIB Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>Lexical Scanner</refname><refpurpose>a general purpose lexical scanner.</refpurpose>
</refnamediv>

<refsynopsisdiv><title>Synopsis</title>
<synopsis>

#include &lt;glib.h&gt;


struct      <link linkend="GScanner">GScanner</link>;
<link linkend="GScanner">GScanner</link>*   <link linkend="g-scanner-new">g_scanner_new</link>                   (const <link linkend="GScannerConfig">GScannerConfig</link> *config_templ);
struct      <link linkend="GScannerConfig">GScannerConfig</link>;

void        <link linkend="g-scanner-input-file">g_scanner_input_file</link>            (<link linkend="GScanner">GScanner</link> *scanner,
                                             <link linkend="gint">gint</link> input_fd);
void        <link linkend="g-scanner-sync-file-offset">g_scanner_sync_file_offset</link>      (<link linkend="GScanner">GScanner</link> *scanner);
void        <link linkend="g-scanner-input-text">g_scanner_input_text</link>            (<link linkend="GScanner">GScanner</link> *scanner,
                                             const	<link linkend="gchar">gchar</link> *text,
                                             <link linkend="guint">guint</link> text_len);
<link linkend="GTokenType">GTokenType</link>  <link linkend="g-scanner-peek-next-token">g_scanner_peek_next_token</link>       (<link linkend="GScanner">GScanner</link> *scanner);
<link linkend="GTokenType">GTokenType</link>  <link linkend="g-scanner-get-next-token">g_scanner_get_next_token</link>        (<link linkend="GScanner">GScanner</link> *scanner);

<link linkend="guint">guint</link>       <link linkend="g-scanner-cur-line">g_scanner_cur_line</link>              (<link linkend="GScanner">GScanner</link> *scanner);
<link linkend="guint">guint</link>       <link linkend="g-scanner-cur-position">g_scanner_cur_position</link>          (<link linkend="GScanner">GScanner</link> *scanner);
<link linkend="GTokenType">GTokenType</link>  <link linkend="g-scanner-cur-token">g_scanner_cur_token</link>             (<link linkend="GScanner">GScanner</link> *scanner);
<link linkend="GTokenValue">GTokenValue</link> <link linkend="g-scanner-cur-value">g_scanner_cur_value</link>             (<link linkend="GScanner">GScanner</link> *scanner);
<link linkend="gboolean">gboolean</link>    <link linkend="g-scanner-eof">g_scanner_eof</link>                   (<link linkend="GScanner">GScanner</link> *scanner);

<link linkend="guint">guint</link>       <link linkend="g-scanner-set-scope">g_scanner_set_scope</link>             (<link linkend="GScanner">GScanner</link> *scanner,
                                             <link linkend="guint">guint</link> scope_id);
void        <link linkend="g-scanner-scope-add-symbol">g_scanner_scope_add_symbol</link>      (<link linkend="GScanner">GScanner</link> *scanner,
                                             <link linkend="guint">guint</link> scope_id,
                                             const <link linkend="gchar">gchar</link> *symbol,
                                             <link linkend="gpointer">gpointer</link> value);
void        <link linkend="g-scanner-scope-foreach-symbol">g_scanner_scope_foreach_symbol</link>  (<link linkend="GScanner">GScanner</link> *scanner,
                                             <link linkend="guint">guint</link> scope_id,
                                             <link linkend="GHFunc">GHFunc</link> func,
                                             <link linkend="gpointer">gpointer</link> user_data);
<link linkend="gpointer">gpointer</link>    <link linkend="g-scanner-scope-lookup-symbol">g_scanner_scope_lookup_symbol</link>   (<link linkend="GScanner">GScanner</link> *scanner,
                                             <link linkend="guint">guint</link> scope_id,
                                             const <link linkend="gchar">gchar</link> *symbol);
void        <link linkend="g-scanner-scope-remove-symbol">g_scanner_scope_remove_symbol</link>   (<link linkend="GScanner">GScanner</link> *scanner,
                                             <link linkend="guint">guint</link> scope_id,
                                             const <link linkend="gchar">gchar</link> *symbol);

#define     <link linkend="g-scanner-freeze-symbol-table">g_scanner_freeze_symbol_table</link>   (scanner)
#define     <link linkend="g-scanner-thaw-symbol-table">g_scanner_thaw_symbol_table</link>     (scanner)
<link linkend="gpointer">gpointer</link>    <link linkend="g-scanner-lookup-symbol">g_scanner_lookup_symbol</link>         (<link linkend="GScanner">GScanner</link> *scanner,
                                             const <link linkend="gchar">gchar</link> *symbol);

void        <link linkend="g-scanner-warn">g_scanner_warn</link>                  (<link linkend="GScanner">GScanner</link> *scanner,
                                             const <link linkend="gchar">gchar</link> *format,
                                             ...);
void        <link linkend="g-scanner-error">g_scanner_error</link>                 (<link linkend="GScanner">GScanner</link> *scanner,
                                             const <link linkend="gchar">gchar</link> *format,
                                             ...);
void        <link linkend="g-scanner-unexp-token">g_scanner_unexp_token</link>           (<link linkend="GScanner">GScanner</link> *scanner,
                                             <link linkend="GTokenType">GTokenType</link> expected_token,
                                             const <link linkend="gchar">gchar</link> *identifier_spec,
                                             const <link linkend="gchar">gchar</link> *symbol_spec,
                                             const <link linkend="gchar">gchar</link> *symbol_name,
                                             const <link linkend="gchar">gchar</link> *message,
                                             <link linkend="gint">gint</link> is_error);
void        (<link linkend="GScannerMsgFunc">*GScannerMsgFunc</link>)              (<link linkend="GScanner">GScanner</link> *scanner,
                                             <link linkend="gchar">gchar</link> *message,
                                             <link linkend="gboolean">gboolean</link> error);

void        <link linkend="g-scanner-destroy">g_scanner_destroy</link>               (<link linkend="GScanner">GScanner</link> *scanner);

enum        <link linkend="GTokenType">GTokenType</link>;
union       <link linkend="GTokenValue">GTokenValue</link>;
enum        <link linkend="GErrorType">GErrorType</link>;
#define     <link linkend="G-CSET-a-2-z">G_CSET_a_2_z</link>
#define     <link linkend="G-CSET-A-2-Z-CAPS">G_CSET_A_2_Z</link>
#define     <link linkend="G-CSET-DIGITS-CAPS">G_CSET_DIGITS</link>
#define     <link linkend="G-CSET-LATINC-CAPS">G_CSET_LATINC</link>
#define     <link linkend="G-CSET-LATINS-CAPS">G_CSET_LATINS</link>

#define     <link linkend="g-scanner-add-symbol">g_scanner_add_symbol</link>            ( scanner, symbol, value )
#define     <link linkend="g-scanner-remove-symbol">g_scanner_remove_symbol</link>         ( scanner, symbol )
#define     <link linkend="g-scanner-foreach-symbol">g_scanner_foreach_symbol</link>        ( scanner, func, data )
</synopsis>
</refsynopsisdiv>





<refsect1>
<title>Description</title>
<para>
The <link linkend="GScanner">GScanner</link> and its associated functions provide a general purpose
lexical scanner.
</para>
<para>
FIXME: really needs an example and more detail, but I don't completely
understand it myself. Look at gtkrc.c for some code using the scanner.
</para>
</refsect1>

<refsect1>
<title>Details</title>
<refsect2>
<title><anchor id="GScanner">struct GScanner</title>
<programlisting>struct GScanner
{
  /* unused fields */
  gpointer		user_data;
  guint			max_parse_errors;
  
  /* g_scanner_error() increments this field */
  guint			parse_errors;
  
  /* name of input stream, featured by the default message handler */
  const gchar		*input_name;
  
  /* quarked data */
  GData			*qdata;
  
  /* link into the scanner configuration */
  GScannerConfig	*config;
  
  /* fields filled in after g_scanner_get_next_token() */
  GTokenType		token;
  GTokenValue		value;
  guint			line;
  guint			position;
  
  /* fields filled in after g_scanner_peek_next_token() */
  GTokenType		next_token;
  GTokenValue		next_value;
  guint			next_line;
  guint			next_position;
  
  /* to be considered private */
  GHashTable		*symbol_table;
  gint			input_fd;
  const gchar		*text;
  const gchar		*text_end;
  gchar			*buffer;
  guint			scope_id;
  
  /* handler function for _warn and _error */
  GScannerMsgFunc	msg_handler;
};
</programlisting>
<para>
The data structure representing a lexical scanner.
</para>
<para>
You should set <structfield>input_name</structfield> after creating 
the scanner, since it is used by the default message handler when 
displaying warnings and errors. If you are scanning a file, the file 
name would be a good choice.
</para>
<para>
The <structfield>user_data</structfield> and
<structfield>max_parse_errors</structfield> fields are not used.
If you need to associate extra data with the scanner you can place them here.
</para>
<para>
If you want to use your own message handler you can set the
<structfield>msg_handler</structfield> field. The type of the message
handler function is declared by <link linkend="GScannerMsgFunc">GScannerMsgFunc</link>.
</para></refsect2>
<refsect2>
<title><anchor id="g-scanner-new">g_scanner_new ()</title>
<programlisting><link linkend="GScanner">GScanner</link>*   g_scanner_new                   (const <link linkend="GScannerConfig">GScannerConfig</link> *config_templ);</programlisting>
<para>
Creates a new <link linkend="GScanner">GScanner</link>.
The <parameter>config_templ</parameter> structure specifies the initial settings of the scanner,
which are copied into the <link linkend="GScanner">GScanner</link> <structfield>config</structfield> field.
If you pass <literal>NULL</literal> then the default settings are used.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>config_templ</parameter>&nbsp;:</entry>
<entry>the initial scanner settings.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the new <link linkend="GScanner">GScanner</link>.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="GScannerConfig">struct GScannerConfig</title>
<programlisting>struct GScannerConfig
{
  /* Character sets
   */
  gchar		*cset_skip_characters;		/* default: " \t\n" */
  gchar		*cset_identifier_first;
  gchar		*cset_identifier_nth;
  gchar		*cpair_comment_single;		/* default: "#\n" */
  
  /* Should symbol lookup work case sensitive?
   */
  guint		case_sensitive : 1;
  
  /* Boolean values to be adjusted "on the fly"
   * to configure scanning behaviour.
   */
  guint		skip_comment_multi : 1;		/* C like comment */
  guint		skip_comment_single : 1;	/* single line comment */
  guint		scan_comment_multi : 1;		/* scan multi line comments? */
  guint		scan_identifier : 1;
  guint		scan_identifier_1char : 1;
  guint		scan_identifier_NULL : 1;
  guint		scan_symbols : 1;
  guint		scan_binary : 1;
  guint		scan_octal : 1;
  guint		scan_float : 1;
  guint		scan_hex : 1;			/* `0x0ff0' */
  guint		scan_hex_dollar : 1;		/* `$0ff0' */
  guint		scan_string_sq : 1;		/* string: 'anything' */
  guint		scan_string_dq : 1;		/* string: "\\-escapes!\n" */
  guint		numbers_2_int : 1;		/* bin, octal, hex =&gt; int */
  guint		int_2_float : 1;		/* int =&gt; G_TOKEN_FLOAT? */
  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? */
  guint		padding_dummy;
};
</programlisting>
<para>
Specifies the <link linkend="GScanner">GScanner</link> settings.
</para>
<para>
<structfield>cset_skip_characters</structfield> specifies which characters
should be skipped by the scanner (the default is the whitespace characters:
space, tab, carriage-return and line-feed).
</para>
<para>
<structfield>cset_identifier_first</structfield> specifies the characters
which can start identifiers (the default is <link linkend="G-CSET-a-2-z">G_CSET_a_2_z</link>, "_", and 
<link linkend="G-CSET-A-2-Z-CAPS">G_CSET_A_2_Z</link>).
</para>
<para>
<structfield>cset_identifier_nth</structfield> specifies the characters
which can be used in identifiers, after the first character (the default 
is <link linkend="G-CSET-a-2-z">G_CSET_a_2_z</link>, "_0123456789", <link linkend="G-CSET-A-2-Z-CAPS">G_CSET_A_2_Z</link>, <link linkend="G-CSET-LATINS-CAPS">G_CSET_LATINS</link>,
<link linkend="G-CSET-LATINC-CAPS">G_CSET_LATINC</link>).
</para>
<para>
<structfield>cpair_comment_single</structfield> specifies the characters
at the start and end of single-line comments. The default is "#\n" which
means that single-line comments start with a '#' and continue until a '\n'
(end of line).
</para>
<para>
<structfield>case_sensitive</structfield> specifies if symbols are
case sensitive (the default is <literal>FALSE</literal>).
</para>
<para>
<structfield>skip_comment_multi</structfield> specifies if multi-line
comments are skipped and not returned as tokens (the default is <literal>TRUE</literal>).
</para>
<para>
<structfield>skip_comment_single</structfield> specifies if single-line
comments are skipped and not returned as tokens (the default is <literal>TRUE</literal>).
</para>
<para>
<structfield>scan_comment_multi</structfield> specifies if multi-line
comments are recognized (the default is <literal>TRUE</literal>).
</para>
<para>
<structfield>scan_identifier</structfield> specifies if identifiers
are recognized (the default is <literal>TRUE</literal>).
</para>
<para>
<structfield>scan_identifier_1char</structfield> specifies if single-character
identifiers are recognized (the default is <literal>FALSE</literal>).
</para>
<para>
<structfield>scan_identifier_NULL</structfield> specifies if 
<literal>NULL</literal> is reported as <link linkend="G-TOKEN-IDENTIFIER-NULL-CAPS">G_TOKEN_IDENTIFIER_NULL</link>.
(the default is <literal>FALSE</literal>).
</para>
<para>
<structfield>scan_symbols</structfield> specifies if symbols are
recognized (the default is <literal>TRUE</literal>).
</para>
<para>
<structfield>scan_binary</structfield> specifies if binary numbers
are recognized (the default is <literal>FALSE</literal>).
</para>
<para>
<structfield>scan_octal</structfield> specifies if octal numbers
are recognized (the default is <literal>TRUE</literal>).
</para>
<para>
<structfield>scan_float</structfield> specifies if floating point numbers
are recognized (the default is <literal>TRUE</literal>).
</para>
<para>
<structfield>scan_hex</structfield> specifies if hexadecimal numbers
are recognized (the default is <literal>TRUE</literal>).
</para>
<para>
<structfield>scan_hex_dollar</structfield> specifies if '$' is recognized
as a prefix for hexadecimal numbers (the default is <literal>FALSE</literal>).
</para>
<para>
<structfield>scan_string_sq</structfield> specifies if strings can be
enclosed in single quotes (the default is <literal>TRUE</literal>).
</para>
<para>
<structfield>scan_string_dq</structfield> specifies if strings can be
enclosed in double quotes (the default is <literal>TRUE</literal>).
</para>
<para>
<structfield>numbers_2_int</structfield> specifies if binary, octal and
hexadecimal numbers are reported as <link linkend="G-TOKEN-INT-CAPS">G_TOKEN_INT</link> (the default is <literal>TRUE</literal>).
</para>
<para>
<structfield>int_2_float</structfield> specifies if all numbers are 
reported as <link linkend="G-TOKEN-FLOAT-CAPS">G_TOKEN_FLOAT</link> (the default is <literal>FALSE</literal>).
</para>
<para>
<structfield>identifier_2_string</structfield> specifies if identifiers
are reported as strings (the default is <literal>FALSE</literal>).
</para>
<para>
<structfield>char_2_token</structfield> specifies if characters
are reported by setting <literal>token = ch</literal> or as <link linkend="G-TOKEN-CHAR-CAPS">G_TOKEN_CHAR</link> 
(the default is <literal>TRUE</literal>).
</para>
<para>
<structfield>symbol_2_token</structfield> specifies if symbols 
are reported by setting <literal>token = v_symbol</literal> or as
<link linkend="G-TOKEN-SYMBOL-CAPS">G_TOKEN_SYMBOL</link> (the default is <literal>FALSE</literal>).
</para>
<para>
<structfield>scope_0_fallback</structfield> specifies if a symbol 
is searched for in the default scope in addition to the current scope
(the default is <literal>FALSE</literal>).
</para></refsect2>
<refsect2>
<title><anchor id="g-scanner-input-file">g_scanner_input_file ()</title>
<programlisting>void        g_scanner_input_file            (<link linkend="GScanner">GScanner</link> *scanner,
                                             <link linkend="gint">gint</link> input_fd);</programlisting>
<para>
Prepares to scan a file.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>scanner</parameter>&nbsp;:</entry>
<entry>a <link linkend="GScanner">GScanner</link>.
</entry></row>
<row><entry align="right"><parameter>input_fd</parameter>&nbsp;:</entry>
<entry>a file descriptor.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-scanner-sync-file-offset">g_scanner_sync_file_offset ()</title>
<programlisting>void        g_scanner_sync_file_offset      (<link linkend="GScanner">GScanner</link> *scanner);</programlisting>
<para>
Rewinds the filedescriptor to the current buffer position and blows 
the file read ahead buffer. This is useful for third party uses of
the scanners filedescriptor, which hooks onto the current scanning 
position.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>scanner</parameter>&nbsp;:</entry>
<entry>a <link linkend="GScanner">GScanner</link>.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-scanner-input-text">g_scanner_input_text ()</title>
<programlisting>void        g_scanner_input_text            (<link linkend="GScanner">GScanner</link> *scanner,
                                             const	<link linkend="gchar">gchar</link> *text,
                                             <link linkend="guint">guint</link> text_len);</programlisting>
<para>
Prepares to scan a text buffer.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>scanner</parameter>&nbsp;:</entry>
<entry>a <link linkend="GScanner">GScanner</link>.
</entry></row>
<row><entry align="right"><parameter>text</parameter>&nbsp;:</entry>
<entry>the text buffer to scan.
</entry></row>
<row><entry align="right"><parameter>text_len</parameter>&nbsp;:</entry>
<entry>the length of the text buffer.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-scanner-peek-next-token">g_scanner_peek_next_token ()</title>
<programlisting><link linkend="GTokenType">GTokenType</link>  g_scanner_peek_next_token       (<link linkend="GScanner">GScanner</link> *scanner);</programlisting>
<para>
Gets the next token, without removing it from the input stream.
The token data is placed in the
<structfield>next_token</structfield>,
<structfield>next_value</structfield>,
<structfield>next_line</structfield>, and
<structfield>next_position</structfield> fields of the <link linkend="GScanner">GScanner</link> structure.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>scanner</parameter>&nbsp;:</entry>
<entry>a <link linkend="GScanner">GScanner</link>.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the type of the token.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-scanner-get-next-token">g_scanner_get_next_token ()</title>
<programlisting><link linkend="GTokenType">GTokenType</link>  g_scanner_get_next_token        (<link linkend="GScanner">GScanner</link> *scanner);</programlisting>
<para>
Gets the next token, removing it from the input stream.
The token data is placed in the
<structfield>token</structfield>,
<structfield>value</structfield>,
<structfield>line</structfield>, and
<structfield>position</structfield> fields of the <link linkend="GScanner">GScanner</link> structure.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>scanner</parameter>&nbsp;:</entry>
<entry>a <link linkend="GScanner">GScanner</link>.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the type of the token.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-scanner-cur-line">g_scanner_cur_line ()</title>
<programlisting><link linkend="guint">guint</link>       g_scanner_cur_line              (<link linkend="GScanner">GScanner</link> *scanner);</programlisting>
<para>
Gets the current line in the input stream (counting from 1).
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>scanner</parameter>&nbsp;:</entry>
<entry>a <link linkend="GScanner">GScanner</link>.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the current line.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-scanner-cur-position">g_scanner_cur_position ()</title>
<programlisting><link linkend="guint">guint</link>       g_scanner_cur_position          (<link linkend="GScanner">GScanner</link> *scanner);</programlisting>
<para>
Gets the current position in the current line (counting from 0).
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>scanner</parameter>&nbsp;:</entry>
<entry>a <link linkend="GScanner">GScanner</link>.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the current position on the line.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-scanner-cur-token">g_scanner_cur_token ()</title>
<programlisting><link linkend="GTokenType">GTokenType</link>  g_scanner_cur_token             (<link linkend="GScanner">GScanner</link> *scanner);</programlisting>
<para>
Gets the current token type.
This is simply the <structfield>token</structfield> field in the <link linkend="GScanner">GScanner</link>
structure.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>scanner</parameter>&nbsp;:</entry>
<entry>a <link linkend="GScanner">GScanner</link>.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the current token type.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-scanner-cur-value">g_scanner_cur_value ()</title>
<programlisting><link linkend="GTokenValue">GTokenValue</link> g_scanner_cur_value             (<link linkend="GScanner">GScanner</link> *scanner);</programlisting>
<para>
Gets the current token value.
This is simply the <structfield>value</structfield> field in the <link linkend="GScanner">GScanner</link>
structure.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>scanner</parameter>&nbsp;:</entry>
<entry>a <link linkend="GScanner">GScanner</link>.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the current token value.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-scanner-eof">g_scanner_eof ()</title>
<programlisting><link linkend="gboolean">gboolean</link>    g_scanner_eof                   (<link linkend="GScanner">GScanner</link> *scanner);</programlisting>
<para>
Returns <literal>TRUE</literal> if the scanner has reached the end of the file or text buffer.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>scanner</parameter>&nbsp;:</entry>
<entry>a <link linkend="GScanner">GScanner</link>.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry><literal>TRUE</literal> if the scanner has reached the end of the file or text buffer.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-scanner-set-scope">g_scanner_set_scope ()</title>
<programlisting><link linkend="guint">guint</link>       g_scanner_set_scope             (<link linkend="GScanner">GScanner</link> *scanner,
                                             <link linkend="guint">guint</link> scope_id);</programlisting>
<para>
Sets the current scope.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>scanner</parameter>&nbsp;:</entry>
<entry>a <link linkend="GScanner">GScanner</link>.
</entry></row>
<row><entry align="right"><parameter>scope_id</parameter>&nbsp;:</entry>
<entry>the new scope id.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the old scope id.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-scanner-scope-add-symbol">g_scanner_scope_add_symbol ()</title>
<programlisting>void        g_scanner_scope_add_symbol      (<link linkend="GScanner">GScanner</link> *scanner,
                                             <link linkend="guint">guint</link> scope_id,
                                             const <link linkend="gchar">gchar</link> *symbol,
                                             <link linkend="gpointer">gpointer</link> value);</programlisting>
<para>
Adds a symbol to the given scope.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>scanner</parameter>&nbsp;:</entry>
<entry>a <link linkend="GScanner">GScanner</link>.
</entry></row>
<row><entry align="right"><parameter>scope_id</parameter>&nbsp;:</entry>
<entry>the scope id.
</entry></row>
<row><entry align="right"><parameter>symbol</parameter>&nbsp;:</entry>
<entry>the symbol to add.
</entry></row>
<row><entry align="right"><parameter>value</parameter>&nbsp;:</entry>
<entry>the value of the symbol.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-scanner-scope-foreach-symbol">g_scanner_scope_foreach_symbol ()</title>
<programlisting>void        g_scanner_scope_foreach_symbol  (<link linkend="GScanner">GScanner</link> *scanner,
                                             <link linkend="guint">guint</link> scope_id,
                                             <link linkend="GHFunc">GHFunc</link> func,
                                             <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>
Calls the given function for each of the symbol/value pairs in the 
given scope of the <link linkend="GScanner">GScanner</link>. The function is passed the symbol and 
value of each pair, and the given <parameter>user_data</parameter> parameter.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>scanner</parameter>&nbsp;:</entry>
<entry>a <link linkend="GScanner">GScanner</link>.
</entry></row>
<row><entry align="right"><parameter>scope_id</parameter>&nbsp;:</entry>
<entry>the scope id.
</entry></row>
<row><entry align="right"><parameter>func</parameter>&nbsp;:</entry>
<entry>the function to call for each symbol/value pair.
</entry></row>
<row><entry align="right"><parameter>user_data</parameter>&nbsp;:</entry>
<entry>user data to pass to the function.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-scanner-scope-lookup-symbol">g_scanner_scope_lookup_symbol ()</title>
<programlisting><link linkend="gpointer">gpointer</link>    g_scanner_scope_lookup_symbol   (<link linkend="GScanner">GScanner</link> *scanner,
                                             <link linkend="guint">guint</link> scope_id,
                                             const <link linkend="gchar">gchar</link> *symbol);</programlisting>
<para>
Looks up a symbol in a scope and return its value. If the
symbol is not bound in the scope, <literal>NULL</literal> is returned.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>scanner</parameter>&nbsp;:</entry>
<entry>a <link linkend="GScanner">GScanner</link>.
</entry></row>
<row><entry align="right"><parameter>scope_id</parameter>&nbsp;:</entry>
<entry>the scope id.
</entry></row>
<row><entry align="right"><parameter>symbol</parameter>&nbsp;:</entry>
<entry>the symbol to look up.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the value of <parameter>symbol</parameter> in the given scope, or <literal>NULL</literal>
if <parameter>symbol</parameter> is not bound in the given scope.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-scanner-scope-remove-symbol">g_scanner_scope_remove_symbol ()</title>
<programlisting>void        g_scanner_scope_remove_symbol   (<link linkend="GScanner">GScanner</link> *scanner,
                                             <link linkend="guint">guint</link> scope_id,
                                             const <link linkend="gchar">gchar</link> *symbol);</programlisting>
<para>
Removes a symbol from a scope.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>scanner</parameter>&nbsp;:</entry>
<entry>a <link linkend="GScanner">GScanner</link>.
</entry></row>
<row><entry align="right"><parameter>scope_id</parameter>&nbsp;:</entry>
<entry>the scope id.
</entry></row>
<row><entry align="right"><parameter>symbol</parameter>&nbsp;:</entry>
<entry>the symbol to remove.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-scanner-freeze-symbol-table">g_scanner_freeze_symbol_table()</title>
<programlisting>#define     g_scanner_freeze_symbol_table(scanner)</programlisting>
<warning>
<para>
<literal>g_scanner_freeze_symbol_table</literal> is deprecated and should not be used in newly-written code.
</para>
</warning>
<para>
This function is deprecated and will be removed in the next major
release of GLib. It does nothing.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>scanner</parameter>&nbsp;:</entry>
<entry>a <link linkend="GScanner">GScanner</link>.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-scanner-thaw-symbol-table">g_scanner_thaw_symbol_table()</title>
<programlisting>#define     g_scanner_thaw_symbol_table(scanner)</programlisting>
<warning>
<para>
<literal>g_scanner_thaw_symbol_table</literal> is deprecated and should not be used in newly-written code.
</para>
</warning>
<para>
This function is deprecated and will be removed in the next major
release of GLib. It does nothing.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>scanner</parameter>&nbsp;:</entry>
<entry>a <link linkend="GScanner">GScanner</link>.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-scanner-lookup-symbol">g_scanner_lookup_symbol ()</title>
<programlisting><link linkend="gpointer">gpointer</link>    g_scanner_lookup_symbol         (<link linkend="GScanner">GScanner</link> *scanner,
                                             const <link linkend="gchar">gchar</link> *symbol);</programlisting>
<para>
Looks up a symbol in the current scope and return its value. If the
symbol is not bound in the current scope, <literal>NULL</literal> is returned.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>scanner</parameter>&nbsp;:</entry>
<entry>a <link linkend="GScanner">GScanner</link>.
</entry></row>
<row><entry align="right"><parameter>symbol</parameter>&nbsp;:</entry>
<entry>the symbol to look up.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the value of <parameter>symbol</parameter> in the current scope, or <literal>NULL</literal>
if <parameter>symbol</parameter> is not bound in the current scope.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-scanner-warn">g_scanner_warn ()</title>
<programlisting>void        g_scanner_warn                  (<link linkend="GScanner">GScanner</link> *scanner,
                                             const <link linkend="gchar">gchar</link> *format,
                                             ...);</programlisting>
<para>
Outputs a warning message, via the <link linkend="GScanner">GScanner</link> message handler.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>scanner</parameter>&nbsp;:</entry>
<entry>a <link linkend="GScanner">GScanner</link>.
</entry></row>
<row><entry align="right"><parameter>format</parameter>&nbsp;:</entry>
<entry>the message format. See the <function>printf()</function>
documentation.
</entry></row>
<row><entry align="right"><parameter>...</parameter>&nbsp;:</entry>
<entry>the parameters to insert into the format string.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-scanner-error">g_scanner_error ()</title>
<programlisting>void        g_scanner_error                 (<link linkend="GScanner">GScanner</link> *scanner,
                                             const <link linkend="gchar">gchar</link> *format,
                                             ...);</programlisting>
<para>
Outputs an error message, via the <link linkend="GScanner">GScanner</link> message handler.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>scanner</parameter>&nbsp;:</entry>
<entry>a <link linkend="GScanner">GScanner</link>.
</entry></row>
<row><entry align="right"><parameter>format</parameter>&nbsp;:</entry>
<entry>the message format. See the <function>printf()</function>
documentation.
</entry></row>
<row><entry align="right"><parameter>...</parameter>&nbsp;:</entry>
<entry>the parameters to insert into the format string.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-scanner-unexp-token">g_scanner_unexp_token ()</title>
<programlisting>void        g_scanner_unexp_token           (<link linkend="GScanner">GScanner</link> *scanner,
                                             <link linkend="GTokenType">GTokenType</link> expected_token,
                                             const <link linkend="gchar">gchar</link> *identifier_spec,
                                             const <link linkend="gchar">gchar</link> *symbol_spec,
                                             const <link linkend="gchar">gchar</link> *symbol_name,
                                             const <link linkend="gchar">gchar</link> *message,
                                             <link linkend="gint">gint</link> is_error);</programlisting>
<para>
Outputs a message through the scanner's msg_handler, resulting from an
unexpected token in the input stream.
Note that you should not call <link linkend="g-scanner-peek-next-token">g_scanner_peek_next_token</link>() followed by
<link linkend="g-scanner-unexp-token">g_scanner_unexp_token</link>() without an intermediate call to
<link linkend="g-scanner-get-next-token">g_scanner_get_next_token</link>(), as <link linkend="g-scanner-unexp-token">g_scanner_unexp_token</link>() evaluates the
scanner's current token (not the peeked token) to construct part
of the message.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>scanner</parameter>&nbsp;:</entry>
<entry>a <link linkend="GScanner">GScanner</link>.
</entry></row>
<row><entry align="right"><parameter>expected_token</parameter>&nbsp;:</entry>
<entry>the expected token.
</entry></row>
<row><entry align="right"><parameter>identifier_spec</parameter>&nbsp;:</entry>
<entry>a string describing how the scanner's user refers to
                  identifiers (<literal>NULL</literal> defaults to "identifier").
                  This is used if <parameter>expected_token</parameter> is <link linkend="G-TOKEN-IDENTIFIER-CAPS">G_TOKEN_IDENTIFIER</link>
                  or <link linkend="G-TOKEN-IDENTIFIER-NULL-CAPS">G_TOKEN_IDENTIFIER_NULL</link>.
</entry></row>
<row><entry align="right"><parameter>symbol_spec</parameter>&nbsp;:</entry>
<entry>a string describing how the scanner's user refers to
              symbols (<literal>NULL</literal> defaults to "symbol").
              This is used if <parameter>expected_token</parameter> is <link linkend="G-TOKEN-SYMBOL-CAPS">G_TOKEN_SYMBOL</link> or
              any token value greater than <link linkend="G-TOKEN-LAST-CAPS">G_TOKEN_LAST</link>.
</entry></row>
<row><entry align="right"><parameter>symbol_name</parameter>&nbsp;:</entry>
<entry>the name of the symbol, if the scanner's current token
              is a symbol.
</entry></row>
<row><entry align="right"><parameter>message</parameter>&nbsp;:</entry>
<entry>a message string to output at the end of the warning/error, or <literal>NULL</literal>.
</entry></row>
<row><entry align="right"><parameter>is_error</parameter>&nbsp;:</entry>
<entry>if <literal>TRUE</literal> it is output as an error. If <literal>FALSE</literal> it is output as a
           warning.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="GScannerMsgFunc">GScannerMsgFunc ()</title>
<programlisting>void        (*GScannerMsgFunc)              (<link linkend="GScanner">GScanner</link> *scanner,
                                             <link linkend="gchar">gchar</link> *message,
                                             <link linkend="gboolean">gboolean</link> error);</programlisting>
<para>
Specifies the type of the message handler function.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>scanner</parameter>&nbsp;:</entry>
<entry>a <link linkend="GScanner">GScanner</link>.
</entry></row>
<row><entry align="right"><parameter>message</parameter>&nbsp;:</entry>
<entry>the message.
</entry></row>
<row><entry align="right"><parameter>error</parameter>&nbsp;:</entry>
<entry><literal>TRUE</literal> if the message signals an error, <literal>FALSE</literal> if it 
  signals a warning.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-scanner-destroy">g_scanner_destroy ()</title>
<programlisting>void        g_scanner_destroy               (<link linkend="GScanner">GScanner</link> *scanner);</programlisting>
<para>
Frees all memory used by the <link linkend="GScanner">GScanner</link>.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>scanner</parameter>&nbsp;:</entry>
<entry>a <link linkend="GScanner">GScanner</link>.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="GTokenType">enum GTokenType</title>
<programlisting>typedef enum
{
  G_TOKEN_EOF			=   0,
  
  G_TOKEN_LEFT_PAREN		= '(',
  G_TOKEN_RIGHT_PAREN		= ')',
  G_TOKEN_LEFT_CURLY		= '{',
  G_TOKEN_RIGHT_CURLY		= '}',
  G_TOKEN_LEFT_BRACE		= '[',
  G_TOKEN_RIGHT_BRACE		= ']',
  G_TOKEN_EQUAL_SIGN		= '=',
  G_TOKEN_COMMA			= ',',
  
  G_TOKEN_NONE			= 256,
  
  G_TOKEN_ERROR,
  
  G_TOKEN_CHAR,
  G_TOKEN_BINARY,
  G_TOKEN_OCTAL,
  G_TOKEN_INT,
  G_TOKEN_HEX,
  G_TOKEN_FLOAT,
  G_TOKEN_STRING,
  
  G_TOKEN_SYMBOL,
  G_TOKEN_IDENTIFIER,
  G_TOKEN_IDENTIFIER_NULL,
  
  G_TOKEN_COMMENT_SINGLE,
  G_TOKEN_COMMENT_MULTI,
  G_TOKEN_LAST
} GTokenType;
</programlisting>
<para>
The possible types of token returned from each <link linkend="g-scanner-get-next-token">g_scanner_get_next_token</link>() call.
</para><informaltable pgwide="1" frame="none" role="enum">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row>
<entry><literal>G_TOKEN_EOF</literal></entry>
<entry>the end of the file.
</entry>
</row>
<row>
<entry><literal>G_TOKEN_LEFT_PAREN</literal></entry>
<entry>a '(' character.
</entry>
</row>
<row>
<entry><literal>G_TOKEN_LEFT_CURLY</literal></entry>
<entry>a '{' character.
</entry>
</row>
<row>
<entry><literal>G_TOKEN_RIGHT_CURLY</literal></entry>
<entry>a '}' character.

</entry>
</row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="GTokenValue">union GTokenValue</title>
<programlisting>union GTokenValue
{
  gpointer	v_symbol;
  gchar		*v_identifier;
  gulong	v_binary;
  gulong	v_octal;
  gulong	v_int;
  gdouble	v_float;
  gulong	v_hex;
  gchar		*v_string;
  gchar		*v_comment;
  guchar	v_char;
  guint		v_error;
};
</programlisting>
<para>
A union holding the value of the token.
</para></refsect2>
<refsect2>
<title><anchor id="GErrorType">enum GErrorType</title>
<programlisting>typedef enum
{
  G_ERR_UNKNOWN,
  G_ERR_UNEXP_EOF,
  G_ERR_UNEXP_EOF_IN_STRING,
  G_ERR_UNEXP_EOF_IN_COMMENT,
  G_ERR_NON_DIGIT_IN_CONST,
  G_ERR_DIGIT_RADIX,
  G_ERR_FLOAT_RADIX,
  G_ERR_FLOAT_MALFORMED
} GErrorType;
</programlisting>
<para>
The possible errors, used in the <structfield>v_error</structfield> field
of <link linkend="GTokenValue">GTokenValue</link>, when the token is a <link linkend="G-TOKEN-ERROR-CAPS">G_TOKEN_ERROR</link>.
</para><informaltable pgwide="1" frame="none" role="enum">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row>
<entry><literal>G_ERR_UNKNOWN</literal></entry>
<entry>unknown error.
</entry>
</row>
<row>
<entry><literal>G_ERR_UNEXP_EOF</literal></entry>
<entry>unexpected end of file.
</entry>
</row>
<row>
<entry><literal>G_ERR_UNEXP_EOF_IN_STRING</literal></entry>
<entry>unterminated string constant.
</entry>
</row>
<row>
<entry><literal>G_ERR_UNEXP_EOF_IN_COMMENT</literal></entry>
<entry>unterminated comment.
</entry>
</row>
<row>
<entry><literal>G_ERR_NON_DIGIT_IN_CONST</literal></entry>
<entry>non-digit character in a number.
</entry>
</row>
<row>
<entry><literal>G_ERR_DIGIT_RADIX</literal></entry>
<entry>digit beyond radix in a number.
</entry>
</row>
<row>
<entry><literal>G_ERR_FLOAT_RADIX</literal></entry>
<entry>non-decimal floating point number.
</entry>
</row>
<row>
<entry><literal>G_ERR_FLOAT_MALFORMED</literal></entry>
<entry>malformed floating point number.

</entry>
</row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="G-CSET-a-2-z">G_CSET_a_2_z</title>
<programlisting>#define G_CSET_a_2_z	"abcdefghijklmnopqrstuvwxyz"
</programlisting>
<para>
The set of lowercase ASCII alphabet characters.
Used for specifying valid identifier characters in <link linkend="GScannerConfig">GScannerConfig</link>.
</para></refsect2>
<refsect2>
<title><anchor id="G-CSET-A-2-Z-CAPS">G_CSET_A_2_Z</title>
<programlisting>#define G_CSET_A_2_Z	"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
</programlisting>
<para>
The set of uppercase ASCII alphabet characters.
Used for specifying valid identifier characters in <link linkend="GScannerConfig">GScannerConfig</link>.
</para></refsect2>
<refsect2>
<title><anchor id="G-CSET-DIGITS-CAPS">G_CSET_DIGITS</title>
<programlisting>#define G_CSET_DIGITS	"0123456789"
</programlisting>
<para>
The set of digits.
Used for specifying valid identifier characters in <link linkend="GScannerConfig">GScannerConfig</link>.
</para></refsect2>
<refsect2>
<title><anchor id="G-CSET-LATINC-CAPS">G_CSET_LATINC</title>
<programlisting>#define     G_CSET_LATINC</programlisting>
<para>
The set of uppercase ISO 8859-1 alphabet characters which are 
not ASCII characters. 
Used for specifying valid identifier characters in <link linkend="GScannerConfig">GScannerConfig</link>.
</para></refsect2>
<refsect2>
<title><anchor id="G-CSET-LATINS-CAPS">G_CSET_LATINS</title>
<programlisting>#define     G_CSET_LATINS</programlisting>
<para>
The set of lowercase ISO 8859-1 alphabet characters which are 
not ASCII characters. 
Used for specifying valid identifier characters in <link linkend="GScannerConfig">GScannerConfig</link>.
</para></refsect2>
<refsect2>
<title><anchor id="g-scanner-add-symbol">g_scanner_add_symbol()</title>
<programlisting>#define     g_scanner_add_symbol( scanner, symbol, value )</programlisting>
<warning>
<para>
<literal>g_scanner_add_symbol</literal> is deprecated and should not be used in newly-written code.
</para>
</warning>
<para>
Adds a symbol to the default scope.
Deprecated in favour of <link linkend="g-scanner-scope-add-symbol">g_scanner_scope_add_symbol</link>().
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>scanner</parameter>&nbsp;:</entry>
<entry>a <link linkend="GScanner">GScanner</link>.
</entry></row>
<row><entry align="right"><parameter>symbol</parameter>&nbsp;:</entry>
<entry>the symbol to add.
</entry></row>
<row><entry align="right"><parameter>value</parameter>&nbsp;:</entry>
<entry>the value of the symbol.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-scanner-remove-symbol">g_scanner_remove_symbol()</title>
<programlisting>#define     g_scanner_remove_symbol( scanner, symbol )</programlisting>
<warning>
<para>
<literal>g_scanner_remove_symbol</literal> is deprecated and should not be used in newly-written code.
</para>
</warning>
<para>
Removes a symbol from the default scope.
Deprecated in favour of <link linkend="g-scanner-scope-remove-symbol">g_scanner_scope_remove_symbol</link>().
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>scanner</parameter>&nbsp;:</entry>
<entry>a <link linkend="GScanner">GScanner</link>.
</entry></row>
<row><entry align="right"><parameter>symbol</parameter>&nbsp;:</entry>
<entry>the symbol to remove.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-scanner-foreach-symbol">g_scanner_foreach_symbol()</title>
<programlisting>#define     g_scanner_foreach_symbol( scanner, func, data )</programlisting>
<warning>
<para>
<literal>g_scanner_foreach_symbol</literal> is deprecated and should not be used in newly-written code.
</para>
</warning>
<para>
Calls a function for each symbol in the default scope.
Deprecated in favour of <link linkend="g-scanner-scope-foreach-symbol">g_scanner_scope_foreach_symbol</link>().
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>scanner</parameter>&nbsp;:</entry>
<entry>a <link linkend="GScanner">GScanner</link>.
</entry></row>
<row><entry align="right"><parameter>func</parameter>&nbsp;:</entry>
<entry>the function to call with each symbol.
</entry></row>
<row><entry align="right"><parameter>data</parameter>&nbsp;:</entry>
<entry>data to pass to the function.


</entry></row>
</tbody></tgroup></informaltable></refsect2>

</refsect1>




</refentry>
