00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00032 #ifndef OSCAP_H_
00033 #define OSCAP_H_
00034 #include <stdbool.h>
00035 #include <wchar.h>
00036
00037 #include "text.h"
00038 #include "reporter.h"
00039
00040
00064 #define OSCAP_FOREACH_GENERIC(itype, vtype, val, init_val, code) \
00065 { \
00066 struct itype##_iterator *val##_iter = (init_val); \
00067 vtype val; \
00068 while (itype##_iterator_has_more(val##_iter)) { \
00069 val = itype##_iterator_next(val##_iter); \
00070 code \
00071 } \
00072 itype##_iterator_free(val##_iter); \
00073 }
00074
00083 #define OSCAP_FOREACH(type, val, init_val, code) \
00084 OSCAP_FOREACH_GENERIC(type, struct type *, val, init_val, code)
00085
00093 #define OSCAP_FOREACH_STR(val, init_val, code) \
00094 OSCAP_FOREACH_GENERIC(oscap_string, const char *, val, init_val, code)
00095
00107 #define OSCAP_FOR_GENERIC(itype, vtype, val, init_val) \
00108 vtype val = NULL; struct itype##_iterator *val##_iter = (init_val); \
00109 while (itype##_iterator_has_more(val##_iter) \
00110 ? (val = itype##_iterator_next(val##_iter), true) \
00111 : (itype##_iterator_free(val##_iter), val##_iter = NULL, false))
00112
00120 #define OSCAP_FOR(type, val, init_val) OSCAP_FOR_GENERIC(type, struct type *, val, init_val)
00121
00128 #define OSCAP_FOR_STR(val, init_val) OSCAP_FOR_GENERIC(oscap_string, const char *, val, init_val)
00129
00142 void oscap_init(void);
00143
00151 void oscap_cleanup(void);
00152
00154 const char *oscap_get_version(void);
00155
00156
00163
00164 typedef enum oscap_document_type {
00165 OSCAP_DOCUMENT_OVAL_DEFINITIONS = 1,
00166 OSCAP_DOCUMENT_OVAL_SYSCHAR,
00167 OSCAP_DOCUMENT_OVAL_RESULTS,
00168 OSCAP_DOCUMENT_XCCDF,
00169 OSCAP_DOCUMENT_CPE_LANGUAGE,
00170 OSCAP_DOCUMENT_CPE_DICTIONARY,
00171 } oscap_document_type_t;
00172
00173
00191 bool oscap_validate_document(const char *xmlfile, oscap_document_type_t doctype, const char *version, oscap_reporter reporter, void *arg);
00192
00206 bool oscap_apply_xslt(const char *xmlfile, const char *xsltfile, const char *outfile, const char **params);
00207
00208
00213 #endif