mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-24 14:36:13 +01:00
Bug 564016 - Include c:prefix in typelib, use it to optimize find_by_gtype
Parse the c:prefix from the .gir, include it in the header. Armed with this information, we can now optimize lookups of GTypes because we have the requirement that GTypes must start with the c:prefix. We do fall back though if a lookup fails.
This commit is contained in:
parent
02bb4f8d6a
commit
f979d003ce
@ -1282,16 +1282,20 @@ write_repository (const char *namespace,
|
||||
if (TRUE)
|
||||
{
|
||||
const gchar *shared_library;
|
||||
const gchar *c_prefix;
|
||||
const char *ns = namespace;
|
||||
const char *version;
|
||||
|
||||
version = g_irepository_get_version (repository, ns);
|
||||
|
||||
shared_library = g_irepository_get_shared_library (repository, ns);
|
||||
c_prefix = g_irepository_get_c_prefix (repository, ns);
|
||||
xml_start_element (xml, "namespace");
|
||||
xml_printf (xml, " name=\"%s\" version=\"%s\"", ns, version);
|
||||
if (shared_library)
|
||||
xml_printf (xml, " shared-library=\"%s\"", shared_library);
|
||||
if (c_prefix)
|
||||
xml_printf (xml, " c:prefix=\"%s\"", c_prefix);
|
||||
|
||||
for (j = 0; j < g_irepository_get_n_infos (repository, ns); j++)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user