mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-30 20:33:08 +02:00
Fix --includedir handling
* tests/scanner/Makefile.am: Pass the right --includedir args. Add a Makefile dep. * tools/compiler.c: Pass includedirs down. * girepository/girparser.c: Actually put includedirs in context, pass down. Fix locate_gir. svn path=/trunk/; revision=514
This commit is contained in:
parent
7fd9cd094d
commit
b31a2ae395
25
girparser.c
25
girparser.c
@ -68,7 +68,7 @@ struct _ParseContext
|
|||||||
ParseState state;
|
ParseState state;
|
||||||
ParseState prev_state;
|
ParseState prev_state;
|
||||||
|
|
||||||
const char **includes;
|
const char * const*includes;
|
||||||
|
|
||||||
GList *modules;
|
GList *modules;
|
||||||
gboolean prefix_aliases;
|
gboolean prefix_aliases;
|
||||||
@ -126,7 +126,7 @@ static GMarkupParser firstpass_parser =
|
|||||||
};
|
};
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
locate_gir (const char *name, const char **extra_paths)
|
locate_gir (const char *name, const char * const* extra_paths)
|
||||||
{
|
{
|
||||||
const gchar *const *datadirs;
|
const gchar *const *datadirs;
|
||||||
const gchar *const *dir;
|
const gchar *const *dir;
|
||||||
@ -146,11 +146,14 @@ locate_gir (const char *name, const char **extra_paths)
|
|||||||
return path;
|
return path;
|
||||||
g_free (path);
|
g_free (path);
|
||||||
path = NULL;
|
path = NULL;
|
||||||
if (firstpass && !*dir)
|
}
|
||||||
{
|
for (dir = extra_paths; *dir; dir++)
|
||||||
firstpass = FALSE;
|
{
|
||||||
dir = extra_paths;
|
path = g_build_filename (*dir, girname, NULL);
|
||||||
}
|
if (g_file_test (path, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR))
|
||||||
|
return path;
|
||||||
|
g_free (path);
|
||||||
|
path = NULL;
|
||||||
}
|
}
|
||||||
g_free (girname);
|
g_free (girname);
|
||||||
return path;
|
return path;
|
||||||
@ -1968,6 +1971,7 @@ parse_include (GMarkupParseContext *context,
|
|||||||
g_free (girpath);
|
g_free (girpath);
|
||||||
|
|
||||||
sub_ctx.state = STATE_START;
|
sub_ctx.state = STATE_START;
|
||||||
|
sub_ctx.includes = ctx->includes;
|
||||||
sub_ctx.prefix_aliases = TRUE;
|
sub_ctx.prefix_aliases = TRUE;
|
||||||
sub_ctx.namespace = name;
|
sub_ctx.namespace = name;
|
||||||
sub_ctx.aliases = ctx->aliases;
|
sub_ctx.aliases = ctx->aliases;
|
||||||
@ -2630,7 +2634,8 @@ static GMarkupParser parser =
|
|||||||
};
|
};
|
||||||
|
|
||||||
GList *
|
GList *
|
||||||
g_ir_parse_string (const char *namespace,
|
g_ir_parse_string (const gchar *namespace,
|
||||||
|
const gchar *const *includes,
|
||||||
const gchar *buffer,
|
const gchar *buffer,
|
||||||
gssize length,
|
gssize length,
|
||||||
GError **error)
|
GError **error)
|
||||||
@ -2639,6 +2644,7 @@ g_ir_parse_string (const char *namespace,
|
|||||||
GMarkupParseContext *context;
|
GMarkupParseContext *context;
|
||||||
|
|
||||||
ctx.state = STATE_START;
|
ctx.state = STATE_START;
|
||||||
|
ctx.includes = includes;
|
||||||
ctx.prefix_aliases = FALSE;
|
ctx.prefix_aliases = FALSE;
|
||||||
ctx.namespace = namespace;
|
ctx.namespace = namespace;
|
||||||
ctx.aliases = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
|
ctx.aliases = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
|
||||||
@ -2672,6 +2678,7 @@ g_ir_parse_string (const char *namespace,
|
|||||||
|
|
||||||
GList *
|
GList *
|
||||||
g_ir_parse_file (const gchar *filename,
|
g_ir_parse_file (const gchar *filename,
|
||||||
|
const gchar *const *includes,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
gchar *buffer;
|
gchar *buffer;
|
||||||
@ -2701,7 +2708,7 @@ g_ir_parse_file (const gchar *filename,
|
|||||||
if (!g_file_get_contents (filename, &buffer, &length, error))
|
if (!g_file_get_contents (filename, &buffer, &length, error))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
modules = g_ir_parse_string (namespace, buffer, length, error);
|
modules = g_ir_parse_string (namespace, includes, buffer, length, error);
|
||||||
|
|
||||||
g_free (namespace);
|
g_free (namespace);
|
||||||
|
|
||||||
|
@ -27,9 +27,11 @@ G_BEGIN_DECLS
|
|||||||
|
|
||||||
|
|
||||||
GList *g_ir_parse_string (const gchar *buffer,
|
GList *g_ir_parse_string (const gchar *buffer,
|
||||||
|
const gchar *const *includes,
|
||||||
gssize length,
|
gssize length,
|
||||||
GError **error);
|
GError **error);
|
||||||
GList *g_ir_parse_file (const gchar *filename,
|
GList *g_ir_parse_file (const gchar *filename,
|
||||||
|
const gchar *const *includes,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user