forked from enlightenment/efl
* eina: Add an eina_hash_stringshare_new.
SVN revision: 41112
This commit is contained in:
parent
43ff8f4c9d
commit
7a18ab5ebc
|
@ -74,6 +74,7 @@ EAPI Eina_Hash * eina_hash_string_small_new(Eina_Free_Cb data_free_cb);
|
||||||
EAPI Eina_Hash * eina_hash_int32_new(Eina_Free_Cb data_free_cb);
|
EAPI Eina_Hash * eina_hash_int32_new(Eina_Free_Cb data_free_cb);
|
||||||
EAPI Eina_Hash * eina_hash_int64_new(Eina_Free_Cb data_free_cb);
|
EAPI Eina_Hash * eina_hash_int64_new(Eina_Free_Cb data_free_cb);
|
||||||
EAPI Eina_Hash * eina_hash_pointer_new(Eina_Free_Cb data_free_cb);
|
EAPI Eina_Hash * eina_hash_pointer_new(Eina_Free_Cb data_free_cb);
|
||||||
|
EAPI Eina_Hash * eina_hash_stringshared_new(Eina_Free_Cb data_free_cb);
|
||||||
|
|
||||||
EAPI Eina_Bool eina_hash_add(Eina_Hash *hash, const void *key, const void *data) EINA_ARG_NONNULL(1, 2, 3);
|
EAPI Eina_Bool eina_hash_add(Eina_Hash *hash, const void *key, const void *data) EINA_ARG_NONNULL(1, 2, 3);
|
||||||
EAPI Eina_Bool eina_hash_direct_add(Eina_Hash *hash, const void *key, const void *data) EINA_ARG_NONNULL(1, 2, 3);
|
EAPI Eina_Bool eina_hash_direct_add(Eina_Hash *hash, const void *key, const void *data) EINA_ARG_NONNULL(1, 2, 3);
|
||||||
|
|
|
@ -439,6 +439,13 @@ _eina_string_key_cmp(const char *key1, __UNUSED__ int key1_length,
|
||||||
return strcmp(key1, key2);
|
return strcmp(key1, key2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
_eina_stringshared_key_cmp(const char *key1, __UNUSED__ int key1_length,
|
||||||
|
const char *key2, __UNUSED__ int key2_length)
|
||||||
|
{
|
||||||
|
return key1 - key2;
|
||||||
|
}
|
||||||
|
|
||||||
static unsigned int
|
static unsigned int
|
||||||
_eina_int32_key_length(__UNUSED__ const uint32_t *key)
|
_eina_int32_key_length(__UNUSED__ const uint32_t *key)
|
||||||
{
|
{
|
||||||
|
@ -790,6 +797,16 @@ eina_hash_pointer_new(Eina_Free_Cb data_free_cb)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EAPI Eina_Hash *
|
||||||
|
eina_hash_stringshared_new(Eina_Free_Cb data_free_cb)
|
||||||
|
{
|
||||||
|
return eina_hash_new(NULL,
|
||||||
|
EINA_KEY_CMP(_eina_stringshared_key_cmp),
|
||||||
|
EINA_KEY_HASH(eina_hash_superfast),
|
||||||
|
data_free_cb,
|
||||||
|
EINA_HASH_BUCKET_SIZE);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the number of buckets available in the given hash table.
|
* Retrieves the number of buckets available in the given hash table.
|
||||||
* @param hash The given hash table.
|
* @param hash The given hash table.
|
||||||
|
|
Loading…
Reference in New Issue