summaryrefslogtreecommitdiff
path: root/girepository/girwriter.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/girwriter.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/girwriter.c')
-rw-r--r--girepository/girwriter.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/girepository/girwriter.c b/girepository/girwriter.c
index 2cdc9a11..d9f916c5 100644
--- a/girepository/girwriter.c
+++ b/girepository/girwriter.c
@@ -805,6 +805,7 @@ write_enum_info (const gchar *namespace,
const gchar *name;
const gchar *type_name;
const gchar *type_init;
+ const gchar *error_domain;
gboolean deprecated;
gint i;
@@ -813,6 +814,7 @@ write_enum_info (const gchar *namespace,
type_name = g_registered_type_info_get_type_name ((GIRegisteredTypeInfo*)info);
type_init = g_registered_type_info_get_type_init ((GIRegisteredTypeInfo*)info);
+ error_domain = g_enum_info_get_error_domain (info);
if (g_base_info_get_type ((GIBaseInfo *)info) == GI_INFO_TYPE_ENUM)
xml_start_element (file, "enumeration");
@@ -822,6 +824,8 @@ write_enum_info (const gchar *namespace,
if (type_init)
xml_printf (file, " glib:type-name=\"%s\" glib:get-type=\"%s\"", type_name, type_init);
+ if (error_domain)
+ xml_printf (file, " glib:error-domain=\"%s\"", error_domain);
if (deprecated)
xml_printf (file, " deprecated=\"1\"");