Compare two #GIBaseInfo.
Using pointer comparison is not practical since many functions return different instances of #GIBaseInfo that refers to the same part of the TypeLib; use this function instead to do #GIBaseInfo comparisons.
a #GIBaseInfo
Retrieve an arbitrary attribute associated with this node.
a freeform string naming an attribute
Obtain the container of the info
. The container is the parent
GIBaseInfo. For instance, the parent of a #GIFunctionInfo is an
#GIObjectInfo or #GIInterfaceInfo.
Obtain the name of the info
. What the name represents depends on
the #GIInfoType of the info
. For instance for #GIFunctionInfo it is
the name of the function.
Obtain the namespace of info
.
Obtain the info type of the GIBaseInfo.
Obtain the typelib this info
belongs to
Obtain whether the info
is represents a metadata which is
deprecated or not.
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);
}
}
a #GIAttributeIter structure, must be initialized; see below
GIBaseInfo is the common base struct of all other Info structs accessible through the #GIRepository API.
All info structures can be cast to a #GIBaseInfo, for instance:
Most #GIRepository APIs returning a #GIBaseInfo is actually creating a new struct; in other words, g_base_info_unref() has to be called when done accessing the data.
#GIBaseInfo structuress are normally accessed by calling either g_irepository_find_by_name(), g_irepository_find_by_gtype() or g_irepository_get_info().
Hierarchy
|[ GIBaseInfo +---- GIArgInfo +---- GICallableInfo +---- GIConstantInfo +---- GIFieldInfo +---- GIPropertyInfo +---- GIRegisteredTypeInfo +---- GITypeInfo