Loading...
Searching...
No Matches
cpedict_priv.h
Go to the documentation of this file.
/*
* Copyright 2009--2014 Red Hat Inc., Durham, North Carolina.
* All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Authors:
* Maros Barabas <mbarabas@redhat.com>
*/
#ifndef CPEDICT_PRIV_H_
#define CPEDICT_PRIV_H_
#include <libxml/xmlreader.h>
#include <libxml/xmlwriter.h>
#include <stdlib.h>
#include "cpe_name.h"
#include "cpe_ctx_priv.h"
#include "cpe_dict.h"
#include "../common/public/oscap.h"
#include "../common/util.h"
#include "../common/elements.h"
/* @endcond */
struct cpe_generator *cpe_generator_parse(struct cpe_parser_ctx *ctx);
struct cpe_item *cpe_item_parse(struct cpe_parser_ctx *ctx);
struct cpe_vendor *cpe_vendor_parse(xmlTextReaderPtr reader);
struct cpe_dict_model *cpe_dict_model_parse(struct cpe_parser_ctx *ctx);
char *cpe_dict_detect_version_priv(xmlTextReader *reader);
void cpe_dict_model_export_xml(const struct cpe_dict_model *dict, const char *file);
void cpe_dict_export(const struct cpe_dict_model *dict, xmlTextWriterPtr writer);
void cpe_generator_export(const struct cpe_generator *generator, xmlTextWriterPtr writer);
void cpe_item_export(const struct cpe_item *item, xmlTextWriterPtr writer, int base_version);
void cpe_vendor_export(const struct cpe_vendor *vendor, xmlTextWriterPtr writer);
bool cpe_dict_model_set_origin_file(struct cpe_dict_model* dict, const char* origin_file);
const char* cpe_dict_model_get_origin_file(const struct cpe_dict_model* dict);
/* <cpe-list>
* */
struct cpe_dict_model { // the main node
struct oscap_list *items; // dictionary items
struct oscap_list *vendors;
int base_version;
struct cpe_generator *generator;
char* origin_file;
};
/* @endcond */
#endif
elements.h
cpe_dict.h
Interface to Common Platform Enumeration (CPE) Dictionary.
cpe_name.h
Interface to Common Platform Enumeration (CPE) URI.
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
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_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_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_item_parse
struct cpe_item * cpe_item_parse(struct cpe_parser_ctx *ctx)
New dictionary item from XML.
Definition cpedict_priv.c:658
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_dict_detect_version_priv
char * cpe_dict_detect_version_priv(xmlTextReader *reader)
Get a version info from xmlTextReader.
Definition cpedict.c:173
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_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_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_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.h
General OpenScap functions and types.
cpe_dict_model
Structure representing a CPE dictionary.
Definition cpedict_priv.h:139
cpe_generator
Structure with information about document.
Definition cpedict_priv.c:140
cpe_item
Structure representing single CPE dictionary item.
Definition cpedict_priv.c:71
cpe_parser_ctx
Definition cpe_ctx_priv.c:34
cpe_vendor
Structure with information about vendor.
oscap_list
Definition list.h:53