Changes in uspace/lib/c/include/adt/generic_char_map.h [aaa3f33a:736a330] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/adt/generic_char_map.h
raaa3f33a r736a330 55 55 \ 56 56 typedef struct name name##_t; \ 57 typedef name##_t *name##_ref; \ 57 58 \ 58 59 struct name { \ … … 62 63 }; \ 63 64 \ 64 int name##_add(name##_ t *, const char *, const size_t, type *); \65 int name##_count(name##_ t *); \66 void name##_destroy(name##_ t *); \67 void name##_exclude(name##_ t *, const char *, const size_t); \68 type *name##_find(name##_ t *, const char *, const size_t); \69 int name##_initialize(name##_ t *); \70 int name##_is_valid(name##_ t *);65 int name##_add(name##_ref, const char *, const size_t, type *); \ 66 int name##_count(name##_ref); \ 67 void name##_destroy(name##_ref); \ 68 void name##_exclude(name##_ref, const char *, const size_t); \ 69 type *name##_find(name##_ref, const char *, const size_t); \ 70 int name##_initialize(name##_ref); \ 71 int name##_is_valid(name##_ref); 71 72 72 73 /** Character string to generic type map implementation. … … 80 81 GENERIC_FIELD_IMPLEMENT(name##_items, type) \ 81 82 \ 82 int name##_add(name##_ t *map, const char *name, const size_t length, \83 int name##_add(name##_ref map, const char *name, const size_t length, \ 83 84 type *value) \ 84 85 { \ … … 98 99 } \ 99 100 \ 100 int name##_count(name##_ t *map) \101 int name##_count(name##_ref map) \ 101 102 { \ 102 103 return name##_is_valid(map) ? \ … … 104 105 } \ 105 106 \ 106 void name##_destroy(name##_ t *map) \107 void name##_destroy(name##_ref map) \ 107 108 { \ 108 109 if (name##_is_valid(map)) { \ … … 112 113 } \ 113 114 \ 114 void name##_exclude(name##_ t *map, const char *name, \115 void name##_exclude(name##_ref map, const char *name, \ 115 116 const size_t length) \ 116 117 { \ … … 124 125 } \ 125 126 \ 126 type *name##_find(name##_ t *map, const char *name, \127 type *name##_find(name##_ref map, const char *name, \ 127 128 const size_t length) \ 128 129 { \ … … 137 138 } \ 138 139 \ 139 int name##_initialize(name##_ t *map) \140 int name##_initialize(name##_ref map) \ 140 141 { \ 141 142 int rc; \ … … 154 155 } \ 155 156 \ 156 int name##_is_valid(name##_ t *map) \157 int name##_is_valid(name##_ref map) \ 157 158 { \ 158 159 return map && (map->magic == GENERIC_CHAR_MAP_MAGIC_VALUE); \
Note:
See TracChangeset
for help on using the changeset viewer.