• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

/home/pvrabec/project/openscap/openscap-0.6.6/src/common/public/oscap.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2009 Red Hat Inc., Durham, North Carolina.
00003  * All Rights Reserved.
00004  *
00005  * This library is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU Lesser General Public
00007  * License as published by the Free Software Foundation; either
00008  * version 2.1 of the License, or (at your option) any later version.
00009  *
00010  * This library is distributed in the hope that it will be useful, 
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Lesser General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU Lesser General Public
00016  * License along with this library; if not, write to the Free Software 
00017  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018  *
00019  * Authors:
00020  *      Lukas Kuklinek <lkuklinek@redhat.com>
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 "reference.h"
00039 #include "reporter.h"
00040 
00041 
00065 #define OSCAP_FOREACH_GENERIC(itype, vtype, val, init_val, code) \
00066     {                                                            \
00067         struct itype##_iterator *val##_iter = (init_val);        \
00068         vtype val;                                               \
00069         while (itype##_iterator_has_more(val##_iter)) {          \
00070             val = itype##_iterator_next(val##_iter);             \
00071             code                                                 \
00072         }                                                        \
00073         itype##_iterator_free(val##_iter);                       \
00074     }
00075 
00084 #define OSCAP_FOREACH(type, val, init_val, code) \
00085         OSCAP_FOREACH_GENERIC(type, struct type *, val, init_val, code)
00086 
00094 #define OSCAP_FOREACH_STR(val, init_val, code) \
00095         OSCAP_FOREACH_GENERIC(oscap_string, const char *, val, init_val, code)
00096 
00108 #define OSCAP_FOR_GENERIC(itype, vtype, val, init_val)                  \
00109     vtype val = NULL; struct itype##_iterator *val##_iter = (init_val); \
00110     while (itype##_iterator_has_more(val##_iter)                        \
00111             ? (val = itype##_iterator_next(val##_iter), true)           \
00112             : (itype##_iterator_free(val##_iter), val##_iter = NULL, false))
00113 
00121 #define OSCAP_FOR(type, val, init_val) OSCAP_FOR_GENERIC(type, struct type *, val, init_val)
00122 
00129 #define OSCAP_FOR_STR(val, init_val) OSCAP_FOR_GENERIC(oscap_string, const char *, val, init_val)
00130 
00143 void oscap_init(void);
00144 
00152 void oscap_cleanup(void);
00153 
00155 const char *oscap_get_version(void);
00156 
00157 
00164 
00165 typedef enum oscap_document_type {
00166         OSCAP_DOCUMENT_OVAL_DEFINITIONS = 1,  
00167         OSCAP_DOCUMENT_OVAL_SYSCHAR,          
00168         OSCAP_DOCUMENT_OVAL_RESULTS,          
00169         OSCAP_DOCUMENT_XCCDF,                 
00170         OSCAP_DOCUMENT_CPE_LANGUAGE,          
00171         OSCAP_DOCUMENT_CPE_DICTIONARY,        
00172 } oscap_document_type_t;
00173 
00174 
00192 bool oscap_validate_document(const char *xmlfile, oscap_document_type_t doctype, const char *version, oscap_reporter reporter, void *arg);
00193 
00207 bool oscap_apply_xslt(const char *xmlfile, const char *xsltfile, const char *outfile, const char **params);
00208 
00209 /************************************************************/
00214 #endif

Generated on Thu Dec 9 2010 for Open SCAP Library by  doxygen 1.7.1