diff options
author | Owen Taylor <otaylor@src.gnome.org> | 2008-11-12 17:16:42 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2008-11-12 17:16:42 +0000 |
commit | f072e4cfc30880ab88887afaa5df936c45922305 (patch) | |
tree | d1da1126ed92d51c69a92399023658137dc64f46 /tools | |
parent | 149c68605af0f255857182a973791dbc613c1bd4 (diff) | |
download | gobject-introspection-f072e4cfc30880ab88887afaa5df936c45922305.tar.gz |
Add a GirParser object to hold the state of a compilation
Add a toplevel GirParser object to hold state that is global across
a compilation. Currently just holds the include path, but will
eventually also keep a cached list of parsed modules.
svn path=/trunk/; revision=901
Diffstat (limited to 'tools')
-rw-r--r-- | tools/compiler.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tools/compiler.c b/tools/compiler.c index 50ba37e3..69b49bd8 100644 --- a/tools/compiler.c +++ b/tools/compiler.c @@ -169,6 +169,7 @@ main (int argc, char ** argv) { GOptionContext *context; GError *error = NULL; + GIrParser *parser; GList *m, *modules; gint i; g_typelib_check_sanity (); @@ -203,11 +204,15 @@ main (int argc, char ** argv) for (i = 0; includedirs[i]; i++) g_irepository_prepend_search_path (includedirs[i]); + parser = g_ir_parser_new (); + + g_ir_parser_set_includes (parser, (const char*const*) includedirs); + modules = NULL; for (i = 0; input[i]; i++) { GList *mods; - mods = g_ir_parse_file (input[i], (const char*const*) includedirs, &error); + mods = g_ir_parser_parse_file (parser, input[i], &error); if (mods == NULL) { @@ -272,5 +277,10 @@ main (int argc, char ** argv) g_debug ("[building] done"); +#if 0 + /* No point */ + g_ir_parser_free (parser); +#endif + return 0; } |