40typedef void (*oscap_dump_func) ();
42typedef bool (*oscap_cmp_func) (
void *,
void *);
62void oscap_create_lists(
struct oscap_list **first, ...);
63bool oscap_list_add(
struct oscap_list *list,
void *value);
64bool oscap_list_push(
struct oscap_list *list,
void *value);
65bool oscap_list_prepend(
struct oscap_list *list,
void *value);
66bool oscap_list_pop(
struct oscap_list *list, oscap_destruct_func destructor);
67bool oscap_list_remove(
struct oscap_list *list,
void *value, oscap_cmp_func compare, oscap_destruct_func destructor);
69void oscap_list_free(
struct oscap_list *list, oscap_destruct_func destructor);
71void oscap_list_dump(
struct oscap_list *list, oscap_dump_func dumper,
int depth);
72int oscap_list_get_itemcount(
struct oscap_list *list);
73bool oscap_list_contains(
struct oscap_list *list,
void *what, oscap_cmp_func compare);
80typedef bool(*oscap_filter_func) (
void *,
void *);
85 oscap_filter_func filter;
91void *oscap_iterator_new(
struct oscap_list *list);
92void *oscap_iterator_new_filter(
struct oscap_list *list, oscap_filter_func filter,
void *user_data);
94size_t oscap_iterator_get_itemcount(
const struct oscap_iterator *it);
101void *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)
170typedef int (*oscap_compare_func) (
const char *,
const char *);
183 oscap_compare_func cmp;
193struct oscap_htable *oscap_htable_new1(oscap_compare_func cmp,
size_t hsize);
215bool oscap_htable_add(
struct oscap_htable *htable,
const char *key,
void *item);
221void *oscap_htable_get(
struct oscap_htable *htable,
const char *key);
228size_t oscap_htable_itemcount(
struct oscap_htable *htable);
230void *oscap_htable_detach(
struct oscap_htable *htable,
const char *key);
232void oscap_htable_dump(
struct oscap_htable *htable, oscap_dump_func dumper,
int depth);
239void oscap_htable_free(
struct oscap_htable *htable, oscap_destruct_func destructor);
294void oscap_htable_iterator_next_kv(
struct oscap_htable_iterator *hit,
const char **key,
void **value);
308void oscap_print_depth(
int depth);
General OpenScap functions and types.
Multilingual text processing interface.