1 /* GObject introspection: gen-introspect
3 * Copyright (C) 2007 Jürg Billeter
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
21 * Jürg Billeter <j@bitron.ch>
24 #ifndef __GEN_INTROSPECT_H__
25 #define __GEN_INTROSPECT_H__
28 #include "gidlmodule.h"
30 G_BEGIN_DECLS
typedef struct _GIGenerator GIGenerator
;
31 typedef struct _CSymbol CSymbol
;
32 typedef struct _CType CType
;
33 typedef struct _CDirective CDirective
;
40 char *lower_case_namespace
;
43 /* specified files to be parsed */
45 /* source reference of current lexer position */
46 char *current_filename
;
48 GHashTable
*typedef_table
;
49 GHashTable
*struct_or_union_or_enum_table
;
52 GList
*get_type_symbols
;
54 GHashTable
*type_by_lower_case_prefix
;
56 GHashTable
*symbols
; /* typename -> module.name */
58 /* scanner variables */
60 GSList
*directives
; /* list of CDirective for the current symbol */
68 CSYMBOL_TYPE_FUNCTION
,
81 gboolean const_int_set
;
84 GSList
*directives
; /* list of CDirective */
103 STORAGE_CLASS_NONE
= 0,
104 STORAGE_CLASS_TYPEDEF
= 1 << 1,
105 STORAGE_CLASS_EXTERN
= 1 << 2,
106 STORAGE_CLASS_STATIC
= 1 << 3,
107 STORAGE_CLASS_AUTO
= 1 << 4,
108 STORAGE_CLASS_REGISTER
= 1 << 5
109 } StorageClassSpecifier
;
113 TYPE_QUALIFIER_NONE
= 0,
114 TYPE_QUALIFIER_CONST
= 1 << 1,
115 TYPE_QUALIFIER_RESTRICT
= 1 << 2,
116 TYPE_QUALIFIER_VOLATILE
= 1 << 3
122 FUNCTION_INLINE
= 1 << 1
128 UNARY_POINTER_INDIRECTION
,
131 UNARY_BITWISE_COMPLEMENT
,
132 UNARY_LOGICAL_NEGATION
138 StorageClassSpecifier storage_class_specifier
;
139 TypeQualifier type_qualifier
;
140 FunctionSpecifier function_specifier
;
151 CSymbol
* csymbol_new (CSymbolType type
);
152 gboolean
csymbol_get_const_boolean (CSymbol
*symbol
);
153 void csymbol_free (CSymbol
*symbol
);
154 CDirective
* cdirective_new (const gchar
*name
,
156 void cdirective_free (CDirective
*directive
);
158 gboolean
g_igenerator_parse_file (GIGenerator
*igenerator
,
160 void g_igenerator_set_verbose (GIGenerator
*igenerator
,
162 void g_igenerator_add_symbol (GIGenerator
*igenerator
,
164 gboolean
g_igenerator_is_typedef (GIGenerator
*igenerator
,