mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-11 23:16:14 +01:00
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
This commit is contained in:
parent
4043597a94
commit
582a675584
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user