ucx/map.h

changeset 107
86b19c98b5fd
parent 103
08018864fb91
child 109
75cb6590358b
equal deleted inserted replaced
106:a54115d554f7 107:86b19c98b5fd
53 * returns encoded / decoded string or NULL on failure 53 * returns encoded / decoded string or NULL on failure
54 */ 54 */
55 typedef void*(*ucx_map_coder)(void*,void*,size_t*); 55 typedef void*(*ucx_map_coder)(void*,void*,size_t*);
56 56
57 struct UcxMap { 57 struct UcxMap {
58 UcxAllocator *allocator;
58 UcxMapElement **map; 59 UcxMapElement **map;
59 size_t size; 60 size_t size;
60 size_t count; 61 size_t count;
61 }; 62 };
62 63
78 size_t index; 79 size_t index;
79 }; 80 };
80 81
81 82
82 UcxMap *ucx_map_new(size_t size); 83 UcxMap *ucx_map_new(size_t size);
84 UcxMap *ucx_map_new_allocator(size_t size, UcxAllocator *allocator);
83 void ucx_map_free(UcxMap *map); 85 void ucx_map_free(UcxMap *map);
84 /* you cannot clone maps with more than 390 mio entries */ 86 /* you cannot clone maps with more than 390 mio entries */
85 int ucx_map_copy(UcxMap *restrict from, UcxMap *restrict to, 87 int ucx_map_copy(UcxMap *restrict from, UcxMap *restrict to,
86 copy_func fnc, void *data); 88 copy_func fnc, void *data);
87 UcxMap *ucx_map_clone(UcxMap *map, copy_func fnc, void *data); 89 UcxMap *ucx_map_clone(UcxMap *map, copy_func fnc, void *data);

mercurial