ucx/map.h

changeset 42
ff3dd1ee7dee
parent 41
7f90a03e186e
child 44
46356d74e873
equal deleted inserted replaced
41:7f90a03e186e 42:ff3dd1ee7dee
12 #ifdef __cplusplus 12 #ifdef __cplusplus
13 extern "C" { 13 extern "C" {
14 #endif 14 #endif
15 15
16 #define UCX_MAP_FOREACH(elm,iter) \ 16 #define UCX_MAP_FOREACH(elm,iter) \
17 for(elm;ucx_map_iter_next(&iter,(void*)&elm)==0;) 17 for(;ucx_map_iter_next(&iter,(void*)&elm)==0;)
18 18
19 typedef struct UcxMap UcxMap; 19 typedef struct UcxMap UcxMap;
20 typedef struct UcxKey UcxKey; 20 typedef struct UcxKey UcxKey;
21 typedef struct UcxMapElement UcxMapElement; 21 typedef struct UcxMapElement UcxMapElement;
22 typedef struct UcxMapIterator UcxMapIterator; 22 typedef struct UcxMapIterator UcxMapIterator;
62 62
63 UcxMapIterator ucx_map_iterator(UcxMap *map); 63 UcxMapIterator ucx_map_iterator(UcxMap *map);
64 64
65 int ucx_map_iter_next(UcxMapIterator *i, void **elm); 65 int ucx_map_iter_next(UcxMapIterator *i, void **elm);
66 66
67 /* use for string maps only, values are not encoded */
68 int ucx_map_load(UcxMap *map, FILE *f);
69 int ucx_map_store(UcxMap *map, FILE *f);
70
71 /* TODO:
72 int ucx_map_load_enc(UcxMap *map, FILE *f, copy_func decoder, void* decdata);
73 int ucx_map_store_enc(UcxMap *map, FILE *f, copy_func encoder, void* encdata);
74 */
75
67 #ifdef __cplusplus 76 #ifdef __cplusplus
68 } 77 }
69 #endif 78 #endif
70 79
71 #endif /* MAP_H */ 80 #endif /* MAP_H */

mercurial