Function
GLibHashTableinsert
Description
Inserts a new key and value into a GHashTable.
If the key already exists in the GHashTable its current
value is replaced with the new value. If you supplied a
value_destroy_func when creating the GHashTable, the old
value is freed using that function. If you supplied a
key_destroy_func when creating the GHashTable, the passed
key is freed using that function.
Starting from GLib 2.40, this function returns a boolean value to indicate whether the newly added value was already in the hash table or not.
Parameters
hash_table-
Type:
GHashTableA
GHashTable.The data is owned by the caller of the function. key-
Type:
gpointerA key to insert.
The argument can be NULL.The data is owned by the caller of the function. value-
Type:
gpointerThe value to associate with the key.
The argument can be NULL.The data is owned by the caller of the function.