Function
GLibCachenew
deprecated: 2.32
Declaration
GCache*
g_cache_new (
GCacheNewFunc value_new_func,
GCacheDestroyFunc value_destroy_func,
GCacheDupFunc key_dup_func,
GCacheDestroyFunc key_destroy_func,
GHashFunc hash_key_func,
GHashFunc hash_value_func,
GEqualFunc key_equal_func
)
Description
Creates a new GCache.
Deprecated since: 2.32
Use a GHashTable instead.
This function is not directly available to language bindings.
Parameters
value_new_func-
Type:
GCacheNewFuncA function to create a new object given a key. This is called by
g_cache_insert()if an object with the given key does not already exist. value_destroy_func-
Type:
GCacheDestroyFuncA function to destroy an object. It is called by
g_cache_remove()when the object is no longer needed (i.e. its reference count drops to 0) key_dup_func-
Type:
GCacheDupFuncA function to copy a key. It is called by
g_cache_insert()if the key does not already exist in theGCache. key_destroy_func-
Type:
GCacheDestroyFuncA function to destroy a key. It is called by
g_cache_remove()when the object is no longer needed (i.e. its reference count drops to 0) hash_key_func-
Type:
GHashFuncA function to create a hash value from a key.
hash_value_func-
Type:
GHashFuncA function to create a hash value from a value.
key_equal_func-
Type:
GEqualFuncA function to compare two keys. It should return
TRUEif the two keys are equivalent.
Return value
Type: GCache
A new GCache.
| The data is owned by the called function. |