Open SCAP Library
|
00001 00008 /* 00009 * Copyright 2009-2010 Red Hat Inc., Durham, North Carolina. 00010 * All Rights Reserved. 00011 * 00012 * This library is free software; you can redistribute it and/or 00013 * modify it under the terms of the GNU Lesser General Public 00014 * License as published by the Free Software Foundation; either 00015 * version 2.1 of the License, or (at your option) any later version. 00016 * 00017 * This library is distributed in the hope that it will be useful, 00018 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00020 * Lesser General Public License for more details. 00021 * 00022 * You should have received a copy of the GNU Lesser General Public 00023 * License along with this library; if not, write to the Free Software 00024 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00025 * 00026 * Authors: 00027 * "David Niemoller" <David.Niemoller@g2-inc.com> 00028 */ 00029 00030 #ifndef OVAL_PARSER_H_ 00031 #define OVAL_PARSER_H_ 00032 00033 #include <libxml/xmlreader.h> 00034 #include "public/oval_agent_api.h" 00035 #include "common/util.h" 00036 00037 OSCAP_HIDDEN_START; 00038 00039 struct oval_parser_context { 00040 struct oval_definition_model *definition_model; 00041 struct oval_syschar_model *syschar_model; 00042 struct oval_results_model *results_model; 00043 struct oval_variable_model *variable_model; 00044 struct oval_directives_model *directives_model; 00045 xmlTextReader *reader; 00046 void *user_data; 00047 }; 00048 00049 int oval_definition_model_parse(xmlTextReaderPtr, struct oval_parser_context *); 00050 int oval_syschar_model_parse(xmlTextReaderPtr, struct oval_parser_context *); 00051 int oval_results_model_parse(xmlTextReaderPtr , struct oval_parser_context *); 00052 00053 void libxml_error_handler(void *, const char *, xmlParserSeverities severity, xmlTextReaderLocatorPtr locator); 00054 00055 int oval_parser_boolean_attribute(xmlTextReaderPtr reader, char *attname, int defval); 00056 int oval_parser_int_attribute(xmlTextReaderPtr reader, char *attname, int defval); 00057 typedef void (*oval_xml_value_consumer) (char *, void *); 00058 int oval_parser_text_value(xmlTextReaderPtr, struct oval_parser_context *, oval_xml_value_consumer, void *); 00059 00060 typedef int (*oval_xml_tag_parser) (xmlTextReaderPtr, struct oval_parser_context *, void *); 00061 int oval_parser_parse_tag(xmlTextReaderPtr, struct oval_parser_context *, oval_xml_tag_parser, void *); 00062 int oval_parser_skip_tag(xmlTextReaderPtr reader, struct oval_parser_context *context); 00063 00064 void oval_text_consumer(char *text, void *user); 00065 00066 OSCAP_HIDDEN_END; 00067 00068 #endif /* OVAL_PARSER_H_ */