GITypeInfo

GITypeInfo — Struct representing a type

Functions

Types and Values

typedef GITypeInfo

Description

GITypeInfo represents a type.

You can retrieve a type info from an argument (see GIArgInfo), a functions return value (see GIFunctionInfo), a field (see GIFieldInfo), a property (see GIPropertyInfo), a constant (see GIConstantInfo) or for a union discriminator (see GIUnionInfo).

A type can either be a of a basic type which is a standard C primitive type or an interface type. For interface types you need to call g_type_info_get_interface() to get a reference to the base info for that interface.

Functions

GI_IS_TYPE_INFO()

#define             GI_IS_TYPE_INFO(info)

Checks if info is a GITypeInfo.

Parameters

info

an info structure

 

g_type_info_is_pointer ()

gboolean
g_type_info_is_pointer (GITypeInfo *info);

Obtain if the type is passed as a reference.

Note that the types of GI_DIRECTION_OUT and GI_DIRECTION_INOUT parameters will only be pointers if the underlying type being transferred is a pointer (i.e. only if the type of the C function’s formal parameter is a pointer to a pointer).

Parameters

info

a GITypeInfo

 

Returns

TRUE if it is a pointer


g_type_info_get_tag ()

GITypeTag
g_type_info_get_tag (GITypeInfo *info);

Obtain the type tag for the type. See GITypeTag for a list of type tags.

Parameters

info

a GITypeInfo

 

Returns

the type tag


g_type_info_get_param_type ()

GITypeInfo *
g_type_info_get_param_type (GITypeInfo *info,
                            gint n);

Obtain the parameter type n .

Parameters

info

a GITypeInfo

 

n

index of the parameter

 

Returns

the param type info.

[transfer full]


g_type_info_get_interface ()

GIBaseInfo *
g_type_info_get_interface (GITypeInfo *info);

For types which have GI_TYPE_TAG_INTERFACE such as GObjects and boxed values, this function returns full information about the referenced type. You can then inspect the type of the returned GIBaseInfo to further query whether it is a concrete GObject, a GInterface, a structure, etc. using g_base_info_get_type().

Parameters

info

a GITypeInfo

 

Returns

the GIBaseInfo, or NULL. Free it with g_base_info_unref() when done.

[transfer full]


g_type_info_get_array_length ()

gint
g_type_info_get_array_length (GITypeInfo *info);

Obtain the position of the argument which gives the array length of the type. The type tag must be a GI_TYPE_TAG_ARRAY or -1 will be returned.

Parameters

info

a GITypeInfo

 

Returns

the array length, or -1 if the type is not an array


g_type_info_get_array_fixed_size ()

gint
g_type_info_get_array_fixed_size (GITypeInfo *info);

Obtain the fixed array size of the type. The type tag must be a GI_TYPE_TAG_ARRAY or -1 will be returned.

Parameters

info

a GITypeInfo

 

Returns

the size or -1 if it's not an array


g_type_info_is_zero_terminated ()

gboolean
g_type_info_is_zero_terminated (GITypeInfo *info);

Obtain if the last element of the array is NULL. The type tag must be a GI_TYPE_TAG_ARRAY or FALSE will be returned.

Parameters

info

a GITypeInfo

 

Returns

TRUE if zero terminated


g_type_info_get_array_type ()

GIArrayType
g_type_info_get_array_type (GITypeInfo *info);

Obtain the array type for this type. See GIArrayType for a list of possible values. If the type tag of this type is not array, -1 will be returned.

Parameters

info

a GITypeInfo

 

Returns

the array type or -1

Types and Values

GITypeInfo

typedef GIBaseInfo GITypeInfo;

Represents type information, direction, transfer etc.