GIStructInfo

## GIStructInfo GIStructInfo — Struct representing a C structure |

## Synopsis

    #define             GI_IS_STRUCT_INFO                   (info)
    typedef             GIStructInfo;
    gint                g_struct_info_get_n_fields          (GIStructInfo *info);
    GIFieldInfo *       g_struct_info_get_field             (GIStructInfo *info,
                                                             gint n);
    gint                g_struct_info_get_n_methods         (GIStructInfo *info);
    GIFunctionInfo *    g_struct_info_get_method            (GIStructInfo *info,
                                                             gint n);
    GIFunctionInfo *    g_struct_info_find_method           (GIStructInfo *info,
                                                             const gchar *name);
    gsize               g_struct_info_get_size              (GIStructInfo *info);
    gsize               g_struct_info_get_alignment         (GIStructInfo *info);
    gboolean            g_struct_info_is_gtype_struct       (GIStructInfo *info);
    gboolean            g_struct_info_is_foreign            (GIStructInfo *info);

## Description

GIStructInfo represents a generic C structure type.

A structure has methods and fields.

## Struct hierarchy

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

## Details

### GI_IS_STRUCT_INFO()

    #define             GI_IS_STRUCT_INFO(info)

`info` : |

### GIStructInfo

    typedef GIBaseInfo GIStructInfo;

Represents a struct.

### g_struct_info_get_n_fields ()

    gint                g_struct_info_get_n_fields          (GIStructInfo *info);

Obtain the number of fields this structure has.

`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.

`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.

`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.

`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`.

`info` : | a GIStructInfo
`name` : | a method name
Returns : | the GIFunctionInfo, free it with `g_base_info_unref()` when done. [transfer full]

### g_struct_info_get_size ()

    gsize               g_struct_info_get_size              (GIStructInfo *info);

Obtain the total size of the structure.

`info` : | a GIStructInfo
Returns : | size of the structure in bytes

### g_struct_info_get_alignment ()

    gsize               g_struct_info_get_alignment         (GIStructInfo *info);

Obtain the required alignment of the structure.

`info` : | a GIStructInfo
Returns : | required alignment 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.

`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);

`info` : |
Returns : |