40 typedef void (*oscap_dump_func) ();
42 typedef bool (*oscap_cmp_func) (
void *,
void *);
62 void oscap_create_lists(
struct oscap_list **first, ...);
63 bool oscap_list_add(
struct oscap_list *list,
void *value);
64 bool oscap_list_push(
struct oscap_list *list,
void *value);
65 bool oscap_list_prepend(
struct oscap_list *list,
void *value);
66 bool oscap_list_pop(
struct oscap_list *list, oscap_destruct_func destructor);
67 bool oscap_list_remove(
struct oscap_list *list,
void *value, oscap_cmp_func compare, oscap_destruct_func destructor);
69 void oscap_list_free(
struct oscap_list *list, oscap_destruct_func destructor);
70 void oscap_list_free0(
struct oscap_list *list);
71 void oscap_list_dump(
struct oscap_list *list, oscap_dump_func dumper,
int depth);
72 int oscap_list_get_itemcount(
struct oscap_list *list);
73 bool oscap_list_contains(
struct oscap_list *list,
void *what, oscap_cmp_func compare);
80 typedef bool(*oscap_filter_func) (
void *,
void *);
85 oscap_filter_func filter;
91 void *oscap_iterator_new(
struct oscap_list *list);
92 void *oscap_iterator_new_filter(
struct oscap_list *list, oscap_filter_func filter,
void *user_data);
94 size_t oscap_iterator_get_itemcount(
const struct oscap_iterator *it);
101 void *oscap_list_find(
struct oscap_list *list,
void *what, oscap_cmp_func compare);
109 #define OSCAP_FOREACH_GENERIC(itype, vtype, val, init_val, code) \ 111 struct itype##_iterator *val##_iter = (init_val); \ 113 while (itype##_iterator_has_more(val##_iter)) { \ 114 val = itype##_iterator_next(val##_iter); \ 117 itype##_iterator_free(val##_iter); \ 128 #define OSCAP_FOREACH(type, val, init_val, code) \ 129 OSCAP_FOREACH_GENERIC(type, struct type *, val, init_val, code) 142 #define OSCAP_FOR_GENERIC(itype, vtype, val, init_val) \ 143 vtype val = NULL; struct itype##_iterator *val##_iter = (init_val); \ 144 while (itype##_iterator_has_more(val##_iter) \ 145 ? (val = itype##_iterator_next(val##_iter), true) \ 146 : (itype##_iterator_free(val##_iter), val##_iter = NULL, false)) 155 #define OSCAP_FOR(type, val, init_val) OSCAP_FOR_GENERIC(type, struct type *, val, init_val) 163 #define OSCAP_FOR_STR(val, init_val) OSCAP_FOR_GENERIC(oscap_string, const char *, val, init_val) 170 typedef int (*oscap_compare_func) (
const char *,
const char *);
183 oscap_compare_func cmp;
193 struct oscap_htable *oscap_htable_new1(oscap_compare_func cmp,
size_t hsize);
215 bool oscap_htable_add(
struct oscap_htable *htable,
const char *key,
void *item);
221 void *oscap_htable_get(
struct oscap_htable *htable,
const char *key);
228 size_t oscap_htable_itemcount(
struct oscap_htable *htable);
230 void *oscap_htable_detach(
struct oscap_htable *htable,
const char *key);
232 void oscap_htable_dump(
struct oscap_htable *htable, oscap_dump_func dumper,
int depth);
239 void oscap_htable_free(
struct oscap_htable *htable, oscap_destruct_func destructor);
294 void oscap_htable_iterator_next_kv(
struct oscap_htable_iterator *hit,
const char **key,
void **value);
308 void oscap_print_depth(
int depth);
General OpenScap functions and types.
Multilingual text processing interface.