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

/home/pvrabec/project/openscap/openscap-0.6.3/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 "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

Generated on Tue Sep 14 2010 for Open SCAP Library by  doxygen 1.7.1