GIStructInfo: GObject Introspection Reference Manual

## GIStructInfo GIStructInfo — Struct representing a C structure |

## Functions

#define | GI_IS_STRUCT_INFO()
gsize | g_struct_info_get_alignment ()
gsize | g_struct_info_get_size ()
gboolean | g_struct_info_is_gtype_struct ()
gboolean | g_struct_info_is_foreign ()
gint | g_struct_info_get_n_fields ()
GIFieldInfo * | g_struct_info_get_field ()
gint | g_struct_info_get_n_methods ()
GIFunctionInfo * | g_struct_info_get_method ()
GIFunctionInfo * | g_struct_info_find_method ()

## Types and Values

typedef | GIStructInfo

## Description

GIStructInfo represents a generic C structure type.

A structure has methods and fields.

## Struct hierarchy

      GIBaseInfo
       +----GIRegisteredTypeInfo
             +----GIStructInfo

## Functions

### GI_IS_STRUCT_INFO()

    #define             GI_IS_STRUCT_INFO(info)

Checks if `info` is a GIStructInfo.

#### Parameters

info | an info structure |

### g_struct_info_get_alignment ()

    gsize
    g_struct_info_get_alignment (GIStructInfo *info);

Obtain the required alignment of the structure.

#### Parameters

info | a GIStructInfo |

#### Returns

required alignment in bytes

### g_struct_info_get_size ()

    gsize
    g_struct_info_get_size (GIStructInfo *info);

Obtain the total size of the structure.

#### Parameters

info | a GIStructInfo |

#### Returns

size of the structure in bytes

### g_struct_info_is_gtype_struct ()

    gboolean
    g_struct_info_is_gtype_struct (GIStructInfo *info);

Return true if this structure represents the "class structure" for some GObject or GInterface. This function is mainly useful to hide this kind of structure from generated public APIs.

#### Parameters

info | a GIStructInfo |

#### Returns

`TRUE` if this is a class struct, `FALSE` otherwise

### g_struct_info_is_foreign ()

    gboolean
    g_struct_info_is_foreign (GIStructInfo *info);

TODO

#### Parameters

info | TODO |

#### Returns

TODO

### g_struct_info_get_n_fields ()

    gint
    g_struct_info_get_n_fields (GIStructInfo *info);

Obtain the number of fields this structure has.

#### Parameters

info | a GIStructInfo |

#### Returns

number of fields

### g_struct_info_get_field ()

    GIFieldInfo *
    g_struct_info_get_field (GIStructInfo *info,
                             gint n);

Obtain the type information for field with specified index.

#### Parameters

info | a GIStructInfo |
n | a field index |

#### Returns

the GIFieldInfo, free it with `g_base_info_unref()` when done.

[transfer full]

### g_struct_info_get_n_methods ()

    gint
    g_struct_info_get_n_methods (GIStructInfo *info);

Obtain the number of methods this structure has.

#### Parameters

info | a GIStructInfo |

#### Returns

number of methods

### g_struct_info_get_method ()

    GIFunctionInfo *
    g_struct_info_get_method (GIStructInfo *info,
                              gint n);

Obtain the type information for method with specified index.

#### Parameters

info | a GIStructInfo |
n | a method index |

#### Returns

the GIFunctionInfo, free it with `g_base_info_unref()` when done.

[transfer full]

### g_struct_info_find_method ()

    GIFunctionInfo *
    g_struct_info_find_method (GIStructInfo *info,
                               const gchar *name);

Obtain the type information for method named `name` .

#### Parameters

info | a GIStructInfo |
name | a method name |

#### Returns

the GIFunctionInfo, free it with `g_base_info_unref()` when done.

[transfer full]

## Types and Values

### GIStructInfo

    typedef GIBaseInfo GIStructInfo;

Represents a struct.