Open SCAP Library: oscap.h Source File

Open SCAP Library

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

oscap.h
Go to the documentation of this file.
1 /*
2 * Copyright 2009,2010,2011 Red Hat Inc., Durham, North Carolina.
3 * All Rights Reserved.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * Authors:
20 * Lukas Kuklinek <lkuklinek@redhat.com>
21 * Peter Vrabec <pvrabec@redhat.com>
22 */
23
33 #ifndef OSCAP_H_
34 #define OSCAP_H_
35 #include <stdbool.h>
36 #include <wchar.h>
37
38 #include "oscap_text.h"
39 #include "oscap_reference.h"
40
44 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
45 # define OSCAP_DEPRECATED(func) func __attribute__ ((deprecated))
46 #elif defined(_MSC_VER)
47 # define OSCAP_DEPRECATED(func) __declspec(deprecated) func
48 #else
49 # pragma message("WARNING: You need to implement OSCAP_DEPRECATED for this compiler---in order to get deprecation warnings.")
50 # define OSCAP_DEPRECATED(func) func
51 #endif
52
62 void oscap_init(void);
63
71 void oscap_cleanup(void);
72
74 const char *oscap_get_version(void);
75
76
83 typedef enum oscap_document_type {
85 OSCAP_DOCUMENT_UNKNOWN = 0,
86 OSCAP_DOCUMENT_OVAL_DEFINITIONS,
87 OSCAP_DOCUMENT_OVAL_VARIABLES,
88 OSCAP_DOCUMENT_OVAL_SYSCHAR,
89 OSCAP_DOCUMENT_OVAL_RESULTS,
90 OSCAP_DOCUMENT_OVAL_DIRECTIVES,
91 OSCAP_DOCUMENT_XCCDF,
92 OSCAP_DOCUMENT_CPE_LANGUAGE,
93 OSCAP_DOCUMENT_CPE_DICTIONARY,
94 OSCAP_DOCUMENT_CVE_FEED,
95 OSCAP_DOCUMENT_SCE_RESULT,
96 OSCAP_DOCUMENT_SDS,
97 OSCAP_DOCUMENT_ARF,
98 OSCAP_DOCUMENT_XCCDF_TAILORING
99 // If you are adding a new enum here, make sure you add support for it
100 // to utils/oscap-info.c!
101 } oscap_document_type_t;
102
111 const char *oscap_document_type_to_string(oscap_document_type_t type);
112
113 typedef int (*xml_reporter)(const char *file, int line, const char *msg, void *arg);
114
133 OSCAP_DEPRECATED(int oscap_validate_document(const char *xmlfile, oscap_document_type_t doctype, const char *version, xml_reporter reporter, void *arg));
134
149 OSCAP_DEPRECATED(int oscap_schematron_validate_document(const char *xmlfile, oscap_document_type_t doctype, const char *version, const char *outfile));
150
163 int oscap_apply_xslt(const char *xmlfile, const char *xsltfile, const char *outfile, const char **params);
164
168 const char * oscap_path_to_schemas(void);
169
176 OSCAP_DEPRECATED(const char * oscap_path_to_schematron(void));
177
181 const char * oscap_path_to_cpe(void);
182
188 OSCAP_DEPRECATED(int oscap_determine_document_type(const char *document, oscap_document_type_t *doc_type));
189
190 /************************************************************/
195 #endif
oscap_path_to_cpe
const char * oscap_path_to_cpe(void)
Function returns path used to locate OpenSCAP Default CPE files.
Definition: oscapxml.c:99
reporter
Definition: reporter.c:31
oscap_apply_xslt
int oscap_apply_xslt(const char *xmlfile, const char *xsltfile, const char *outfile, const char **params)
Apply a XSLT stylesheet to a XML file.
Definition: oscapxml.c:145
OSCAP_DOCUMENT_OVAL_RESULTS
OVAL results file.
Definition: oscap.h:89
oscap_document_type_to_string
const char * oscap_document_type_to_string(oscap_document_type_t type)
Convert oscap_document_type_t constant to human readable (english) representation.
Definition: oscapxml.c:160
oscap_path_to_schemas
const char * oscap_path_to_schemas(void)
Function returns path used to locate OpenSCAP XML schemas.
Definition: oscapxml.c:83
OSCAP_DEPRECATED
#define OSCAP_DEPRECATED(func)
This macro will warn, when a deprecated function is used.
Definition: oscap.h:50
OSCAP_DOCUMENT_OVAL_VARIABLES
OVAL Variables.
Definition: oscap.h:87
OSCAP_DOCUMENT_SDS
Source Data Stream file.
Definition: oscap.h:96
oscap_cleanup
void oscap_cleanup(void)
Release library internal caches.
Definition: oscapxml.c:110
OSCAP_DOCUMENT_CVE_FEED
CVE NVD feed.
Definition: oscap.h:94
OSCAP_DOCUMENT_CPE_DICTIONARY
CPE dictionary file.
Definition: oscap.h:93
OSCAP_DOCUMENT_OVAL_SYSCHAR
OVAL system characteristics file.
Definition: oscap.h:88
oscap_validate_document
int oscap_validate_document(const char *xmlfile, oscap_document_type_t doctype, const char *version, xml_reporter reporter, void *arg)
Validate a SCAP document file against a XML schema.
Definition: oscapxml.c:119
OSCAP_DOCUMENT_OVAL_DEFINITIONS
OVAL Definitions file.
Definition: oscap.h:86
oscap_document_type_t
enum oscap_document_type oscap_document_type_t
SCAP document type identifiers.
OSCAP_DOCUMENT_SCE_RESULT
SCE result file.
Definition: oscap.h:95
oscap_schematron_validate_document
int oscap_schematron_validate_document(const char *xmlfile, oscap_document_type_t doctype, const char *version, const char *outfile)
Validate a SCAP document file against schematron rules.
Definition: oscapxml.c:137
oscap_init
void oscap_init(void)
Initialize OpenSCAP library.
Definition: oscapxml.c:103
OSCAP_DOCUMENT_CPE_LANGUAGE
CPE language file.
Definition: oscap.h:92
oscap_text.h
Multilingual text processing interface.
OSCAP_DOCUMENT_UNKNOWN
The type is unknown.
Definition: oscap.h:85
OSCAP_DOCUMENT_OVAL_DIRECTIVES
OVAL directives file.
Definition: oscap.h:90
OSCAP_DOCUMENT_ARF
Result Data Stream file.
Definition: oscap.h:97
oscap_document_type
oscap_document_type
SCAP document type identifiers.
Definition: oscap.h:84
OSCAP_DOCUMENT_XCCDF_TAILORING
XCCDF tailoring file.
Definition: oscap.h:98
OSCAP_DOCUMENT_XCCDF
XCCDF benchmark file.
Definition: oscap.h:91
oscap_path_to_schematron
const char * oscap_path_to_schematron(void)
Function returns path used to locate OpenSCAP Schematron files.
Definition: oscapxml.c:97
oscap_get_version
const char * oscap_get_version(void)
Get version of the OpenSCAP library.
Definition: oscapxml.c:117
oscap_determine_document_type
int oscap_determine_document_type(const char *document, oscap_document_type_t *doc_type)
Determine document type.
Definition: oscapxml.c:153