summaryrefslogtreecommitdiff
path: root/girepository/girparser.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/girparser.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/girparser.c')
-rw-r--r--girepository/girparser.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/girepository/girparser.c b/girepository/girparser.c
index 4e552725..c9b7d629 100644
--- a/girepository/girparser.c
+++ b/girepository/girparser.c
@@ -1332,6 +1332,7 @@ start_enum (GMarkupParseContext *context,
const gchar *typename;
const gchar *typeinit;
const gchar *deprecated;
+ const gchar *error_domain;
GIrNodeEnum *enum_;
if (!((strcmp (element_name, "enumeration") == 0 && ctx->state == STATE_NAMESPACE) ||
@@ -1344,6 +1345,7 @@ start_enum (GMarkupParseContext *context,
name = find_attribute ("name", attribute_names, attribute_values);
typename = find_attribute ("glib:type-name", attribute_names, attribute_values);
typeinit = find_attribute ("glib:get-type", attribute_names, attribute_values);
+ error_domain = find_attribute ("glib:error-domain", attribute_names, attribute_values);
deprecated = find_attribute ("deprecated", attribute_names, attribute_values);
if (name == NULL)
@@ -1361,6 +1363,8 @@ start_enum (GMarkupParseContext *context,
((GIrNode *)enum_)->name = g_strdup (name);
enum_->gtype_name = g_strdup (typename);
enum_->gtype_init = g_strdup (typeinit);
+ enum_->error_domain = g_strdup (error_domain);
+
if (deprecated)
enum_->deprecated = TRUE;
else