summaryrefslogtreecommitdiff
path: root/girepository/girparser.c
diff options
context:
space:
mode:
authorLaszlo Pandy <lpandy@src.gnome.org>2011-02-22 16:02:12 +0100
committerLaszlo Pandy <lpandy@src.gnome.org>2011-02-23 13:55:04 +0100
commited94a687d874c655386bcef662eb659aaca83ac5 (patch)
tree3fb3e3ba5ac424cb81ccf9ea49c1dc92fca8eea5 /girepository/girparser.c
parent3fe4ad82003a5472c44585627f86e5883772acca (diff)
downloadgobject-introspection-ed94a687d874c655386bcef662eb659aaca83ac5.tar.gz
Add "c:identifier" attribute to GIrNodeValue (for flags and enum values).GOBJECT_INTROSPECTION_0_10_3
Flags and enums with a GType have a value_nick and value_name strings available in the class struct. But for flags and enums without GType, we need to get this information from introspection. g_base_info_get_name() gives the string for value_nick. In the GIR, the attribute "c:identifier" is the string neede for value_name. This patch adds the "c:identifier" from GIR to the typelib for all flags and enum values. It can be retireved using g_base_info_get_attribute(info, "c:identifier"). https://bugzilla.gnome.org/show_bug.cgi?id=642757
Diffstat (limited to 'girepository/girparser.c')
-rw-r--r--girepository/girparser.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/girepository/girparser.c b/girepository/girparser.c
index be74e0bb..e32acc0d 100644
--- a/girepository/girparser.c
+++ b/girepository/girparser.c
@@ -1480,6 +1480,7 @@ start_member (GMarkupParseContext *context,
const gchar *name;
const gchar *value;
const gchar *deprecated;
+ const gchar *c_identifier;
GIrNodeEnum *enum_;
GIrNodeValue *value_;
@@ -1490,6 +1491,7 @@ start_member (GMarkupParseContext *context,
name = find_attribute ("name", attribute_names, attribute_values);
value = find_attribute ("value", attribute_names, attribute_values);
deprecated = find_attribute ("deprecated", attribute_names, attribute_values);
+ c_identifier = find_attribute ("c:identifier", attribute_names, attribute_values);
if (name == NULL)
{
@@ -1509,6 +1511,10 @@ start_member (GMarkupParseContext *context,
else
value_->deprecated = FALSE;
+ g_hash_table_insert (((GIrNode *)value_)->attributes,
+ g_strdup ("c:identifier"),
+ g_strdup (c_identifier));
+
enum_ = (GIrNodeEnum *)CURRENT_NODE (ctx);
enum_->values = g_list_append (enum_->values, value_);