123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- #ifndef HASHMAP_H_
- #define HASHMAP_H_
- #define KEY_COUNT (1024*1024)
- #define KEY_MAX_LENGTH (37)
- #define VALUE_MAX_LENGTH (65)
- #define MAP_MISSING -3
- #define MAP_FULL -2
- #define MAP_OMEM -1
- #define MAP_OK 0
- typedef struct data_struct_s
- {
- char key_string[KEY_MAX_LENGTH];
- char key_value[VALUE_MAX_LENGTH];
- } data_struct_t;
- typedef void *any_t;
- typedef int (*PFany)(any_t, any_t);
- typedef any_t map_t;
- extern map_t hashmap_new();
- extern int hashmap_iterate(map_t in, PFany f, any_t item);
- extern int hashmap_put(map_t in, char* key, any_t value);
- extern int hashmap_get(map_t in, char* key, any_t *arg);
- extern int hashmap_remove(map_t in, char* key);
- extern int hashmap_get_one(map_t in, any_t *arg, int remove);
- extern void hashmap_free(map_t in);
- extern int hashmap_length(map_t in);
- extern int hashmap_operation(int type, char *uuid, char *data);
- extern void hashmapForMessageNew(void);
- extern void hashmapForMessageFree(void);
- extern int hashmapForMessageLength(void);
- #endif
|