Union Info

G-Golf Union Info low level API.
GIUnionInfo — Struct representing a C union.

Procedures

g-union-info-get-n-fields
g-union-info-get-field
g-union-info-get-n-methods
g-union-info-get-method
g-union-info-is-discriminated?
g-union-info-get-discriminator-offset
g-union-info-get-discriminator-type
g-union-info-get-discriminator
g-union-info-get-size
g-union-info-get-alignment

Description

GIUnionInfo represents a union type.

A union has methods and fields. Unions can optionally have a discriminator, which is a field deciding what type of real union fields is valid for specified instance.

Struct Hierarchy

GIBaseInfo
  +— GIRegisteredTypeInfo
            +— GIUnionInfo

Procedures

Note: in this section, unless otherwise specified, the info argument is [must be] a pointer to a GIUnionInfo.

Procedure: g-union-info-get-n-fields info

Returns an integer.

Obtains and returns the number of fields the info union has.

Procedure: g-union-info-get-field info n

Returns a pointer.

Obtains and returns a pointer to the GIFieldInfo for info, given its n. The GIFieldInfo must be free’d by calling g-base-info-unref when done.

Procedure: g-union-info-get-n-methods info

Returns an integer.

Obtains and returns the number of methods the info union has.

Procedure: g-union-info-get-method info n

Returns a pointer.

Obtains and returns a pointer to the GIFunctionInfo for info, given its n, which must be free’d by calling g-base-info-unref when done.

Procedure: g-union-info-is-discriminated? info

Returns #t if info contains a discriminator field, otherwise it returns #f.

Procedure: g-union-info-get-discriminator-offset info

Returns an integer.

Obtains and returns the offset of the discriminator field for info.

Procedure: g-union-info-get-discriminator-type info

Returns a pointer.

Obtains and returns a pointer to the GITypeInfo for info, which must be free’d by calling g-base-info-unref when done.

Procedure: g-union-info-get-discriminator info n

Returns a pointer.

Obtains and returns a pointer to the GIConstantInfo assigned for the info n-th union field - i.e. the n-th union field is the active one if discriminator contains this constant (value) - which must be free’d by calling g-base-info-unref when done.

Procedure: g-union-info-get-size info

Returns an integer.

Obtains and returns the total size of the union specified by info.

Procedure: g-union-info-get-alignment info

Returns an integer.

Obtains and returns the required alignment for info.