00001 00014 /* 00015 * Copyright 2008 Red Hat Inc., Durham, North Carolina. 00016 * All Rights Reserved. 00017 * 00018 * This library is free software; you can redistribute it and/or 00019 * modify it under the terms of the GNU Lesser General Public 00020 * License as published by the Free Software Foundation; either 00021 * version 2.1 of the License, or (at your option) any later version. 00022 * 00023 * This library is distributed in the hope that it will be useful, 00024 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00025 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00026 * Lesser General Public License for more details. 00027 * 00028 * You should have received a copy of the GNU Lesser General Public 00029 * License along with this library; if not, write to the Free Software 00030 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00031 * 00032 * Authors: 00033 * Maros Barabas <mbarabas@redhat.com> 00034 */ 00035 00036 #ifndef CPELANG_PRIV_H_ 00037 #define CPELANG_PRIV_H_ 00038 00039 #include <libxml/xmlreader.h> 00040 #include <libxml/xmlwriter.h> 00041 00042 #include "cpelang.h" 00043 #include "../common/util.h" 00044 #include "../common/elements.h" 00045 00046 OSCAP_HIDDEN_START; 00047 00048 /* 00049 * */ 00050 00055 struct cpe_testexpr { 00056 struct xml_metadata xml; 00057 cpe_lang_oper_t oper; // operator 00058 union { 00059 struct cpe_testexpr *expr; // array of subexpressions for operators 00060 struct cpe_name *cpe; // CPE for match operation 00061 } meta; // operation metadata 00062 }; 00063 00068 struct cpe_lang_model; 00069 00074 struct cpe_platform; 00075 00081 struct cpe_lang_model * cpe_lang_model_parse_xml(const struct oscap_import_source * source); 00082 00088 struct cpe_lang_model * cpe_lang_model_parse(xmlTextReaderPtr reader); 00089 00096 struct cpe_platform * cpe_platform_parse(xmlTextReaderPtr reader); 00097 00104 struct cpe_testexpr * cpe_testexpr_parse(xmlTextReaderPtr reader); 00105 00112 void cpe_lang_model_export_xml(struct cpe_lang_model * spec, struct oscap_export_target * target); 00113 00120 void cpe_lang_export(const struct cpe_lang_model * spec, xmlTextWriterPtr writer); 00121 00128 void cpe_platform_export(const struct cpe_platform * platform, xmlTextWriterPtr writer); 00129 00136 void cpe_testexpr_export(const struct cpe_testexpr expr, xmlTextWriterPtr writer); 00137 00138 OSCAP_HIDDEN_END; 00139 00140 #endif 00141