00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00033 #ifndef OSCAP_H_
00034 #define OSCAP_H_
00035 #include <stdbool.h>
00036 #include <wchar.h>
00037
00038 #include "oscap_text.h"
00039 #include "oscap_reference.h"
00040
00044 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
00045 # define OSCAP_DEPRECATED(func) func __attribute__ ((deprecated))
00046 #elif defined(_MSC_VER)
00047 # define OSCAP_DEPRECATED(func) __declspec(deprecated) func
00048 #else
00049 # pragma message("WARNING: You need to implement OSCAP_DEPRECATED for this compiler---in order to get deprecation warnings.")
00050 # define OSCAP_DEPRECATED(func) func
00051 #endif
00052
00062 void oscap_init(void);
00063
00071 void oscap_cleanup(void);
00072
00074 const char *oscap_get_version(void);
00075
00076
00083
00084 typedef enum oscap_document_type {
00085 OSCAP_DOCUMENT_OVAL_DEFINITIONS = 1,
00086 OSCAP_DOCUMENT_OVAL_VARIABLES,
00087 OSCAP_DOCUMENT_OVAL_SYSCHAR,
00088 OSCAP_DOCUMENT_OVAL_RESULTS,
00089 OSCAP_DOCUMENT_OVAL_DIRECTIVES,
00090 OSCAP_DOCUMENT_XCCDF,
00091 OSCAP_DOCUMENT_CPE_LANGUAGE,
00092 OSCAP_DOCUMENT_CPE_DICTIONARY,
00093 OSCAP_DOCUMENT_CVE_FEED,
00094 OSCAP_DOCUMENT_SCE_RESULT,
00095 OSCAP_DOCUMENT_SDS,
00096 OSCAP_DOCUMENT_ARF
00097 } oscap_document_type_t;
00098
00099 typedef int (*xml_reporter)(const char *file, int line, const char *msg, void *arg);
00100
00117 int oscap_validate_document(const char *xmlfile, oscap_document_type_t doctype, const char *version, xml_reporter reporter, void *arg);
00118
00131 int oscap_schematron_validate_document(const char *xmlfile, oscap_document_type_t doctype, const char *version, const char *outfile);
00132
00145 int oscap_apply_xslt(const char *xmlfile, const char *xsltfile, const char *outfile, const char **params);
00146
00150 const char * oscap_path_to_schemas(void);
00151
00155 const char * oscap_path_to_schematron(void);
00156
00160 int oscap_determine_document_type(const char *document, oscap_document_type_t *doc_type);
00161
00162
00167 #endif