Functions | |
int | evas_hash_size (Evas_Hash *hash) |
Retrieves the number of buckets available in the given hash table. | |
void | evas_hash_free (Evas_Hash *hash) |
Free an entire hash table. | |
void | evas_hash_foreach (Evas_Hash *hash, Evas_Bool(*func)(Evas_Hash *hash, const char *key, void *data, void *fdata), const void *fdata) |
Call a function on every member stored in the hash table. | |
int | evas_hash_alloc_error (void) |
Return memory allocation failure flag after an function requiring allocation. |
|
Return memory allocation failure flag after an function requiring allocation.
Example: Evas_Hash *hash = NULL; extern void *my_data; hash = evas_hash_add(hash, "My Data", my_data); if (evas_hash_alloc_error()) { fprintf(stderr, "ERROR: Memory is low. Hash allocation failed.\n"); exit(-1); } if (evas_hash_find(hash, "My Data") == my_data) { printf("My Data inserted and successfully found.\n"); } |
|
Call a function on every member stored in the hash table.
hash and calls the function func on each member. The function should NOT modify the hash table contents if it reeturns 1. IF the hash table contents are modified by this function or the function wishes to stop processing it must return 0, otherwise return 1 to keep processing.Example: extern Evas_Hash *hash; Evas_Bool hash_fn(Evas_Hash *hash, const char *key, void *data, void *fdata) { printf("Func data: %s, Hash entry: %s / %p\n", fdata, key, data); return 1; } int main(int argc, char **argv) { char *hash_fn_data; hash_fn_data = strdup("Hello World"); evas_hash_foreach(hash, hash_fn, hash_fn_data); free(hash_fn_data); } |
|
Free an entire hash table.
hash . Any entries in the table that the program has no more pointers for elsewhere may now be lost, so this should only be called if the program has lready freed any allocated data in the hash table or has the pointers for data in teh table stored elswehere as well.Example: extern Evas_Hash *hash; evas_hash_free(hash); hash = NULL; |
|
Retrieves the number of buckets available in the given hash table.
|