Open SCAP Library
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
src
CPE
public
cpe_lang.h
Go to the documentation of this file.
1
13
/*
14
* Copyright 2009 Red Hat Inc., Durham, North Carolina.
15
* All Rights Reserved.
16
*
17
* This library is free software; you can redistribute it and/or
18
* modify it under the terms of the GNU Lesser General Public
19
* License as published by the Free Software Foundation; either
20
* version 2.1 of the License, or (at your option) any later version.
21
*
22
* This library is distributed in the hope that it will be useful,
23
* but WITHOUT ANY WARRANTY; without even the implied warranty of
24
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25
* Lesser General Public License for more details.
26
*
27
* You should have received a copy of the GNU Lesser General Public
28
* License along with this library; if not, write to the Free Software
29
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30
*
31
* Authors:
32
* Lukas Kuklinek <lkuklinek@redhat.com>
33
* Maros Barabas <mbarabas@redhat.com>
34
*/
35
36
#ifndef CPELANG_H_
37
#define CPELANG_H_
38
39
#include <stdlib.h>
40
41
#include "
cpe_name.h
"
42
#include "
oscap_text.h
"
43
47
typedef
enum
{
48
CPE_LANG_OPER_INVALID
= 0x00,
49
CPE_LANG_OPER_AND
= 0x01,
50
CPE_LANG_OPER_OR
= 0x02,
51
CPE_LANG_OPER_MATCH
= 0x04,
52
CPE_LANG_OPER_CHECK
= 0x08,
53
54
CPE_LANG_OPER_MASK
= 0xFF,
55
CPE_LANG_OPER_NOT
= 0x100,
56
57
CPE_LANG_OPER_NAND =
CPE_LANG_OPER_AND
|
CPE_LANG_OPER_NOT
,
58
CPE_LANG_OPER_NOR =
CPE_LANG_OPER_OR
|
CPE_LANG_OPER_NOT
,
59
}
cpe_lang_oper_t
;
60
65
struct
cpe_lang_model
;
66
71
struct
cpe_platform
;
72
77
struct
cpe_testexpr
;
78
79
80
/************************************************************/
91
struct
cpe_platform_iterator
;
92
94
struct
cpe_platform
*
cpe_platform_iterator_next
(
struct
cpe_platform_iterator
*it);
96
bool
cpe_platform_iterator_has_more
(
struct
cpe_platform_iterator
*it);
98
void
cpe_platform_iterator_free
(
struct
cpe_platform_iterator
*it);
99
105
struct
cpe_testexpr_iterator
;
107
struct
cpe_testexpr
*
cpe_testexpr_iterator_next
(
struct
cpe_testexpr_iterator
*it);
109
bool
cpe_testexpr_iterator_has_more
(
struct
cpe_testexpr_iterator
*it);
111
void
cpe_testexpr_iterator_free
(
struct
cpe_testexpr_iterator
*it);
112
113
/************************************************************/
116
/************************************************************/
128
cpe_lang_oper_t
cpe_testexpr_get_oper
(
const
struct
cpe_testexpr
*item);
129
135
struct
cpe_testexpr_iterator
*
cpe_testexpr_get_meta_expr
(
const
struct
cpe_testexpr
*item);
136
142
const
struct
cpe_name
*
cpe_testexpr_get_meta_cpe
(
const
struct
cpe_testexpr
*item);
143
149
const
char
*
cpe_testexpr_get_meta_check_system
(
const
struct
cpe_testexpr
*item);
150
156
const
char
*
cpe_testexpr_get_meta_check_href
(
const
struct
cpe_testexpr
*item);
157
163
const
char
*
cpe_testexpr_get_meta_check_id
(
const
struct
cpe_testexpr
*item);
164
170
const
struct
cpe_testexpr
*
cpe_testexpr_get_next
(
const
struct
cpe_testexpr
*
expr
);
171
176
struct
cpe_platform_iterator
*
cpe_lang_model_get_platforms
(
const
struct
cpe_lang_model
*item);
177
182
struct
cpe_platform
*
cpe_lang_model_get_item
(
const
struct
cpe_lang_model
*item,
const
char
*key);
183
192
bool
cpe_platform_applicable_lang_model
(
const
char
* platform,
struct
cpe_lang_model
*lang_model,
cpe_check_fn
check_cb,
cpe_dict_fn
dict_cb,
void
* usr);
193
198
const
char
*
cpe_platform_get_id
(
const
struct
cpe_platform
*item);
203
const
char
*
cpe_platform_get_remark
(
const
struct
cpe_platform
*item);
208
struct
oscap_text_iterator
*
cpe_platform_get_titles
(
const
struct
cpe_platform
*item);
213
const
struct
cpe_testexpr
*
cpe_platform_get_expr
(
const
struct
cpe_platform
*item);
214
215
/************************************************************/
218
/************************************************************/
230
bool
cpe_lang_model_add_platform
(
struct
cpe_lang_model
*lang,
struct
cpe_platform
*platform);
235
bool
cpe_platform_add_title
(
struct
cpe_platform
*platform,
struct
oscap_text
*title);
236
241
/*bool cpe_lang_model_add_xmlns(struct cpe_lang_model * model, struct xml_metadata * xml);*/
242
249
bool
cpe_testexpr_add_subexpression
(
struct
cpe_testexpr
*
expr
,
struct
cpe_testexpr
*sub);
250
255
bool
cpe_platform_set_id
(
struct
cpe_platform
*platform,
const
char
*new_id);
260
bool
cpe_platform_set_remark
(
struct
cpe_platform
*platform,
const
char
*new_remark);
267
bool
cpe_platform_set_expr
(
struct
cpe_platform
*platform,
struct
cpe_testexpr
*
expr
);
274
bool
cpe_testexpr_set_oper
(
struct
cpe_testexpr
*
expr
,
cpe_lang_oper_t
oper
);
275
283
bool
cpe_testexpr_set_name
(
struct
cpe_testexpr
*
expr
,
struct
cpe_name
*name);
284
285
/************************************************************/
288
289
void
cpe_platform_iterator_remove
(
struct
cpe_platform_iterator
*it,
struct
cpe_lang_model
*parent);
291
void
cpe_platform_iterator_reset
(
struct
cpe_platform_iterator
*it);
292
297
struct
cpe_lang_model
*
cpe_lang_model_new
(
void
);
298
303
struct
cpe_testexpr
*
cpe_testexpr_new
(
void
);
304
309
struct
cpe_platform
*
cpe_platform_new
(
void
);
310
316
struct
cpe_testexpr
*
cpe_testexpr_clone
(
struct
cpe_testexpr
* old_expr);
317
322
void
cpe_testexpr_free
(
struct
cpe_testexpr
*
expr
);
323
328
void
cpe_testexpr_iterator_reset
(
struct
cpe_testexpr_iterator
*it);
329
334
void
cpe_lang_model_free
(
struct
cpe_lang_model
*platformspec);
335
340
void
cpe_platform_free
(
struct
cpe_platform
*platform);
341
342
/************************************************************/
353
const
char
*
cpe_lang_model_supported
(
void
);
354
359
char
*
cpe_lang_model_detect_version
(
const
char
* file);
360
368
bool
cpe_platform_match_cpe
(
struct
cpe_name
**
cpe
,
size_t
n,
const
struct
cpe_platform
*platform);
369
370
/************************************************************/
377
struct
cpe_lang_model
*
cpe_lang_model_import
(
const
char
*file);
378
384
bool
cpe_lang_model_set_origin_file
(
struct
cpe_lang_model
* lang_model,
const
char
* origin_file);
385
393
const
char
*
cpe_lang_model_get_origin_file
(
const
struct
cpe_lang_model
* lang_model);
394
401
void
cpe_lang_model_export
(
const
struct
cpe_lang_model
*spec,
const
char
*file);
402
407
#endif
/* _CPELANG_H_ */
Generated by
1.8.3.1