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_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_direct_add(Eina_Hash *hash, const void *key, const void *data) EINA_ARG_NONNULL(1, 2, 3);
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
_eina_int32_key_length(__UNUSED__ const uint32_t *key)
{
#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.
* @param hash The given hash table.