Debian Codegraph @

src/OVAL/oval_objectContent.c

raw symbols SCIP
1 /**
2 * @file oval_objectContent.c
3 * \brief Open Vulnerability and Assessment Language
4 *
5 * See more details at http://oval.mitre.org/
6 */
7
8 /*
9 * Copyright 2009--2013 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 * "David Niemoller" <[email protected]>
28 */
29
30 #ifdef HAVE_CONFIG_Hcxx . . $ `<built-in>:409:9`!
31 #include <config.h>cxx . . $ `<file>/build/config.h`/
32 #endif
33
34 #include <stdlib.h>
35 #include <stdio.h>
36 #include <string.h>
37
38 #include "oval_definitions_impl.h"cxx . . $ `<file>/src/OVAL/oval_definitions_impl.h`/
39 #include "adt/oval_collection_impl.h"cxx . . $ `<file>/src/OVAL/adt/oval_collection_impl.h`/
40 #include "oval_agent_api_impl.h"cxx . . $ `<file>/src/OVAL/oval_agent_api_impl.h`/
41 #include "common/util.h"cxx . . $ `<file>/src/common/util.h`/
42 #include "common/debug_priv.h"cxx . . $ `<file>/src/common/debug_priv.h`/
43
44 typedef struct oval_object_contentcxx . . $ oval_object_content# {
45 struct oval_definition_modelcxx . . $ oval_definition_model# *modelcxx . . $ oval_object_content#model.;
46 char *fieldNamecxx . . $ oval_object_content#fieldName.;
47 oval_object_content_type_tcxx . . $ oval_object_content_type_t# typecxx . . $ oval_object_content#type.;
48 } oval_object_content_tcxx . . $ oval_object_content_t#;
49
50 typedef struct oval_object_content_ENTITYcxx . . $ oval_object_content_ENTITY# {
51 struct oval_definition_modelcxx . . $ oval_definition_model# *modelcxx . . $ oval_object_content_ENTITY#model.;
52 char *fieldNamecxx . . $ oval_object_content_ENTITY#fieldName.;
53 oval_object_content_type_tcxx . . $ oval_object_content_type_t# typecxx . . $ oval_object_content_ENTITY#type.;
54 struct oval_entitycxx . . $ oval_entity# *entitycxx . . $ oval_object_content_ENTITY#entity.; /*type == OVAL_OBJECTCONTENT_ENTITY */
55 oval_check_tcxx . . $ oval_check_t# varCheckcxx . . $ oval_object_content_ENTITY#varCheck.; /*type == OVAL_OBJECTCONTENT_ENTITY */
56 } oval_object_content_ENTITY_tcxx . . $ oval_object_content_ENTITY_t#;
57
58 typedef struct oval_object_content_SETcxx . . $ oval_object_content_SET# {
59 struct oval_definition_modelcxx . . $ oval_definition_model# *modelcxx . . $ oval_object_content_SET#model.;
60 char *fieldNamecxx . . $ oval_object_content_SET#fieldName.;
61 oval_object_content_type_tcxx . . $ oval_object_content_type_t# typecxx . . $ oval_object_content_SET#type.;
62 struct oval_setobjectcxx . . $ oval_setobject# *setcxx . . $ oval_object_content_SET#set.; /*type == OVAL_OBJECTCONTENT_SET */
63 } oval_object_content_SET_tcxx . . $ oval_object_content_SET_t#;
64
65 typedef struct oval_object_content_FILTERcxx . . $ oval_object_content_FILTER# {
66 struct oval_definition_modelcxx . . $ oval_definition_model# *modelcxx . . $ oval_object_content_FILTER#model.;
67 char *fieldNamecxx . . $ oval_object_content_FILTER#fieldName.;
68 oval_object_content_type_tcxx . . $ oval_object_content_type_t# typecxx . . $ oval_object_content_FILTER#type.;
69 struct oval_filtercxx . . $ oval_filter# *filtercxx . . $ oval_object_content_FILTER#filter.; /*type == OVAL_OBJECTCONTENT_FILTER */
70 } oval_object_content_FILTER_tcxx . . $ oval_object_content_FILTER_t#;
71
72 boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! oval_object_content_iterator_has_morecxx . . $ oval_object_content_iterator_has_more(94988246e4c8fa99).(struct oval_object_content_iteratorcxx . . $ oval_object_content_iterator#
73 *oc_object_content)
74 {
75 return oval_collection_iterator_has_morecxx . . $ oval_collection_iterator_has_more(de0650ab9b639739).((struct oval_iteratorcxx . . $ oval_iterator# *)
76 oc_object_content);
77 }
78
79 struct oval_object_contentcxx . . $ oval_object_content# *oval_object_content_iterator_nextcxx . . $ oval_object_content_iterator_next(eb16ce6ae0e4b7fc).(struct
80 oval_object_content_iteratorcxx . . $ oval_object_content_iterator#
81 *oc_object_content)
82 {
83 return (struct oval_object_contentcxx . . $ oval_object_content# *)
84 oval_collection_iterator_nextcxx . . $ oval_collection_iterator_next(344074693c9690a9).((struct oval_iteratorcxx . . $ oval_iterator# *)
85 oc_object_content);
86 }
87
88 void oval_object_content_iterator_freecxx . . $ oval_object_content_iterator_free(de918ccd59b4e784).(struct
89 oval_object_content_iteratorcxx . . $ oval_object_content_iterator#
90 *oc_object_content)
91 {
92 oval_collection_iterator_freecxx . . $ oval_collection_iterator_free(ee496816570b41f7).((struct oval_iteratorcxx . . $ oval_iterator# *)
93 oc_object_content);
94 }
95
96 char *oval_object_content_get_field_namecxx . . $ oval_object_content_get_field_name(4d0202477fd84df1).(struct oval_object_contentcxx . . $ oval_object_content# *content)
97 {
98 return ((struct oval_object_contentcxx . . $ oval_object_content# *)content)->fieldNamecxx . . $ oval_object_content#fieldName.;
99 }
100
101 oval_object_content_type_tcxx . . $ oval_object_content_type_t# oval_object_content_get_typecxx . . $ oval_object_content_get_type(7a653648ed12be92).(struct
102 oval_object_contentcxx . . $ oval_object_content#
103 *content)
104 {
105 __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(content);
106
107 return ((struct oval_object_contentcxx . . $ oval_object_content# *)content)->typecxx . . $ oval_object_content#type.;
108 }
109
110 struct oval_entitycxx . . $ oval_entity# *oval_object_content_get_entitycxx . . $ oval_object_content_get_entity(ecfb176ae958982e).(struct oval_object_contentcxx . . $ oval_object_content#
111 *content)
112 {
113 __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(content);
114
115 /*type == OVAL_OBJECTCONTENT_ENTITY */
116 struct oval_entitycxx . . $ oval_entity# *entity = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
117 if (oval_object_content_get_typecxx . . $ oval_object_content_get_type(7a653648ed12be92).(content) == OVAL_OBJECTCONTENT_ENTITYcxx . . $ OVAL_OBJECTCONTENT_ENTITY.) {
118 entity = ((struct oval_object_content_ENTITYcxx . . $ oval_object_content_ENTITY# *)content)->entitycxx . . $ oval_object_content_ENTITY#entity.;
119 }
120 return entity;
121 }
122
123 oval_check_tcxx . . $ oval_check_t# oval_object_content_get_varCheckcxx . . $ oval_object_content_get_varCheck(c5e530c31d741904).(struct oval_object_contentcxx . . $ oval_object_content# * content)
124 {
125 __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(content);
126
127 /*type == OVAL_OBJECTCONTENT_ENTITY */
128 oval_check_tcxx . . $ oval_check_t# varCheck = OVAL_CHECK_UNKNOWNcxx . . $ OVAL_CHECK_UNKNOWN.;
129 if (oval_object_content_get_typecxx . . $ oval_object_content_get_type(7a653648ed12be92).(content) == OVAL_OBJECTCONTENT_ENTITYcxx . . $ OVAL_OBJECTCONTENT_ENTITY.) {
130 varCheck = ((struct oval_object_content_ENTITYcxx . . $ oval_object_content_ENTITY# *)content)->varCheckcxx . . $ oval_object_content_ENTITY#varCheck.;
131 }
132 return varCheck;
133 }
134
135 struct oval_setobjectcxx . . $ oval_setobject# *oval_object_content_get_setobjectcxx . . $ oval_object_content_get_setobject(25929015085a5f4).(struct oval_object_contentcxx . . $ oval_object_content# *content)
136 {
137 __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(content);
138
139 /*type == OVAL_OBJECTCONTENT_SET */
140 struct oval_setobjectcxx . . $ oval_setobject# *set = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
141 if (oval_object_content_get_typecxx . . $ oval_object_content_get_type(7a653648ed12be92).(content) == OVAL_OBJECTCONTENT_SETcxx . . $ OVAL_OBJECTCONTENT_SET.) {
142 set = ((struct oval_object_content_SETcxx . . $ oval_object_content_SET# *)content)->setcxx . . $ oval_object_content_SET#set.;
143 }
144 return set;
145 }
146
147 struct oval_filtercxx . . $ oval_filter# *oval_object_content_get_filtercxx . . $ oval_object_content_get_filter(ff2759e7c389f912).(struct oval_object_contentcxx . . $ oval_object_content# *content)
148 {
149 __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(content);
150
151 /* type == OVAL_OBJECTCONTENT_FILTER */
152 struct oval_filtercxx . . $ oval_filter# *filter = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
153 if (oval_object_content_get_typecxx . . $ oval_object_content_get_type(7a653648ed12be92).(content) == OVAL_OBJECTCONTENT_FILTERcxx . . $ OVAL_OBJECTCONTENT_FILTER.) {
154 filter = ((struct oval_object_content_FILTERcxx . . $ oval_object_content_FILTER# *)content)->filtercxx . . $ oval_object_content_FILTER#filter.;
155 }
156 return filter;
157 }
158
159 struct oval_object_contentcxx . . $ oval_object_content#
160 *oval_object_content_newcxx . . $ oval_object_content_new(f618c6d08ff66bb4).(struct oval_definition_modelcxx . . $ oval_definition_model# *model, oval_object_content_type_tcxx . . $ oval_object_content_type_t# type)
161 {
162 struct oval_object_contentcxx . . $ oval_object_content# *content = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
163 switch (type) {
164 case OVAL_OBJECTCONTENT_ENTITYcxx . . $ OVAL_OBJECTCONTENT_ENTITY.:{
165 struct oval_object_content_ENTITYcxx . . $ oval_object_content_ENTITY# *entity =
166 (oval_object_content_ENTITY_tcxx . . $ oval_object_content_ENTITY_t# *) malloccxx . . $ malloc(bfcfa4d6b7f7ef64).(sizeof(oval_object_content_ENTITY_tcxx . . $ oval_object_content_ENTITY_t#));
167 if (entity == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
168 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
169
170 content = (oval_object_content_tcxx . . $ oval_object_content_t# *) entity;
171 entity->entitycxx . . $ oval_object_content_ENTITY#entity. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
172 entity->varCheckcxx . . $ oval_object_content_ENTITY#varCheck. = OVAL_CHECK_UNKNOWNcxx . . $ OVAL_CHECK_UNKNOWN.;
173 }
174 break;
175 case OVAL_OBJECTCONTENT_SETcxx . . $ OVAL_OBJECTCONTENT_SET.:{
176 struct oval_object_content_SETcxx . . $ oval_object_content_SET# *set =
177 (oval_object_content_SET_tcxx . . $ oval_object_content_SET_t# *) malloccxx . . $ malloc(bfcfa4d6b7f7ef64).(sizeof(oval_object_content_SET_tcxx . . $ oval_object_content_SET_t#));
178 if (set == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
179 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
180
181 set->setcxx . . $ oval_object_content_SET#set. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
182 content = (oval_object_content_tcxx . . $ oval_object_content_t# *) set;
183 }
184 break;
185 case OVAL_OBJECTCONTENT_FILTERcxx . . $ OVAL_OBJECTCONTENT_FILTER.:{
186 struct oval_object_content_FILTERcxx . . $ oval_object_content_FILTER# *filter =
187 (oval_object_content_FILTER_tcxx . . $ oval_object_content_FILTER_t# *) malloccxx . . $ malloc(bfcfa4d6b7f7ef64).(sizeof(oval_object_content_FILTER_tcxx . . $ oval_object_content_FILTER_t#));
188 if (filter == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
189 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
190
191 filter->filtercxx . . $ oval_object_content_FILTER#filter. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
192 content = (oval_object_content_tcxx . . $ oval_object_content_t# *) filter;
193 }
194 break;
195 default:
196 dEcxx . . $ `src/common/debug_priv.h:63:9`!("Unsupported object content type: %d.", type);
197 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
198 }
199 content->modelcxx . . $ oval_object_content#model. = model;
200 content->fieldNamecxx . . $ oval_object_content#fieldName. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
201 content->typecxx . . $ oval_object_content#type. = type;
202 return content;
203 }
204
205 struct oval_object_contentcxx . . $ oval_object_content# *oval_object_content_clonecxx . . $ oval_object_content_clone(24b7b396d9f105d7).
206 (struct oval_definition_modelcxx . . $ oval_definition_model# *new_model, struct oval_object_contentcxx . . $ oval_object_content# *old_content) {
207 struct oval_object_contentcxx . . $ oval_object_content# *new_content = oval_object_content_newcxx . . $ oval_object_content_new(f618c6d08ff66bb4).(new_model, old_content->typecxx . . $ oval_object_content#type.);
208 char *name = oval_object_content_get_field_namecxx . . $ oval_object_content_get_field_name(4d0202477fd84df1).(old_content);
209 oval_object_content_set_field_namecxx . . $ oval_object_content_set_field_name(c797e9c5069e317e).(new_content, name);
210 switch (new_content->typecxx . . $ oval_object_content#type.) {
211 case OVAL_OBJECTCONTENT_ENTITYcxx . . $ OVAL_OBJECTCONTENT_ENTITY.:{
212 struct oval_entitycxx . . $ oval_entity# *entity = oval_entity_clonecxx . . $ oval_entity_clone(1af5ab030ffd9ac7).(new_model, oval_object_content_get_entitycxx . . $ oval_object_content_get_entity(ecfb176ae958982e).(old_content));
213 oval_object_content_set_entitycxx . . $ oval_object_content_set_entity(e68168122def624a).(new_content, entity);
214 oval_check_tcxx . . $ oval_check_t# check = oval_object_content_get_varCheckcxx . . $ oval_object_content_get_varCheck(c5e530c31d741904).(old_content);
215 oval_object_content_set_varCheckcxx . . $ oval_object_content_set_varCheck(aa26633be8a69a23).(new_content, check);
216 } break;
217 case OVAL_OBJECTCONTENT_SETcxx . . $ OVAL_OBJECTCONTENT_SET.:{
218 struct oval_setobjectcxx . . $ oval_setobject# *set = oval_object_content_get_setobjectcxx . . $ oval_object_content_get_setobject(25929015085a5f4).(old_content);
219 oval_object_content_set_setobjectcxx . . $ oval_object_content_set_setobject(1cfb6b0c7225601b).(new_content, oval_setobject_clonecxx . . $ oval_setobject_clone(cce31e2636076eac).(new_model, set));
220 } break;
221 case OVAL_OBJECTCONTENT_FILTERcxx . . $ OVAL_OBJECTCONTENT_FILTER.:{
222 struct oval_filtercxx . . $ oval_filter# *filter = oval_object_content_get_filtercxx . . $ oval_object_content_get_filter(ff2759e7c389f912).(old_content);
223 oval_object_content_set_filtercxx . . $ oval_object_content_set_filter(cb1ff3eab1291809).(new_content, oval_filter_clonecxx . . $ oval_filter_clone(936b229ce6f90811).(new_model, filter));
224 } break;
225 default:
226 /*NOOP*/;
227 }
228 return new_content;
229 }
230
231 void oval_object_content_freecxx . . $ oval_object_content_free(86b45f77129fa34e).(struct oval_object_contentcxx . . $ oval_object_content# *content)
232 {
233 __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(content);
234
235 if (content->fieldNamecxx . . $ oval_object_content#fieldName. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
236 freecxx . . $ free(5d22bdacc48458e8).(content->fieldNamecxx . . $ oval_object_content#fieldName.);
237 content->fieldNamecxx . . $ oval_object_content#fieldName. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
238 switch (content->typecxx . . $ oval_object_content#type.) {
239 case OVAL_OBJECTCONTENT_ENTITYcxx . . $ OVAL_OBJECTCONTENT_ENTITY.:{
240 struct oval_object_content_ENTITYcxx . . $ oval_object_content_ENTITY# *entity = (oval_object_content_ENTITY_tcxx . . $ oval_object_content_ENTITY_t# *) content;
241 if (entity->entitycxx . . $ oval_object_content_ENTITY#entity. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
242 oval_entity_freecxx . . $ oval_entity_free(b7cc62b9e2b9f845).(entity->entitycxx . . $ oval_object_content_ENTITY#entity.);
243 entity->entitycxx . . $ oval_object_content_ENTITY#entity. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
244 }
245 break;
246 case OVAL_OBJECTCONTENT_SETcxx . . $ OVAL_OBJECTCONTENT_SET.:{
247 struct oval_object_content_SETcxx . . $ oval_object_content_SET# *set = (oval_object_content_SET_tcxx . . $ oval_object_content_SET_t# *) content;
248 if (set->setcxx . . $ oval_object_content_SET#set. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
249 oval_setobject_freecxx . . $ oval_setobject_free(a0df8c01e03eb98b).(set->setcxx . . $ oval_object_content_SET#set.);
250 set->setcxx . . $ oval_object_content_SET#set. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
251 }
252 break;
253 case OVAL_OBJECTCONTENT_FILTERcxx . . $ OVAL_OBJECTCONTENT_FILTER.:{
254 struct oval_object_content_FILTERcxx . . $ oval_object_content_FILTER# *filter = (oval_object_content_FILTER_tcxx . . $ oval_object_content_FILTER_t# *) content;
255 if (filter->filtercxx . . $ oval_object_content_FILTER#filter. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
256 oval_filter_freecxx . . $ oval_filter_free(e95a45dff1204a78).(filter->filtercxx . . $ oval_object_content_FILTER#filter.);
257 filter->filtercxx . . $ oval_object_content_FILTER#filter. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
258 }
259 break;
260 case OVAL_OBJECTCONTENT_UNKNOWNcxx . . $ OVAL_OBJECTCONTENT_UNKNOWN.:
261 break;
262 }
263 freecxx . . $ free(5d22bdacc48458e8).(content);
264 }
265
266 void oval_object_content_set_typecxx . . $ oval_object_content_set_type(7ec3e2bb1483f597).(struct oval_object_contentcxx . . $ oval_object_content# *content, oval_object_content_type_tcxx . . $ oval_object_content_type_t# type)
267 {
268 __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(content);
269 content->typecxx . . $ oval_object_content#type. = type;
270 }
271
272 void oval_object_content_set_field_namecxx . . $ oval_object_content_set_field_name(c797e9c5069e317e).(struct oval_object_contentcxx . . $ oval_object_content# *content, char *name)
273 {
274 __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(content);
275 if (content->fieldNamecxx . . $ oval_object_content#fieldName. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
276 freecxx . . $ free(5d22bdacc48458e8).(content->fieldNamecxx . . $ oval_object_content#fieldName.);
277 content->fieldNamecxx . . $ oval_object_content#fieldName. = (name == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) ? NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! : oscap_strdupcxx . . $ oscap_strdup(a8b8e32347182212).(name);
278 }
279
280 void oval_object_content_set_entitycxx . . $ oval_object_content_set_entity(e68168122def624a).(struct oval_object_contentcxx . . $ oval_object_content# *content, struct oval_entitycxx . . $ oval_entity# *entity)
281 { /*type == OVAL_OBJECTCONTENT_ENTITY */
282 __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(content);
283 if (content->typecxx . . $ oval_object_content#type. == OVAL_OBJECTCONTENT_ENTITYcxx . . $ OVAL_OBJECTCONTENT_ENTITY.) {
284 oval_object_content_ENTITY_tcxx . . $ oval_object_content_ENTITY_t# *content_ENTITY = (oval_object_content_ENTITY_tcxx . . $ oval_object_content_ENTITY_t# *) content;
285 content_ENTITY->entitycxx . . $ oval_object_content_ENTITY#entity. = entity;
286 }
287 }
288
289 void oval_object_content_set_varCheckcxx . . $ oval_object_content_set_varCheck(aa26633be8a69a23).(struct oval_object_contentcxx . . $ oval_object_content# *content, oval_check_tcxx . . $ oval_check_t# check)
290 { /*type == OVAL_OBJECTCONTENT_ENTITY */
291 __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(content);
292 if (content->typecxx . . $ oval_object_content#type. == OVAL_OBJECTCONTENT_ENTITYcxx . . $ OVAL_OBJECTCONTENT_ENTITY.) {
293 oval_object_content_ENTITY_tcxx . . $ oval_object_content_ENTITY_t# *content_ENTITY = (oval_object_content_ENTITY_tcxx . . $ oval_object_content_ENTITY_t# *) content;
294 content_ENTITY->varCheckcxx . . $ oval_object_content_ENTITY#varCheck. = check;
295 }
296 }
297
298 void oval_object_content_set_setobjectcxx . . $ oval_object_content_set_setobject(1cfb6b0c7225601b).(struct oval_object_contentcxx . . $ oval_object_content# *content, struct oval_setobjectcxx . . $ oval_setobject# *set)
299 { /*type == OVAL_OBJECTCONTENT_SET */
300 __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(content);
301 if (content->typecxx . . $ oval_object_content#type. == OVAL_OBJECTCONTENT_SETcxx . . $ OVAL_OBJECTCONTENT_SET.) {
302 oval_object_content_SET_tcxx . . $ oval_object_content_SET_t# *content_SET = (oval_object_content_SET_tcxx . . $ oval_object_content_SET_t# *) content;
303 content_SET->setcxx . . $ oval_object_content_SET#set. = set;
304 }
305 }
306
307 void oval_object_content_set_filtercxx . . $ oval_object_content_set_filter(cb1ff3eab1291809).(struct oval_object_contentcxx . . $ oval_object_content# *content, struct oval_filtercxx . . $ oval_filter# *filter)
308 { /*type == OVAL_OBJECTCONTENT_FILTER */
309 __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(content);
310 if (content->typecxx . . $ oval_object_content#type. == OVAL_OBJECTCONTENT_FILTERcxx . . $ OVAL_OBJECTCONTENT_FILTER.) {
311 oval_object_content_FILTER_tcxx . . $ oval_object_content_FILTER_t# *content_FILTER = (oval_object_content_FILTER_tcxx . . $ oval_object_content_FILTER_t# *) content;
312 content_FILTER->filtercxx . . $ oval_object_content_FILTER#filter. = filter;
313 }
314 }
315
316 /*typedef void (*oval_object_content_consumer)(struct oval_object_content*,void*);*/
317 static void oval_consume_entitycxx . . $ oval_consume_entity(fb63e7ea941706c9).(struct oval_entitycxx . . $ oval_entity# *entity, void *content_entity)
318 {
319 __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(entity);
320
321 ((struct oval_object_content_ENTITYcxx . . $ oval_object_content_ENTITY# *)content_entity)->entitycxx . . $ oval_object_content_ENTITY#entity. = entity;
322 }
323
324 static void oval_consume_setcxx . . $ oval_consume_set(95e6f01b2aba5a24).(struct oval_setobjectcxx . . $ oval_setobject# *set, void *content_set)
325 {
326 __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(content_set);
327
328 ((struct oval_object_content_SETcxx . . $ oval_object_content_SET# *)content_set)->setcxx . . $ oval_object_content_SET#set. = set;
329 }
330
331 static void oval_consume_filtercxx . . $ oval_consume_filter(9ce7970ace097529).(struct oval_filtercxx . . $ oval_filter# *filter, void *content_filter)
332 {
333 __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(content_filter);
334
335 ((struct oval_object_content_FILTERcxx . . $ oval_object_content_FILTER# *)content_filter)->filtercxx . . $ oval_object_content_FILTER#filter. = filter;
336 }
337
338 /* prevent gcc false warning */
339 //#pragma GCC diagnostic push
340 #pragma GCC diagnostic ignored "-Wswitch"
341 int oval_object_content_parse_tagcxx . . $ oval_object_content_parse_tag(2eddbe5882d33f3f).(xmlTextReaderPtrcxx . . $ xmlTextReaderPtr# reader,
342 struct oval_parser_contextcxx . . $ oval_parser_context# *context,
343 oval_object_content_consumercxx . . $ oval_object_content_consumer# consumer, void *user)
344 {
345 __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(context);
346
347 char *tagname = (char *)xmlTextReaderLocalNamecxx . . $ xmlTextReaderLocalName(3322afb275581432).(reader);
348 xmlCharcxx . . $ xmlChar# *namespace = xmlTextReaderNamespaceUricxx . . $ xmlTextReaderNamespaceUri(3322afb275581432).(reader);
349 oval_object_content_type_tcxx . . $ oval_object_content_type_t# type = OVAL_OBJECTCONTENT_UNKNOWNcxx . . $ OVAL_OBJECTCONTENT_UNKNOWN.;
350 struct oval_object_contentcxx . . $ oval_object_content# *content;
351 int return_code = 0;
352
353 if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(tagname, "set")) {
354 type = OVAL_OBJECTCONTENT_SETcxx . . $ OVAL_OBJECTCONTENT_SET.;
355 } else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(tagname, "filter")) {
356 type = OVAL_OBJECTCONTENT_FILTERcxx . . $ OVAL_OBJECTCONTENT_FILTER.;
357 } else {
358 type = OVAL_OBJECTCONTENT_ENTITYcxx . . $ OVAL_OBJECTCONTENT_ENTITY.;
359 }
360
361 content = oval_object_content_newcxx . . $ oval_object_content_new(f618c6d08ff66bb4).(context->definition_modelcxx . . $ oval_parser_context#definition_model., type);
362 if (content == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
363 return -1;
364
365 content->fieldNamecxx . . $ oval_object_content#fieldName. = tagname;
366 switch (type) {
367 case OVAL_OBJECTCONTENT_ENTITYcxx . . $ OVAL_OBJECTCONTENT_ENTITY.:{
368 struct oval_object_content_ENTITYcxx . . $ oval_object_content_ENTITY# *content_entity =
369 (struct oval_object_content_ENTITYcxx . . $ oval_object_content_ENTITY# *)content;
370 return_code =
371 oval_entity_parse_tagcxx . . $ oval_entity_parse_tag(29f485c9b2aa6ded).(reader, context,
372 (oscap_consumer_funccxx . . $ oscap_consumer_func#) oval_consume_entitycxx . . $ oval_consume_entity(fb63e7ea941706c9)., content_entity);
373 content_entity->varCheckcxx . . $ oval_object_content_ENTITY#varCheck. = oval_check_parsecxx . . $ oval_check_parse(def8dff2972e216b).(reader, "var_check", OVAL_CHECK_ALLcxx . . $ OVAL_CHECK_ALL.);
374 };
375 break;
376 case OVAL_OBJECTCONTENT_SETcxx . . $ OVAL_OBJECTCONTENT_SET.:{
377 struct oval_object_content_SETcxx . . $ oval_object_content_SET# *content_set = (struct oval_object_content_SETcxx . . $ oval_object_content_SET# *)content;
378 return_code = oval_set_parse_tagcxx . . $ oval_set_parse_tag(7a8cf44dda28a204).(reader, context, &oval_consume_setcxx . . $ oval_consume_set(95e6f01b2aba5a24)., content_set);
379 };
380 break;
381 case OVAL_OBJECTCONTENT_FILTERcxx . . $ OVAL_OBJECTCONTENT_FILTER.:{
382 struct oval_object_content_FILTERcxx . . $ oval_object_content_FILTER# *content_filter =
383 (struct oval_object_content_FILTERcxx . . $ oval_object_content_FILTER# *) content;
384 return_code = oval_filter_parse_tagcxx . . $ oval_filter_parse_tag(12dbcd5e25ab57e3).(reader, context, &oval_consume_filtercxx . . $ oval_consume_filter(9ce7970ace097529)., content_filter);
385 };
386 break;
387 }
388
389 (*consumer) (content, user);
390
391 if (return_code != 0)
392 dWcxx . . $ `src/common/debug_priv.h:62:9`!("Parsing of <%s> terminated by an error at line %d.",tagname, xmlTextReaderGetParserLineNumber(reader));
393
394 freecxx . . $ free(5d22bdacc48458e8).(namespace);
395 return return_code;
396 }
397 //#pragma GCC diagnostic pop
398
399 xmlNodecxx . . $ xmlNode# *oval_object_content_to_domcxx . . $ oval_object_content_to_dom(9f5e58e14a2b26c7).(struct oval_object_contentcxx . . $ oval_object_content# *content, xmlDoccxx . . $ xmlDoc# * doc, xmlNodecxx . . $ xmlNode# * parent) {
400 xmlNodecxx . . $ xmlNode# *content_node;
401 switch (oval_object_content_get_typecxx . . $ oval_object_content_get_type(7a653648ed12be92).(content)) {
402 case OVAL_OBJECTCONTENT_ENTITYcxx . . $ OVAL_OBJECTCONTENT_ENTITY.:{
403 struct oval_entitycxx . . $ oval_entity# *entity = oval_object_content_get_entitycxx . . $ oval_object_content_get_entity(ecfb176ae958982e).(content);
404 content_node = oval_entity_to_domcxx . . $ oval_entity_to_dom(e76be2c7a3117d53).(entity, doc, parent);
405 oval_check_tcxx . . $ oval_check_t# check = oval_object_content_get_varCheckcxx . . $ oval_object_content_get_varCheck(c5e530c31d741904).(content);
406
407 if (check != OVAL_CHECK_ALLcxx . . $ OVAL_CHECK_ALL. || xmlHasPropcxx . . $ xmlHasProp(b74e98cace1a33d3).(content_node, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "var_ref"))
408 xmlNewPropcxx . . $ xmlNewProp(6ee5a6130c40eb8b).(content_node, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "var_check", BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! oval_check_get_textcxx . . $ oval_check_get_text(738477922eea9c02).(check));
409 }
410 break;
411 case OVAL_OBJECTCONTENT_SETcxx . . $ OVAL_OBJECTCONTENT_SET.:{
412 struct oval_setobjectcxx . . $ oval_setobject# *set = oval_object_content_get_setobjectcxx . . $ oval_object_content_get_setobject(25929015085a5f4).(content);
413 content_node = oval_set_to_domcxx . . $ oval_set_to_dom(1e7e3d09dec80fe0).(set, doc, parent);
414 } break;
415 case OVAL_OBJECTCONTENT_FILTERcxx . . $ OVAL_OBJECTCONTENT_FILTER.:{
416 struct oval_filtercxx . . $ oval_filter# *filter;
417
418 filter = oval_object_content_get_filtercxx . . $ oval_object_content_get_filter(ff2759e7c389f912).(content);
419 content_node = oval_filter_to_domcxx . . $ oval_filter_to_dom(20c739d1ed25bde8).(filter, doc, parent);
420 }
421 break;
422 default:
423 content_node = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
424 }
425
426 return content_node;
427 }