summaryrefslogtreecommitdiff
path: root/girepository/girnode.c
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2011-05-19 16:21:13 -0400
committerDan Winship <danw@gnome.org>2011-08-12 11:10:43 -0400
commit5fd2fa5bf5a07a66d2150740d534a398598e8dd1 (patch)
treed40cb5a96e53cd518c8a00e14855bf6196fcf03b /girepository/girnode.c
parent4dabe20ed5753bccd2abf8ad02e95ce6ab53036c (diff)
downloadgobject-introspection-5fd2fa5bf5a07a66d2150740d534a398598e8dd1.tar.gz
Switch to storing string form of error quarks
Instead of storing the name of the function to call to get the error quark, store the string form of the error quark, which we derive from the introspection binary during scanning. Update EnumBlob and GIEnumInfo to include the new information. This will allow determining a back-mapping from error quark to error domain without having to dlsym() and call all the known error quark functions. Based on earlier patches from Owen Taylor and Maxim Ermilov. https://bugzilla.gnome.org/show_bug.cgi?id=602516
Diffstat (limited to 'girepository/girnode.c')
-rw-r--r--girepository/girnode.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/girepository/girnode.c b/girepository/girnode.c
index 1c51bfd4..166ca30a 100644
--- a/girepository/girnode.c
+++ b/girepository/girnode.c
@@ -328,6 +328,7 @@ _g_ir_node_free (GIrNode *node)
g_free (node->name);
g_free (enum_->gtype_name);
g_free (enum_->gtype_init);
+ g_free (enum_->error_domain);
for (l = enum_->values; l; l = l->next)
_g_ir_node_free ((GIrNode *)l->data);
@@ -712,6 +713,8 @@ _g_ir_node_get_full_size_internal (GIrNode *parent,
size += ALIGN_VALUE (strlen (enum_->gtype_name) + 1, 4);
size += ALIGN_VALUE (strlen (enum_->gtype_init) + 1, 4);
}
+ if (enum_->error_domain)
+ size += ALIGN_VALUE (strlen (enum_->error_domain) + 1, 4);
for (l = enum_->values; l; l = l->next)
size += _g_ir_node_get_full_size_internal (node, (GIrNode *)l->data);
@@ -2021,6 +2024,10 @@ _g_ir_node_build_typelib (GIrNode *node,
blob->gtype_name = 0;
blob->gtype_init = 0;
}
+ if (enum_->error_domain)
+ blob->error_domain = _g_ir_write_string (enum_->error_domain, strings, data, offset2);
+ else
+ blob->error_domain = 0;
blob->n_values = 0;
blob->reserved2 = 0;