Type Info

G-Golf Type Info low level API.
GITypeInfo — Struct representing a type.

Procedures

g-info-type-to-string
g-type-info-is-pointer
g-type-info-get-tag
g-type-info-get-param-type
g-type-info-get-interface
g-type-info-get-array-length
g-type-info-get-array-fixed-size
g-type-info-is-zero-terminated
g-type-info-get-array-type

Struct Hierarchy

GIBaseInfoInfo
  +— GITypeInfo

Description

GITypeInfo represents a type. You can retrieve a type info from an argument (see Arg Info), a functions return value (see Function Info), a field (see GIFieldInfo), a property (see Property Info), 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.

Procedures

Note: in this section, the info argument is [must be] a pointer to a GITypeInfo.

Procedure: g-info-type-to-string info-type

Returns a string or #f.

Obtains the string representation for info-type or #f if it does not exists.

info-type can either be a symbol or an id, a member of the enum-set of %gi-info-type (otherwise, #f is returned).

Procedure: g-type-info-is-pointer info

Returns #t or #f.

Obtains if the info type is passed as a reference.

Note that the types of out and inout parameters (see %gi-direction) 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).

Procedure: g-type-info-get-tag info

Returns a symbol.

Obtains the type tag for info (see %gi-type-tag for the list of type tags).

Procedure: g-type-info-get-param-type info n

Returns a pointer or #f.

Obtains the parameter type n (the index of the parameter). When there is no such n parameter, the procedure returns #f.

Procedure: g-type-info-get-interface info

Returns a pointer or #f.

For interface types (see %gi-type-tag) such as GObjects and boxed values, this procedure returns a (pointer to a) GIBaseInfo, holding 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.

Procedure: g-type-info-get-array-length info

Returns an interger.

Obtain the array length of the type. The type tag must be a array (see %gi-type-tag), or -1 will returned.

Procedure: g-type-info-get-array-fixed-size info

Returns an interger.

Obtain the fixed array syze of the type. The type tag must be a array (see %gi-type-tag), or -1 will returned.

Procedure: g-type-info-is-zero-terminated info

Returns #t or #f.

Obtains if the last element of the array is NULL. The type tag must be a array (see %gi-type-tag), or #f will returned.

Procedure: g-type-info-get-array-type info

Returns a symbol or #f.

Obtain the array type for this type (see %gi-array-type). If the type tag of this type is not array, #f will be returned.