Open SCAP Library
cpelang_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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25  *
26  * Authors:
27  * Maros Barabas <mbarabas@redhat.com>
28  */
29 
30 #ifndef CPELANG_PRIV_H_
31 #define CPELANG_PRIV_H_
32 
33 #include <libxml/xmlreader.h>
34 #include <libxml/xmlwriter.h>
35 
36 #include "cpe_lang.h"
37 #include "../common/util.h"
38 #include "../common/list.h"
39 #include "../common/elements.h"
40 #include "../common/public/oscap.h"
41 
45  /* @endcond */
46 
51 struct cpe_testexpr {
53  union {
54  struct oscap_list *expr;
55  struct cpe_name *cpe;
56  struct {
57  char* system;
58  char* href;
59  char* id;
60  } check;
61  } meta;
62 };
63 
68 struct cpe_lang_model;
69 
74 struct cpe_platform;
75 
80 struct cpe_lang_model *cpe_lang_model_parse(xmlTextReaderPtr reader);
81 
87 struct cpe_platform *cpe_platform_parse(xmlTextReaderPtr reader);
88 
94 struct cpe_testexpr *cpe_testexpr_parse(xmlTextReaderPtr reader);
95 
101 void cpe_lang_model_export_xml(const struct cpe_lang_model *spec, const char *file);
102 
108 void cpe_lang_export(const struct cpe_lang_model *spec, xmlTextWriterPtr writer);
109 
115 void cpe_platform_export(const struct cpe_platform *platform, xmlTextWriterPtr writer);
116 
122 void cpe_testexpr_export(const struct cpe_testexpr *expr, xmlTextWriterPtr writer);
123 
124 char *cpe_lang_model_detect_version_priv(xmlTextReader *reader);
125 
130 bool cpe_lang_model_set_origin_file(struct cpe_lang_model* lang_model, const char* origin_file);
131 
138 const char* cpe_lang_model_get_origin_file(const struct cpe_lang_model* lang_model);
139 
140 
144  /* @endcond */
145 
146 #endif
CPE platform specification.
Definition: cpelang_priv.c:63
cpe_lang_oper_t
CPE language operators.
Definition: cpe_lang.h:50
union cpe_testexpr::@1 meta
operation metadata
cpe_lang_oper_t oper
operator
Definition: cpelang_priv.h:52
struct cpe_name * cpe
CPE for match operation.
Definition: cpelang_priv.h:55
bool cpe_lang_model_set_origin_file(struct cpe_lang_model *lang_model, const char *origin_file)
Sets the origin file hint.
Definition: cpelang_priv.c:756
void cpe_platform_export(const struct cpe_platform *platform, xmlTextWriterPtr writer)
Function for export CPE platform element.
Definition: cpelang_priv.c:507
struct oscap_list * expr
array of subexpressions for operators
Definition: cpelang_priv.h:54
Definition: list.h:53
struct cpe_lang_model * cpe_lang_model_parse(xmlTextReaderPtr reader)
Parse function for CPE Lang model.
Definition: cpelang_priv.c:235
struct cpe_platform * cpe_platform_parse(xmlTextReaderPtr reader)
Parse CPE platform structure.
Definition: cpelang_priv.c:265
const char * cpe_lang_model_get_origin_file(const struct cpe_lang_model *lang_model)
Gets the file the CPE dict model was loaded from This is necessary to figure out the full OVAL file p...
Definition: cpelang_priv.c:764
Interface to Common Platform Enumeration (CPE) Language.
Structure holding Common Platform Enumeration URI data.
Definition: cpename.c:70
CPE language boolean expression.
Definition: cpelang_priv.h:51
Single platform representation in CPE language.
Definition: cpelang_priv.c:73
void cpe_testexpr_export(const struct cpe_testexpr *expr, xmlTextWriterPtr writer)
Function for export CPE test expression element.
Definition: cpelang_priv.c:523
void cpe_lang_model_export_xml(const struct cpe_lang_model *spec, const char *file)
Function for export CPE language model to XML.
Definition: cpelang_priv.c:465
void cpe_lang_export(const struct cpe_lang_model *spec, xmlTextWriterPtr writer)
Function for export CPE language top element.
Definition: cpelang_priv.c:492
struct cpe_testexpr * cpe_testexpr_parse(xmlTextReaderPtr reader)
Parse CPE test expression structure.
Definition: cpelang_priv.c:312