Function

GIRepositorytype_tag_hash_pointer_from_argument

since: 2.80

Declaration

void*
gi_type_tag_hash_pointer_from_argument (
  GITypeTag storage_type,
  GIArgument* arg
)

Description

Convert a GIArgument to data pointer for use in a GLib data structure.

GLib data structures, such as GList, GSList, and GHashTable, all store data pointers.

In the case where the list or hash table is storing single types rather than structs, these data pointers may have values stuffed into them via macros such as GPOINTER_TO_INT.

Use this function to ensure that all values are correctly stuffed into pointers, regardless of the machine’s architecture or endianness.

This function returns a pointer stuffed with the appropriate field of arg, depending on storage_type.

Available since: 2.80

Parameters

storage_type

Type: GITypeTag

A GITypeTag obtained from gi_type_info_get_storage_type()

arg

Type: GIArgument

A GIArgument with the value to stuff into a pointer.

The data is owned by the caller of the function.

Return value

Type: void*

A stuffed pointer, that can be stored in a GHashTable, for example.

The data is owned by the called function.
The return value can be NULL.