Open SCAP Library
cpedict_priv.h
Go to the documentation of this file.
1 
8 /*
9  * Copyright 2009--2014 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 #include "cpe_dict.h"
40 
41 #include "../common/public/oscap.h"
42 #include "../common/util.h"
43 #include "../common/elements.h"
44 
48  /* @endcond */
49 
56 
63 struct cpe_item *cpe_item_parse(struct cpe_parser_ctx *ctx);
64 
70 struct cpe_vendor *cpe_vendor_parse(xmlTextReaderPtr reader);
71 
79 
85 char *cpe_dict_detect_version_priv(xmlTextReader *reader);
86 
92 void cpe_dict_model_export_xml(const struct cpe_dict_model *dict, const char *file);
93 
99 void cpe_dict_export(const struct cpe_dict_model *dict, xmlTextWriterPtr writer);
100 
106 void cpe_generator_export(const struct cpe_generator *generator, xmlTextWriterPtr writer);
107 
114 void cpe_item_export(const struct cpe_item *item, xmlTextWriterPtr writer, int base_version);
115 
121 void cpe_vendor_export(const struct cpe_vendor *vendor, xmlTextWriterPtr writer);
122 
127 bool cpe_dict_model_set_origin_file(struct cpe_dict_model* dict, const char* origin_file);
128 
135 const char* cpe_dict_model_get_origin_file(const struct cpe_dict_model* dict);
136 
137 /* <cpe-list>
138  * */
139 struct cpe_dict_model { // the main node
140  struct oscap_list *items; // dictionary items
141  struct oscap_list *vendors;
142  int base_version;
143  struct cpe_generator *generator;
144  char* origin_file;
145 };
146 
150  /* @endcond */
151 
152 #endif
cpe_generator
Definition: cpedict_priv.c:140
cpe_dict_model_export_xml
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:955
cpe_dict_export
void cpe_dict_export(const struct cpe_dict_model *dict, xmlTextWriterPtr writer)
Internal export function for CPE dictionary model.
Definition: cpedict_priv.c:982
cpe_item
Definition: cpedict_priv.c:71
cpe_generator_export
void cpe_generator_export(const struct cpe_generator *generator, xmlTextWriterPtr writer)
Exporting function for CPE generator - information of XML document.
Definition: cpedict_priv.c:1028
cpe_generator_parse
struct cpe_generator * cpe_generator_parse(struct cpe_parser_ctx *ctx)
Parse generator part of CPE dictionary XML file.
Definition: cpedict_priv.c:601
cpe_vendor_export
void cpe_vendor_export(const struct cpe_vendor *vendor, xmlTextWriterPtr writer)
Exporting function for CPE vendor.
Definition: cpedict_priv.c:1143
cpe_dict.h
Interface to Common Platform Enumeration (CPE) Dictionary.
cpe_parser_ctx
Definition: cpe_ctx_priv.c:34
cpe_dict_model
Definition: cpedict_priv.h:139
cpe_dict_model_set_origin_file
bool cpe_dict_model_set_origin_file(struct cpe_dict_model *dict, const char *origin_file)
Sets the origin file hint.
Definition: cpedict_priv.c:1291
oscap_list
Definition: list.h:53
cpe_vendor
Definition: cpe_dict.h:56
cpe_item_parse
struct cpe_item * cpe_item_parse(struct cpe_parser_ctx *ctx)
New dictionary item from XML.
Definition: cpedict_priv.c:658
cpe_name.h
Interface to Common Platform Enumeration (CPE) URI.
cpe_item_export
void cpe_item_export(const struct cpe_item *item, xmlTextWriterPtr writer, int base_version)
Exporting function for CPE item.
Definition: cpedict_priv.c:1061
cpe_dict_model_parse
struct cpe_dict_model * cpe_dict_model_parse(struct cpe_parser_ctx *ctx)
Load new CPE dictionary from XML node.
Definition: cpedict_priv.c:512
cpe_dict_detect_version_priv
char * cpe_dict_detect_version_priv(xmlTextReader *reader)
Get a version info from xmlTextReader.
Definition: cpedict.c:173
cpe_vendor_parse
struct cpe_vendor * cpe_vendor_parse(xmlTextReaderPtr reader)
Parsing function to parse vendors of CPE dictionary.
Definition: cpedict_priv.c:856
cpe_dict_model_get_origin_file
const char * cpe_dict_model_get_origin_file(const struct cpe_dict_model *dict)
Gets the file the CPE dict model was loaded from This is necessary to figure out the full OVAL file p...
Definition: cpedict_priv.c:1299