00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00030 #ifndef OSCAP_H_
00031 #define OSCAP_H_
00032
00045 #define OSCAP_FOREACH_GENERIC(itype, vtype, val, init_val, code) \
00046 { \
00047 struct itype##_iterator *it_ = (init_val); \
00048 vtype val; \
00049 while (itype##_iterator_has_more(it_)) { \
00050 val = itype##_iterator_next(it_); \
00051 code \
00052 } \
00053 itype##_iterator_free(it_); \
00054 }
00055
00064 #define OSCAP_FOREACH(type, val, init_val, code) \
00065 OSCAP_FOREACH_GENERIC(type, struct type *, val, init_val, code)
00066
00074 #define OSCAP_FOREACH_STR(val, init_val, code) \
00075 OSCAP_FOREACH_GENERIC(oscap_string, const char *, val, init_val, code)
00076
00077
00082 struct oscap_string_iterator;
00084 const char* oscap_string_iterator_next(struct oscap_string_iterator* it);
00086 bool oscap_string_iterator_has_more(struct oscap_string_iterator* it);
00088 void oscap_string_iterator_free(struct oscap_string_iterator* it);
00089
00090
00098 void oscap_cleanup(void);
00099
00100 #endif
00101