mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-27 14:36:16 +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;
|
GOptionContext *context;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
GIrParser *parser;
|
||||||
GList *m, *modules;
|
GList *m, *modules;
|
||||||
gint i;
|
gint i;
|
||||||
g_typelib_check_sanity ();
|
g_typelib_check_sanity ();
|
||||||
@ -203,11 +204,15 @@ main (int argc, char ** argv)
|
|||||||
for (i = 0; includedirs[i]; i++)
|
for (i = 0; includedirs[i]; i++)
|
||||||
g_irepository_prepend_search_path (includedirs[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;
|
modules = NULL;
|
||||||
for (i = 0; input[i]; i++)
|
for (i = 0; input[i]; i++)
|
||||||
{
|
{
|
||||||
GList *mods;
|
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)
|
if (mods == NULL)
|
||||||
{
|
{
|
||||||
@ -272,5 +277,10 @@ main (int argc, char ** argv)
|
|||||||
|
|
||||||
g_debug ("[building] done");
|
g_debug ("[building] done");
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
/* No point */
|
||||||
|
g_ir_parser_free (parser);
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user