iterate_attributes
Description:
public bool iterate_attributes (ref AttributeIter iterator, out unowned string name, out unowned string value)
Iterate over all attributes associated with this node.
The iterator structure is typically stack allocated, and must have its first member initialized to null
. Attributes are arbitrary
namespaced key–value pairs which can be attached to almost any item. They are intended for use by software higher in the toolchain than
bindings, and are distinct from normal GIR annotations.
Both the name
and value
should be treated as constants and must not be freed.
void
print_attributes (GIBaseInfo *info)
{
GIAttributeIter iter = { 0, };
char *name;
char *value;
while (g_base_info_iterate_attributes (info, &iter, &name, &value))
{
g_print ("attribute name: %s value: %s", name, value);
}
}
Parameters:
this |
a BaseInfo |
iterator |
a AttributeIter structure, must be initialized; see below |
name |
Returned name, must not be freed |
value |
Returned name, must not be freed |
Returns:
|