mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-21 08:28:53 +02:00
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>
This commit is contained in:
16
girnode.c
16
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);
|
||||
|
||||
|
Reference in New Issue
Block a user