third_party/modest/source/mycss/values/destroy.c

filter: Statementstmt 0.0% 0 / 348 Branchbran 0.0% 0 / 204 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 0.0% 0 / 552 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« third_party/modest/source/mycss/values/consume.c ↑ Summary third_party/modest/source/mycss/values/image.c »
1 /*
2 Copyright (C) 2016-2017 Alexander Borisov
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
15 License along with this library; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
18 Author: lex.borisov@gmail.com (Alexander Borisov)
19 */
20  
21 #include "mycss/values/destroy.h"
22  
23 0 mycss_values_shorthand_two_type_t * mycss_values_destroy_shorthand_two_type(mycss_entry_t* entry, mycss_values_shorthand_two_type_t* value, bool self_destroy)
24 {
25 0 ▶ if(value == NULL)
Branch: 1 branch
BranchTrueFalseTotal
if(value == NULL) 0 0 0
26 0 return NULL;
27
28 /* wrong!!! */
29 // value->one = mycss_declaration_entry_destroy(entry->declaration, value->one, true);
30 // value->two = mycss_declaration_entry_destroy(entry->declaration, value->two, true);
31
32 0 ▶ if(self_destroy) {
Branch: 1 branch
BranchTrueFalseTotal
if(self_destroy) { 0 0 0
33 0 mycss_values_destroy(entry, (void*)value);
34 0 return NULL;
35 }
36
37 0 return value;
38 }
39  
40 0 mycss_values_shorthand_four_t * mycss_values_destroy_shorthand_four(mycss_entry_t* entry, mycss_values_shorthand_four_t* value, bool self_destroy)
41 {
42 0 ▶ if(value == NULL)
Branch: 1 branch
BranchTrueFalseTotal
if(value == NULL) 0 0 0
43 0 return NULL;
44
45 0 value->one = mycss_declaration_entry_destroy(entry->declaration, value->one, true);
46 0 value->two = mycss_declaration_entry_destroy(entry->declaration, value->two, true);
47 0 value->three = mycss_declaration_entry_destroy(entry->declaration, value->three, true);
48 0 value->four = mycss_declaration_entry_destroy(entry->declaration, value->four, true);
49
50 0 ▶ if(self_destroy) {
Branch: 1 branch
BranchTrueFalseTotal
if(self_destroy) { 0 0 0
51 0 mycss_values_destroy(entry, (void*)value);
52 0 return NULL;
53 }
54
55 0 return value;
56 }
57  
58 0 mycss_values_shorthand_two_t * mycss_values_destroy_shorthand_two(mycss_entry_t* entry, mycss_values_shorthand_two_t* value, bool self_destroy)
59 {
60 0 ▶ if(value == NULL)
Branch: 1 branch
BranchTrueFalseTotal
if(value == NULL) 0 0 0
61 0 return NULL;
62
63 0 value->one = mycss_declaration_entry_destroy(entry->declaration, value->one, true);
64 0 value->two = mycss_declaration_entry_destroy(entry->declaration, value->two, true);
65
66 0 ▶ if(self_destroy) {
Branch: 1 branch
BranchTrueFalseTotal
if(self_destroy) { 0 0 0
67 0 mycss_values_destroy(entry, (void*)value);
68 0 return NULL;
69 }
70
71 0 return value;
72 }
73  
74 0 mycss_values_number_t * mycss_values_destroy_number(mycss_entry_t* entry, mycss_values_number_t* value, bool self_destroy)
75 {
76 0 ▶ if(value == NULL)
Branch: 1 branch
BranchTrueFalseTotal
if(value == NULL) 0 0 0
77 0 return NULL;
78
79 0 ▶ if(self_destroy) {
Branch: 1 branch
BranchTrueFalseTotal
if(self_destroy) { 0 0 0
80 0 mycss_values_destroy(entry, (void*)value);
81 0 return NULL;
82 }
83
84 0 return value;
85 }
86  
87 0 mycss_values_length_t * mycss_values_destroy_length(mycss_entry_t* entry, mycss_values_length_t* value, bool self_destroy)
88 {
89 0 ▶ if(value == NULL)
Branch: 1 branch
BranchTrueFalseTotal
if(value == NULL) 0 0 0
90 0 return NULL;
91
92 0 ▶ if(self_destroy) {
Branch: 1 branch
BranchTrueFalseTotal
if(self_destroy) { 0 0 0
93 0 mycss_values_destroy(entry, (void*)value);
94 0 return NULL;
95 }
96
97 0 return value;
98 }
99  
100 0 mycss_values_percentage_t * mycss_values_destroy_percentage(mycss_entry_t* entry, mycss_values_percentage_t* value, bool self_destroy)
101 {
102 0 ▶ if(value == NULL)
Branch: 1 branch
BranchTrueFalseTotal
if(value == NULL) 0 0 0
103 0 return NULL;
104
105 0 ▶ if(self_destroy) {
Branch: 1 branch
BranchTrueFalseTotal
if(self_destroy) { 0 0 0
106 0 mycss_values_destroy(entry, (void*)value);
107 0 return NULL;
108 }
109
110 0 return value;
111 }
112  
113 0 mycss_values_angle_t * mycss_values_destroy_angle(mycss_entry_t* entry, mycss_values_angle_t* value, bool self_destroy)
114 {
115 0 ▶ if(value == NULL)
Branch: 1 branch
BranchTrueFalseTotal
if(value == NULL) 0 0 0
116 0 return NULL;
117
118 0 ▶ if(self_destroy) {
Branch: 1 branch
BranchTrueFalseTotal
if(self_destroy) { 0 0 0
119 0 mycss_values_destroy(entry, (void*)value);
120 0 return NULL;
121 }
122
123 0 return value;
124 }
125  
126 0 mycss_values_resolution_t * mycss_values_destroy_resolution(mycss_entry_t* entry, mycss_values_resolution_t* value, bool self_destroy)
127 {
128 0 ▶ if(value == NULL)
Branch: 1 branch
BranchTrueFalseTotal
if(value == NULL) 0 0 0
129 0 return NULL;
130
131 0 ▶ if(self_destroy) {
Branch: 1 branch
BranchTrueFalseTotal
if(self_destroy) { 0 0 0
132 0 mycss_values_destroy(entry, (void*)value);
133 0 return NULL;
134 }
135
136 0 return value;
137 }
138  
139 0 mycss_values_type_list_t * mycss_values_destroy_type_list(mycss_entry_t* entry, mycss_values_type_list_t* value, bool self_destroy)
140 {
141 0 ▶ if(value == NULL)
Branch: 1 branch
BranchTrueFalseTotal
if(value == NULL) 0 0 0
142 0 return NULL;
143
144 0 mycss_values_destroy(entry, (void*)value->entries);
145
146 0 ▶ if(self_destroy) {
Branch: 1 branch
BranchTrueFalseTotal
if(self_destroy) { 0 0 0
147 0 mycss_values_destroy(entry, (void*)value);
148 0 return NULL;
149 }
150
151 0 return value;
152 }
153  
154 /*
155 * Color
156 */
157 0 mycss_values_color_alpha_value_t * mycss_values_destroy_color_alpha_value(mycss_entry_t* entry, mycss_values_color_alpha_value_t* value, bool self_destroy)
158 {
159 0 ▶ if(value == NULL)
Branch: 1 branch
BranchTrueFalseTotal
if(value == NULL) 0 0 0
160 0 return NULL;
161
162 0 ▶ if(self_destroy) {
Branch: 1 branch
BranchTrueFalseTotal
if(self_destroy) { 0 0 0
163 0 mycss_values_destroy(entry, (void*)value);
164 0 return NULL;
165 }
166
167 0 return value;
168 }
169  
170 0 mycss_values_color_hue_value_t * mycss_values_destroy_color_hue_value(mycss_entry_t* entry, mycss_values_color_hue_value_t* value, bool self_destroy)
171 {
172 0 ▶ if(value == NULL)
Branch: 1 branch
BranchTrueFalseTotal
if(value == NULL) 0 0 0
173 0 return NULL;
174
175 0 ▶ if(self_destroy) {
Branch: 1 branch
BranchTrueFalseTotal
if(self_destroy) { 0 0 0
176 0 mycss_values_destroy(entry, (void*)value);
177 0 return NULL;
178 }
179
180 0 return value;
181 }
182  
183 0 mycss_values_color_hsla_t * mycss_values_destroy_color_hsla(mycss_entry_t* entry, mycss_values_color_hsla_t* value, bool self_destroy)
184 {
185 0 ▶ if(value == NULL)
Branch: 1 branch
BranchTrueFalseTotal
if(value == NULL) 0 0 0
186 0 return NULL;
187
188 0 ▶ if(self_destroy) {
Branch: 1 branch
BranchTrueFalseTotal
if(self_destroy) { 0 0 0
189 0 mycss_values_destroy(entry, (void*)value);
190 0 return NULL;
191 }
192
193 0 return value;
194 }
195  
196 0 mycss_values_color_hwb_t * mycss_values_destroy_color_hwb(mycss_entry_t* entry, mycss_values_color_hwb_t* value, bool self_destroy)
197 {
198 0 ▶ if(value == NULL)
Branch: 1 branch
BranchTrueFalseTotal
if(value == NULL) 0 0 0
199 0 return NULL;
200
201 0 ▶ if(self_destroy) {
Branch: 1 branch
BranchTrueFalseTotal
if(self_destroy) { 0 0 0
202 0 mycss_values_destroy(entry, (void*)value);
203 0 return NULL;
204 }
205
206 0 return value;
207 }
208  
209 0 mycss_values_color_gray_t * mycss_values_destroy_color_gray(mycss_entry_t* entry, mycss_values_color_gray_t* value, bool self_destroy)
210 {
211 0 ▶ if(value == NULL)
Branch: 1 branch
BranchTrueFalseTotal
if(value == NULL) 0 0 0
212 0 return NULL;
213
214 0 ▶ if(self_destroy) {
Branch: 1 branch
BranchTrueFalseTotal
if(self_destroy) { 0 0 0
215 0 mycss_values_destroy(entry, (void*)value);
216 0 return NULL;
217 }
218
219 0 return value;
220 }
221  
222 0 mycss_values_color_rgba_number_t * mycss_values_destroy_color_rgba_number(mycss_entry_t* entry, mycss_values_color_rgba_number_t* value, bool self_destroy)
223 {
224 0 ▶ if(value == NULL)
Branch: 1 branch
BranchTrueFalseTotal
if(value == NULL) 0 0 0
225 0 return NULL;
226
227 0 ▶ if(self_destroy) {
Branch: 1 branch
BranchTrueFalseTotal
if(self_destroy) { 0 0 0
228 0 mycss_values_destroy(entry, (void*)value);
229 0 return NULL;
230 }
231
232 0 return value;
233 }
234  
235 0 mycss_values_color_rgba_percentage_t * mycss_values_destroy_color_rgba_percentage(mycss_entry_t* entry, mycss_values_color_rgba_percentage_t* value, bool self_destroy)
236 {
237 0 ▶ if(value == NULL)
Branch: 1 branch
BranchTrueFalseTotal
if(value == NULL) 0 0 0
238 0 return NULL;
239
240 0 ▶ if(self_destroy) {
Branch: 1 branch
BranchTrueFalseTotal
if(self_destroy) { 0 0 0
241 0 mycss_values_destroy(entry, (void*)value);
242 0 return NULL;
243 }
244
245 0 return value;
246 }
247  
248 0 mycss_values_color_t * mycss_values_destroy_color(mycss_entry_t* entry, mycss_values_color_t* value, bool self_destroy)
249 {
250 0 ▶ if(value == NULL)
Branch: 1 branch
BranchTrueFalseTotal
if(value == NULL) 0 0 0
251 0 return NULL;
252
253 0 ▶ if(self_destroy) {
Branch: 1 branch
BranchTrueFalseTotal
if(self_destroy) { 0 0 0
254 0 mycss_values_destroy(entry, (void*)value);
255 0 return NULL;
256 }
257
258 0 return value;
259 }
260  
261 /*
262 * Font
263 */
264 0 mycss_values_font_family_entry_t * mycss_values_destroy_font_family_entry(mycss_entry_t* entry, mycss_values_font_family_entry_t* value, bool self_destroy)
265 {
266 0 ▶ if(value == NULL)
Branch: 1 branch
BranchTrueFalseTotal
if(value == NULL) 0 0 0
267 0 return NULL;
268
269 0 ▶ if(self_destroy) {
Branch: 1 branch
BranchTrueFalseTotal
if(self_destroy) { 0 0 0
270 0 mycss_values_destroy(entry, (void*)value);
271 0 return NULL;
272 }
273
274 0 return value;
275 }
276  
277 0 mycss_values_font_family_t * mycss_values_destroy_font_family(mycss_entry_t* entry, mycss_values_font_family_t* value, bool self_destroy)
278 {
279 0 ▶ if(value == NULL)
Branch: 1 branch
BranchTrueFalseTotal
if(value == NULL) 0 0 0
280 0 return NULL;
281
282 0 value->entries_length = 0;
283 0 value->entries = mycss_values_destroy(entry, (void*)value->entries);
284
285 0 ▶ if(self_destroy) {
Branch: 1 branch
BranchTrueFalseTotal
if(self_destroy) { 0 0 0
286 0 mycss_values_destroy(entry, (void*)value);
287 0 return NULL;
288 }
289
290 0 return value;
291 }
292  
293 0 mycss_values_font_t * mycss_values_destroy_font(mycss_entry_t* entry, mycss_values_font_t* value, bool self_destroy)
294 {
295 0 ▶ if(value == NULL)
Branch: 1 branch
BranchTrueFalseTotal
if(value == NULL) 0 0 0
296 0 return NULL;
297
298 0 value->style = mycss_declaration_entry_destroy(entry->declaration, value->style, true);
299 0 value->weight = mycss_declaration_entry_destroy(entry->declaration, value->weight, true);
300 0 value->stretch = mycss_declaration_entry_destroy(entry->declaration, value->stretch, true);
301 0 value->size = mycss_declaration_entry_destroy(entry->declaration, value->size, true);
302 0 value->family = mycss_declaration_entry_destroy(entry->declaration, value->family, true);
303 0 value->line_height = mycss_declaration_entry_destroy(entry->declaration, value->line_height, true);
304
305 0 ▶ if(self_destroy) {
Branch: 1 branch
BranchTrueFalseTotal
if(self_destroy) { 0 0 0
306 0 mycss_values_destroy(entry, (void*)value);
307 0 return NULL;
308 }
309
310 0 return value;
311 }
312  
313 /*
314 * Text Decoration
315 */
316 0 mycss_values_text_decoration_t * mycss_values_destroy_text_decoration(mycss_entry_t* entry, mycss_values_text_decoration_t* value, bool self_destroy)
317 {
318 0 ▶ if(value == NULL)
Branch: 1 branch
BranchTrueFalseTotal
if(value == NULL) 0 0 0
319 0 return NULL;
320
321 0 value->style = mycss_declaration_entry_destroy(entry->declaration, value->style, true);
322 0 value->line = mycss_declaration_entry_destroy(entry->declaration, value->line, true);
323 0 value->color = mycss_declaration_entry_destroy(entry->declaration, value->color, true);
324
325 0 ▶ if(self_destroy) {
Branch: 1 branch
BranchTrueFalseTotal
if(self_destroy) { 0 0 0
326 0 mycss_values_destroy(entry, (void*)value);
327 0 return NULL;
328 }
329
330 0 return value;
331 }
332  
333 /*
334 * String
335 */
336 0 mycore_string_t * mycss_values_destroy_string(mycss_entry_t* entry, mycore_string_t* value, bool self_destroy)
337 {
338 0 ▶ if(value == NULL)
Branch: 1 branch
BranchTrueFalseTotal
if(value == NULL) 0 0 0
339 0 return NULL;
340
341 0 mycore_string_destroy(value, false);
342
343 0 ▶ if(self_destroy) {
Branch: 1 branch
BranchTrueFalseTotal
if(self_destroy) { 0 0 0
344 0 mycss_values_destroy(entry, (void*)value);
345 0 return NULL;
346 }
347
348 0 return value;
349 }
350  
351 /*
352 * URL
353 */
354 0 mycss_values_url_t * mycss_values_destroy_url(mycss_entry_t* entry, mycss_values_url_t* value, bool self_destroy)
355 {
356 0 ▶ if(value == NULL)
Branch: 1 branch
BranchTrueFalseTotal
if(value == NULL) 0 0 0
357 0 return NULL;
358
359 0 ▶ if(value->str.data)
Branch: 1 branch
BranchTrueFalseTotal
if(value->str.data) 0 0 0
360 0 mycss_values_destroy_string(entry, &value->str, false);
361
362 0 ▶ if(self_destroy) {
Branch: 1 branch
BranchTrueFalseTotal
if(self_destroy) { 0 0 0
363 0 mycss_values_destroy(entry, (void*)value);
364 0 return NULL;
365 }
366
367 0 return value;
368 }
369  
370 /*
371 * Image
372 */
373 0 mycss_values_image_t * mycss_values_destroy_image(mycss_entry_t* entry, mycss_values_image_t* image, bool self_destroy)
374 {
375 0 ▶ if(image == NULL)
Branch: 1 branch
BranchTrueFalseTotal
if(image == NULL) 0 0 0
376 0 return NULL;
377
378 0 switch (image->type) {
379 0 case MyCSS_PROPERTY_VALUE__URL:
380 0 image->value.url = mycss_values_destroy_url(entry, image->value.url, true);
381 0 break;
382
383 0 case MyCSS_PROPERTY_VALUE__IMAGE_FUNCTION:
384 0 image->value.ii = mycss_values_destroy_image_image(entry, image->value.ii, true);
385 0 break;
386
387 0 case MyCSS_PROPERTY_VALUE__IMAGE_SET_FUNCTION:
388 0 image->value.ii_set = mycss_values_destroy_image_image_set(entry, image->value.ii_set, true);
389 0 break;
390
391 0 case MyCSS_PROPERTY_VALUE__ELEMENT_FUNCTION:
392 0 image->value.element = mycss_values_destroy_element(entry, image->value.element, true);
393 0 break;
394
395 0 case MyCSS_PROPERTY_VALUE__CROSS_FADE_FUNCTION:
396 0 image->value.cross_fade = mycss_values_destroy_cross_fade(entry, image->value.cross_fade, true);
397 0 break;
398
399 0 default:
400 0 break;
401 }
402
403 0 ▶ if(self_destroy) {
Branch: 1 branch
BranchTrueFalseTotal
if(self_destroy) { 0 0 0
404 0 mycss_values_destroy(entry, (void*)image);
405 0 return NULL;
406 }
407
408 0 return image;
409 }
410  
411 0 mycss_values_image_image_t * mycss_values_destroy_image_image(mycss_entry_t* entry, mycss_values_image_image_t* value, bool self_destroy)
412 {
413 0 ▶ if(value == NULL)
Branch: 1 branch
BranchTrueFalseTotal
if(value == NULL) 0 0 0
414 0 return NULL;
415
416 0 ▶ if(value->image)
Branch: 1 branch
BranchTrueFalseTotal
if(value->image) 0 0 0
417 0 mycss_values_destroy_image(entry, value->image, true);
418
419 0 ▶ if(value->str)
Branch: 1 branch
BranchTrueFalseTotal
if(value->str) 0 0 0
420 0 mycss_values_destroy_string(entry, value->str, true);
421
422 0 ▶ if(value->color)
Branch: 1 branch
BranchTrueFalseTotal
if(value->color) 0 0 0
423 0 mycss_values_destroy_color(entry, value->color, true);
424
425 0 ▶ if(self_destroy) {
Branch: 1 branch
BranchTrueFalseTotal
if(self_destroy) { 0 0 0
426 0 mycss_values_destroy(entry, (void*)value);
427 0 return NULL;
428 }
429
430 0 return value;
431 }
432  
433 0 mycss_values_image_image_set_t * mycss_values_destroy_image_image_set(mycss_entry_t* entry, mycss_values_image_image_set_t* value, bool self_destroy)
434 {
435 0 ▶ if(value == NULL)
Branch: 1 branch
BranchTrueFalseTotal
if(value == NULL) 0 0 0
436 0 return NULL;
437
438 0 ▶ for(size_t i = 0; i < value->options_length; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for(size_t i = 0; i < value->options_length; i++) { 0 0 0
439 0 mycss_values_image_image_set_option_t* option = &value->options[i];
440
441 0 ▶ if(option->image)
Branch: 1 branch
BranchTrueFalseTotal
if(option->image) 0 0 0
442 0 mycss_values_destroy_image(entry, option->image, true);
443
444 0 ▶ if(option->str)
Branch: 1 branch
BranchTrueFalseTotal
if(option->str) 0 0 0
445 0 mycss_values_destroy_string(entry, option->str, true);
446
447 0 ▶ if(option->resolution)
Branch: 1 branch
BranchTrueFalseTotal
if(option->resolution) 0 0 0
448 0 mycss_values_destroy_resolution(entry, option->resolution, true);
449 }
450
451 0 mycss_values_destroy(entry, (void*)value->options);
452
453 0 ▶ if(self_destroy) {
Branch: 1 branch
BranchTrueFalseTotal
if(self_destroy) { 0 0 0
454 0 mycss_values_destroy(entry, (void*)value);
455 0 return NULL;
456 }
457
458 0 return value;
459 }
460  
461 0 mycss_values_element_t * mycss_values_destroy_element(mycss_entry_t* entry, mycss_values_element_t* value, bool self_destroy)
462 {
463 0 ▶ if(value == NULL)
Branch: 1 branch
BranchTrueFalseTotal
if(value == NULL) 0 0 0
464 0 return NULL;
465
466 0 mycss_values_destroy_string(entry, &value->custom_ident.str, true);
467
468 0 ▶ if(self_destroy) {
Branch: 1 branch
BranchTrueFalseTotal
if(self_destroy) { 0 0 0
469 0 mycss_values_destroy(entry, (void*)value);
470 0 return NULL;
471 }
472
473 0 return value;
474 }
475  
476 0 mycss_values_cross_fade_t * mycss_values_destroy_cross_fade(mycss_entry_t* entry, mycss_values_cross_fade_t* value, bool self_destroy)
477 {
478 0 ▶ if(value == NULL)
Branch: 1 branch
BranchTrueFalseTotal
if(value == NULL) 0 0 0
479 0 return NULL;
480
481 0 ▶ if(value->mixing_image.image)
Branch: 1 branch
BranchTrueFalseTotal
if(value->mixing_image.image) 0 0 0
482 0 mycss_values_destroy_image(entry, value->mixing_image.image, true);
483
484 0 ▶ if(value->mixing_image.percentage)
Branch: 1 branch
BranchTrueFalseTotal
if(value->mixing_image.percentage) 0 0 0
485 0 mycss_values_destroy_percentage(entry, value->mixing_image.percentage, true);
486
487 0 ▶ if(value->final_image.image)
Branch: 1 branch
BranchTrueFalseTotal
if(value->final_image.image) 0 0 0
488 0 mycss_values_destroy_image(entry, value->final_image.image, true);
489
490 0 ▶ if(value->final_image.color)
Branch: 1 branch
BranchTrueFalseTotal
if(value->final_image.color) 0 0 0
491 0 mycss_values_destroy_color(entry, value->final_image.color, true);
492
493 0 ▶ if(self_destroy) {
Branch: 1 branch
BranchTrueFalseTotal
if(self_destroy) { 0 0 0
494 0 mycss_values_destroy(entry, (void*)value);
495 0 return NULL;
496 }
497
498 0 return value;
499 }
500  
501 /*
502 * Image List
503 */
504 0 mycss_values_image_list_t * mycss_values_destroy_image_list(mycss_entry_t* entry, mycss_values_image_list_t* value, bool self_destroy)
505 {
506 0 ▶ if(value == NULL)
Branch: 1 branch
BranchTrueFalseTotal
if(value == NULL) 0 0 0
507 0 return NULL;
508
509 0 ▶ for(size_t i = 0; i < value->images_length; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for(size_t i = 0; i < value->images_length; i++) { 0 0 0
510 0 mycss_values_destroy_image(entry, &value->images[i], false);
511 }
512
513 0 mycss_values_destroy(entry, (void*)value->images);
514
515 0 ▶ if(self_destroy) {
Branch: 1 branch
BranchTrueFalseTotal
if(self_destroy) { 0 0 0
516 0 mycss_values_destroy(entry, (void*)value);
517 0 return NULL;
518 }
519
520 0 return value;
521 }
522  
523 /*
524 * Background
525 */
526 0 mycss_values_background_repeat_list_t * mycss_values_destroy_background_repeat(mycss_entry_t* entry, mycss_values_background_repeat_list_t* value, bool self_destroy)
527 {
528 0 ▶ if(value == NULL)
Branch: 1 branch
BranchTrueFalseTotal
if(value == NULL) 0 0 0
529 0 return NULL;
530
531 0 mycss_values_destroy(entry, (void*)value->entries);
532
533 0 ▶ if(self_destroy) {
Branch: 1 branch
BranchTrueFalseTotal
if(self_destroy) { 0 0 0
534 0 mycss_values_destroy(entry, (void*)value);
535 0 return NULL;
536 }
537
538 0 return value;
539 }
540  
541 0 mycss_values_background_position_t * mycss_values_destroy_background_position(mycss_entry_t* entry, mycss_values_background_position_t* value, bool self_destroy)
542 {
543 0 ▶ if(value == NULL)
Branch: 1 branch
BranchTrueFalseTotal
if(value == NULL) 0 0 0
544 0 return NULL;
545
546 0 ▶ if(value->one.value.length) {
Branch: 1 branch
BranchTrueFalseTotal
if(value->one.value.length) { 0 0 0
547 0 mycss_values_destroy(entry, (void*)value->one.value.length);
548 }
549
550 0 ▶ if(value->two.value.length) {
Branch: 1 branch
BranchTrueFalseTotal
if(value->two.value.length) { 0 0 0
551 0 mycss_values_destroy(entry, (void*)value->two.value.length);
552 }
553
554 0 ▶ if(value->three.value.length) {
Branch: 1 branch
BranchTrueFalseTotal
if(value->three.value.length) { 0 0 0
555 0 mycss_values_destroy(entry, (void*)value->three.value.length);
556 }
557
558 0 ▶ if(value->four.value.length) {
Branch: 1 branch
BranchTrueFalseTotal
if(value->four.value.length) { 0 0 0
559 0 mycss_values_destroy(entry, (void*)value->four.value.length);
560 }
561
562 0 ▶ if(self_destroy) {
Branch: 1 branch
BranchTrueFalseTotal
if(self_destroy) { 0 0 0
563 0 mycss_values_destroy(entry, (void*)value);
564 0 return NULL;
565 }
566
567 0 return value;
568 }
569  
570 0 mycss_values_background_size_list_t * mycss_values_destroy_background_size(mycss_entry_t* entry, mycss_values_background_size_list_t* value, bool self_destroy)
571 {
572 0 ▶ if(value == NULL)
Branch: 1 branch
BranchTrueFalseTotal
if(value == NULL) 0 0 0
573 0 return NULL;
574
575 0 ▶ for(size_t i = 0; i < value->entries_length; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for(size_t i = 0; i < value->entries_length; i++) { 0 0 0
576 0 ▶ if(value->entries[i].width) {
Branch: 1 branch
BranchTrueFalseTotal
if(value->entries[i].width) { 0 0 0
577 0 ▶ if(value->entries[i].width->value.percentage)
Branch: 1 branch
BranchTrueFalseTotal
if(value->entries[i].width->value.percentage) 0 0 0
578 0 mycss_values_destroy(entry, (void*)value->entries[i].width->value.percentage);
579
580 0 mycss_values_destroy(entry, (void*)value->entries[i].width);
581 }
582
583 0 ▶ if(value->entries[i].height) {
Branch: 1 branch
BranchTrueFalseTotal
if(value->entries[i].height) { 0 0 0
584 0 ▶ if(value->entries[i].height->value.percentage)
Branch: 1 branch
BranchTrueFalseTotal
if(value->entries[i].height->value.percentage) 0 0 0
585 0 mycss_values_destroy(entry, (void*)value->entries[i].height->value.percentage);
586
587 0 mycss_values_destroy(entry, (void*)value->entries[i].height);
588 }
589 }
590
591 0 mycss_values_destroy(entry, (void*)value->entries);
592
593 0 ▶ if(self_destroy) {
Branch: 1 branch
BranchTrueFalseTotal
if(self_destroy) { 0 0 0
594 0 mycss_values_destroy(entry, (void*)value);
595 0 return NULL;
596 }
597
598 0 return value;
599 }
600  
601 0 mycss_values_background_list_t * mycss_values_destroy_background(mycss_entry_t* entry, mycss_values_background_list_t* value, bool self_destroy)
602 {
603 0 ▶ if(value == NULL)
Branch: 1 branch
BranchTrueFalseTotal
if(value == NULL) 0 0 0
604 0 return NULL;
605
606 mycss_values_background_t* bg_entry;
607
608 0 ▶ for(size_t i = 0; i < value->entries_length; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for(size_t i = 0; i < value->entries_length; i++) { 0 0 0
609 0 bg_entry = &value->entries[i];
610
611 0 ▶ if(bg_entry->color)
Branch: 1 branch
BranchTrueFalseTotal
if(bg_entry->color) 0 0 0
612 0 mycss_values_destroy_color(entry, bg_entry->color->value, true);
613 0 ▶ if(bg_entry->image)
Branch: 1 branch
BranchTrueFalseTotal
if(bg_entry->image) 0 0 0
614 0 mycss_values_destroy_image(entry, bg_entry->image->value, true);
615 0 ▶ if(bg_entry->position)
Branch: 1 branch
BranchTrueFalseTotal
if(bg_entry->position) 0 0 0
616 0 mycss_values_destroy_background_position(entry, bg_entry->position->value, true);
617 0 ▶ if(bg_entry->size)
Branch: 1 branch
BranchTrueFalseTotal
if(bg_entry->size) 0 0 0
618 0 mycss_values_destroy_background_size(entry, bg_entry->size->value, true);
619 0 ▶ if(bg_entry->repeat)
Branch: 1 branch
BranchTrueFalseTotal
if(bg_entry->repeat) 0 0 0
620 0 mycss_values_destroy_background_repeat(entry, bg_entry->repeat->value, true);
621 0 ▶ if(bg_entry->attachment)
Branch: 1 branch
BranchTrueFalseTotal
if(bg_entry->attachment) 0 0 0
622 0 mycss_values_destroy_type_list(entry, bg_entry->attachment->value, true);
623 0 ▶ if(bg_entry->clip)
Branch: 1 branch
BranchTrueFalseTotal
if(bg_entry->clip) 0 0 0
624 0 mycss_values_destroy_type_list(entry, bg_entry->clip->value, true);
625 0 ▶ if(bg_entry->origin)
Branch: 1 branch
BranchTrueFalseTotal
if(bg_entry->origin) 0 0 0
626 0 mycss_values_destroy_type_list(entry, bg_entry->origin->value, true);
627 }
628
629 0 mycss_values_destroy(entry, (void*)value->entries);
630
631 0 ▶ if(self_destroy) {
Branch: 1 branch
BranchTrueFalseTotal
if(self_destroy) { 0 0 0
632 0 mycss_values_destroy(entry, (void*)value);
633 0 return NULL;
634 }
635
636 0 return value;
637 }
638  
639 /*
640 * Border
641 */
642 0 mycss_values_border_t * mycss_values_destroy_border(mycss_entry_t* entry, mycss_values_border_t* value, bool self_destroy)
643 {
644 0 ▶ if(value == NULL)
Branch: 1 branch
BranchTrueFalseTotal
if(value == NULL) 0 0 0
645 0 return NULL;
646
647 0 ▶ if(value->width)
Branch: 1 branch
BranchTrueFalseTotal
if(value->width) 0 0 0
648 0 value->width = mycss_declaration_entry_destroy(entry->declaration, value->width, true);
649
650 0 ▶ if(value->style)
Branch: 1 branch
BranchTrueFalseTotal
if(value->style) 0 0 0
651 0 value->style = mycss_declaration_entry_destroy(entry->declaration, value->style, true);
652
653 0 ▶ if(value->color)
Branch: 1 branch
BranchTrueFalseTotal
if(value->color) 0 0 0
654 0 value->color = mycss_declaration_entry_destroy(entry->declaration, value->color, true);
655
656 0 ▶ if(self_destroy) {
Branch: 1 branch
BranchTrueFalseTotal
if(self_destroy) { 0 0 0
657 0 mycss_values_destroy(entry, (void*)value);
658 0 return NULL;
659 }
660
661 0 return value;
662 }
663  
664  
« third_party/modest/source/mycss/values/consume.c ↑ Summary third_party/modest/source/mycss/values/image.c »