Open SCAP Library
cpedict_priv.h
Go to the documentation of this file.
1 
8 /*
9  * Copyright 2009 Red Hat Inc., Durham, North Carolina.
10  * All Rights Reserved.
11  *
12  * This library is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU Lesser General Public
14  * License as published by the Free Software Foundation; either
15  * version 2.1 of the License, or (at your option) any later version.
16  *
17  * This library is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  * Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public
23  * License along with this library; if not, write to the Free Software
24  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25  *
26  * Authors:
27  * Maros Barabas <mbarabas@redhat.com>
28  */
29 
30 #ifndef CPEDICT_PRIV_H_
31 #define CPEDICT_PRIV_H_
32 
33 #include <libxml/xmlreader.h>
34 #include <libxml/xmlwriter.h>
35 #include <stdlib.h>
36 
37 #include "cpe_name.h"
38 #include "cpe_ctx_priv.h"
39 
40 #include "../common/public/oscap.h"
41 #include "../common/util.h"
42 #include "../common/elements.h"
43 
47 OSCAP_HIDDEN_START;
48  /* @endcond */
49 
54 struct cpe_check;
55 
60 struct cpe_reference;
61 
66 struct cpe_item;
67 
72 struct cpe_dict_model;
73 
78 struct cpe_item_metadata;
79 
85 
90 struct cpe_vendor;
95 struct cpe_product;
100 struct cpe_version;
105 struct cpe_update;
110 struct cpe_edition;
115 struct cpe_language;
116 
121 struct cpe_dict_model *cpe_dict_model_parse_xml(const char *file);
122 
129 
136 struct cpe_item *cpe_item_parse(struct cpe_parser_ctx *ctx);
137 
143 struct cpe_vendor *cpe_vendor_parse(xmlTextReaderPtr reader);
144 
152 
158 void cpe_dict_model_export_xml(const struct cpe_dict_model *dict, const char *file);
159 
165 void cpe_dict_export(const struct cpe_dict_model *dict, xmlTextWriterPtr writer);
166 
172 void cpe_generator_export(const struct cpe_generator *generator, xmlTextWriterPtr writer);
173 
180 void cpe_item_export(const struct cpe_item *item, xmlTextWriterPtr writer, int base_version);
181 
187 void cpe_vendor_export(const struct cpe_vendor *vendor, xmlTextWriterPtr writer);
188 
189 /* <cpe-list>
190  * */
191 struct cpe_dict_model { // the main node
192  struct oscap_list *items; // dictionary items
193  struct oscap_list *vendors;
194  int base_version;
195  struct cpe_generator *generator;
196  char* origin_file;
197 };
198 
202 OSCAP_HIDDEN_END;
203  /* @endcond */
204 
205 #endif
Product of some vendor.
Definition: cpedict_priv.c:177
Structure representing single CPE check.
Definition: cpedict_priv.c:123
CPE dictionary item reference.
Definition: cpedict_priv.c:134
Structure with information about document.
Definition: cpedict_priv.c:143
void cpe_vendor_export(const struct cpe_vendor *vendor, xmlTextWriterPtr writer)
Exporting function for CPE vendor.
Definition: cpedict_priv.c:1217
Edition of product update.
Definition: cpedict_priv.c:209
Structure with information about vendor.
Definition: cpedict_priv.h:84
Definition: cpe_ctx_priv.c:35
void cpe_dict_model_export_xml(const struct cpe_dict_model *dict, const char *file)
Export function for CPE dictionary model.
Definition: cpedict_priv.c:1029
Update of product version.
Definition: cpedict_priv.c:199
Interface to Common Platform Enumeration (CPE) URI.
void cpe_dict_export(const struct cpe_dict_model *dict, xmlTextWriterPtr writer)
Internal export function for CPE dictionary model.
Definition: cpedict_priv.c:1056
void cpe_item_export(const struct cpe_item *item, xmlTextWriterPtr writer, int base_version)
Exporting function for CPE item.
Definition: cpedict_priv.c:1135
Version of product.
Definition: cpedict_priv.c:189
Definition: list.h:54
Structure representing metadata of CPE item.
Definition: cpedict_priv.c:110
Structure representing a CPE dictionary.
Definition: cpedict_priv.h:191
void cpe_generator_export(const struct cpe_generator *generator, xmlTextWriterPtr writer)
Exporting function for CPE generator - information of XML document.
Definition: cpedict_priv.c:1102
struct cpe_generator * cpe_generator_parse(struct cpe_parser_ctx *ctx)
Parse generator part of CPE dictionary XML file.
Definition: cpedict_priv.c:675
struct cpe_dict_model * cpe_dict_model_parse(struct cpe_parser_ctx *ctx)
Load new CPE dictionary from XML node.
Definition: cpedict_priv.c:586
Structure representing single CPE dictionary item.
Definition: cpedict_priv.c:69
Language of product edition.
Definition: cpedict_priv.c:219
struct cpe_item * cpe_item_parse(struct cpe_parser_ctx *ctx)
New dictionary item from XML.
Definition: cpedict_priv.c:732
struct cpe_vendor * cpe_vendor_parse(xmlTextReaderPtr reader)
Parsing function to parse vendors of CPE dictionary.
Definition: cpedict_priv.c:930
struct cpe_dict_model * cpe_dict_model_parse_xml(const char *file)
Function to parse XML to CPE dictionary model.
Definition: cpedict_priv.c:567