43 free(f); |
43 free(f); |
44 } |
44 } |
45 |
45 |
46 void func_init() { |
46 void func_init() { |
47 function_map = cxHashMapCreate(cxDefaultAllocator, CX_STORE_POINTERS, 256); |
47 function_map = cxHashMapCreate(cxDefaultAllocator, CX_STORE_POINTERS, 256); |
48 function_map->simple_destructor = (cx_destructor_func)funcstruct_free; |
48 function_map->collection.simple_destructor = (cx_destructor_func)funcstruct_free; |
49 } |
49 } |
50 |
50 |
51 void func_cleanup() { |
51 void func_cleanup() { |
52 cxMapDestroy(function_map); |
52 cxMapFree(function_map); |
53 } |
53 } |
54 |
54 |
55 void add_function(FuncStruct *func) { |
55 void add_function(FuncStruct *func) { |
56 struct FuncStruct *f = malloc(sizeof(FuncStruct)); |
56 struct FuncStruct *f = malloc(sizeof(FuncStruct)); |
57 *f = *func; |
57 *f = *func; |