Function

GIRepositorytype_tag_argument_from_hash_pointer

since: 2.80

Declaration

void
gi_type_tag_argument_from_hash_pointer (
  GITypeTag storage_type,
  void* hash_pointer,
  GIArgument* arg
)

Description

Convert a data pointer from a GLib data structure to a GIArgument.

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 extracted from stuffed pointers, regardless of the machine‚Äôs architecture or endianness.

This function fills in the appropriate field of arg with the value extracted from hash_pointer, depending on storage_type.

Available since: 2.80

Parameters

storage_type

Type: GITypeTag

A GITypeTag obtained from gi_type_info_get_storage_type()

hash_pointer

Type: void*

A pointer, such as a GHashTable data pointer.

The argument can be NULL.
The data is owned by the caller of the function.
arg

Type: GIArgument

A GIArgument to fill in.

The argument will be set by the function.
The data is owned by the caller of the function.