summaryrefslogtreecommitdiff
path: root/girepository/girnode.c
diff options
context:
space:
mode:
authorDavid Zeuthen <davidz@redhat.com>2010-06-15 11:01:37 -0400
committerDavid Zeuthen <davidz@redhat.com>2010-06-24 11:53:18 -0400
commit11cfe386c37ced44a8e3efb5556bde3a43a11171 (patch)
treea01903a4e4596ca80c79abbc8d35c33dc665e526 /girepository/girnode.c
parent751ffa016e410a031028282e63f98a94cc444b7b (diff)
downloadgobject-introspection-11cfe386c37ced44a8e3efb5556bde3a43a11171.tar.gz
Allow attributes on parameters and return values
Any annotation where the key has a dot in the name will go into the attribute list. For example * @arg: (foo.bar baz): some arg the parameter @arg will get the attribute with key foo.bar and value baz. This also works for. * Returns: (foo.bar2 baz2): the return value Also add tests for this new feature. See https://bugzilla.gnome.org/show_bug.cgi?id=571548 Signed-off-by: David Zeuthen <davidz@redhat.com>
Diffstat (limited to 'girepository/girnode.c')
-rw-r--r--girepository/girnode.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/girepository/girnode.c b/girepository/girnode.c
index fbdcdf96..576ac100 100644
--- a/girepository/girnode.c
+++ b/girepository/girnode.c
@@ -1678,6 +1678,14 @@ g_ir_node_build_typelib (GIrNode *node,
blob->symbol = write_string (function->symbol, strings, data, offset2);
blob->signature = signature;
+ /* function->result is special since it doesn't appear in the serialized format but
+ * we do want the attributes for it to appear
+ */
+ build->nodes_with_attributes = g_list_prepend (build->nodes_with_attributes, function->result);
+ build->n_attributes += g_hash_table_size (((GIrNode *) function->result)->attributes);
+ g_assert (((GIrNode *) function->result)->offset == 0);
+ ((GIrNode *) function->result)->offset = signature;
+
g_debug ("building function '%s'", function->symbol);
g_ir_node_build_typelib ((GIrNode *)function->result->type,
@@ -1770,6 +1778,14 @@ g_ir_node_build_typelib (GIrNode *node,
blob->name = write_string (node->name, strings, data, offset2);
blob->signature = signature;
+ /* signal->result is special since it doesn't appear in the serialized format but
+ * we do want the attributes for it to appear
+ */
+ build->nodes_with_attributes = g_list_prepend (build->nodes_with_attributes, signal->result);
+ build->n_attributes += g_hash_table_size (((GIrNode *) signal->result)->attributes);
+ g_assert (((GIrNode *) signal->result)->offset == 0);
+ ((GIrNode *) signal->result)->offset = signature;
+
g_ir_node_build_typelib ((GIrNode *)signal->result->type,
node, build, &signature, offset2);