00001 00008 /* 00009 * Copyright 2009 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 * Maros Barabas <mbarabas@redhat.com> 00028 */ 00029 00030 #ifndef CPEDICT_PRIV_H_ 00031 #define CPEDICT_PRIV_H_ 00032 00033 #include <libxml/xmlreader.h> 00034 #include <libxml/xmlwriter.h> 00035 #include <stdlib.h> 00036 00037 #include "cpe_name.h" 00038 00039 #include "../common/public/oscap.h" 00040 #include "../common/util.h" 00041 #include "../common/elements.h" 00042 00046 OSCAP_HIDDEN_START; 00047 /* @endcond */ 00048 00053 struct cpe_check; 00054 00059 struct cpe_reference; 00060 00065 struct cpe_item; 00066 00071 struct cpe_dict_model; 00072 00077 struct cpe_item_metadata; 00078 00083 struct cpe_generator; 00084 00089 struct cpe_vendor; 00094 struct cpe_product; 00099 struct cpe_version; 00104 struct cpe_update; 00109 struct cpe_edition; 00114 struct cpe_language; 00115 00120 struct cpe_dict_model *cpe_dict_model_parse_xml(const char *file); 00121 00127 struct cpe_generator *cpe_generator_parse(xmlTextReaderPtr reader); 00128 00135 struct cpe_item *cpe_item_parse(xmlTextReaderPtr reader); 00136 00142 struct cpe_vendor *cpe_vendor_parse(xmlTextReaderPtr reader); 00143 00150 struct cpe_dict_model *cpe_dict_model_parse(xmlTextReaderPtr reader); 00151 00157 void cpe_dict_model_export_xml(const struct cpe_dict_model *dict, const char *file); 00158 00164 void cpe_dict_export(const struct cpe_dict_model *dict, xmlTextWriterPtr writer); 00165 00171 void cpe_generator_export(const struct cpe_generator *generator, xmlTextWriterPtr writer); 00172 00179 void cpe_item_export(const struct cpe_item *item, xmlTextWriterPtr writer, int base_version); 00180 00186 void cpe_vendor_export(const struct cpe_vendor *vendor, xmlTextWriterPtr writer); 00187 00188 /* <cpe-list> 00189 * */ 00190 struct cpe_dict_model { // the main node 00191 struct oscap_list *items; // dictionary items 00192 struct oscap_list *vendors; 00193 int base_version; 00194 struct cpe_generator *generator; 00195 char* origin_file; 00196 }; 00197 00201 OSCAP_HIDDEN_END; 00202 /* @endcond */ 00203 00204 #endif