Method

GIRepositoryTypeInfohash_pointer_from_argument

since: 2.80

Declaration

void*
gi_type_info_hash_pointer_from_argument (
  GITypeInfo* info,
  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 the storage type of info.

Available since: 2.80

Parameters

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 instance.
The return value can be NULL.