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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 OSCAP_HIDDEN_START;
46  /* @endcond */
47 
52 struct cpe_testexpr {
54  union {
55  struct oscap_list *expr;
56  struct cpe_name *cpe;
57  struct {
58  char* system;
59  char* href;
60  char* id;
61  } check;
62  } meta;
63 };
64 
69 struct cpe_lang_model;
70 
75 struct cpe_platform;
76 
81 struct cpe_lang_model *cpe_lang_model_parse_xml(const char *file);
82 
87 struct cpe_lang_model *cpe_lang_model_parse(xmlTextReaderPtr reader);
88 
94 struct cpe_platform *cpe_platform_parse(xmlTextReaderPtr reader);
95 
101 struct cpe_testexpr *cpe_testexpr_parse(xmlTextReaderPtr reader);
102 
108 void cpe_lang_model_export_xml(const struct cpe_lang_model *spec, const char *file);
109 
115 void cpe_lang_export(const struct cpe_lang_model *spec, xmlTextWriterPtr writer);
116 
122 void cpe_platform_export(const struct cpe_platform *platform, xmlTextWriterPtr writer);
123 
129 void cpe_testexpr_export(const struct cpe_testexpr *expr, xmlTextWriterPtr writer);
130 
134 OSCAP_HIDDEN_END;
135  /* @endcond */
136 
137 #endif
CPE platform specification.
Definition: cpelang_priv.c:61
union cpe_testexpr::@2 meta
operation metadata
cpe_lang_oper_t
CPE language operators.
Definition: cpe_lang.h:47
cpe_lang_oper_t oper
operator
Definition: cpelang_priv.h:53
struct cpe_name * cpe
CPE for match operation.
Definition: cpelang_priv.h:56
void cpe_platform_export(const struct cpe_platform *platform, xmlTextWriterPtr writer)
Function for export CPE platform element.
Definition: cpelang_priv.c:546
struct oscap_list * expr
array of subexpressions for operators
Definition: cpelang_priv.h:55
Definition: list.h:54
struct cpe_lang_model * cpe_lang_model_parse(xmlTextReaderPtr reader)
Parse function for CPE Lang model.
Definition: cpelang_priv.c:274
struct cpe_platform * cpe_platform_parse(xmlTextReaderPtr reader)
Parse CPE platform structure.
Definition: cpelang_priv.c:304
struct cpe_lang_model * cpe_lang_model_parse_xml(const char *file)
Function for parsing XML CPE language file.
Definition: cpelang_priv.c:250
Interface to Common Platform Enumeration (CPE) Language.
Structure holding Common Platform Enumeration URI data.
Definition: cpename.c:68
CPE language boolean expression.
Definition: cpelang_priv.h:52
Single platform representation in CPE language.
Definition: cpelang_priv.c:71
void cpe_testexpr_export(const struct cpe_testexpr *expr, xmlTextWriterPtr writer)
Function for export CPE test expression element.
Definition: cpelang_priv.c:562
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:504
void cpe_lang_export(const struct cpe_lang_model *spec, xmlTextWriterPtr writer)
Function for export CPE language top element.
Definition: cpelang_priv.c:531
struct cpe_testexpr * cpe_testexpr_parse(xmlTextReaderPtr reader)
Parse CPE test expression structure.
Definition: cpelang_priv.c:351