line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
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
|
0
|
|
|
|
|
if(value == NULL) |
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
|
0
|
|
|
|
|
if(self_destroy) { |
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
|
0
|
|
|
|
|
if(value == NULL) |
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
|
0
|
|
|
|
|
if(self_destroy) { |
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
|
0
|
|
|
|
|
if(value == NULL) |
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
|
0
|
|
|
|
|
if(self_destroy) { |
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
|
0
|
|
|
|
|
if(value == NULL) |
77
|
0
|
|
|
|
|
|
return NULL; |
78
|
|
|
|
|
|
|
|
79
|
0
|
0
|
|
|
|
|
if(self_destroy) { |
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
|
0
|
|
|
|
|
if(value == NULL) |
90
|
0
|
|
|
|
|
|
return NULL; |
91
|
|
|
|
|
|
|
|
92
|
0
|
0
|
|
|
|
|
if(self_destroy) { |
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
|
0
|
|
|
|
|
if(value == NULL) |
103
|
0
|
|
|
|
|
|
return NULL; |
104
|
|
|
|
|
|
|
|
105
|
0
|
0
|
|
|
|
|
if(self_destroy) { |
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
|
0
|
|
|
|
|
if(value == NULL) |
116
|
0
|
|
|
|
|
|
return NULL; |
117
|
|
|
|
|
|
|
|
118
|
0
|
0
|
|
|
|
|
if(self_destroy) { |
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
|
0
|
|
|
|
|
if(value == NULL) |
129
|
0
|
|
|
|
|
|
return NULL; |
130
|
|
|
|
|
|
|
|
131
|
0
|
0
|
|
|
|
|
if(self_destroy) { |
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
|
0
|
|
|
|
|
if(value == NULL) |
142
|
0
|
|
|
|
|
|
return NULL; |
143
|
|
|
|
|
|
|
|
144
|
0
|
|
|
|
|
|
mycss_values_destroy(entry, (void*)value->entries); |
145
|
|
|
|
|
|
|
|
146
|
0
|
0
|
|
|
|
|
if(self_destroy) { |
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
|
0
|
|
|
|
|
if(value == NULL) |
160
|
0
|
|
|
|
|
|
return NULL; |
161
|
|
|
|
|
|
|
|
162
|
0
|
0
|
|
|
|
|
if(self_destroy) { |
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
|
0
|
|
|
|
|
if(value == NULL) |
173
|
0
|
|
|
|
|
|
return NULL; |
174
|
|
|
|
|
|
|
|
175
|
0
|
0
|
|
|
|
|
if(self_destroy) { |
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
|
0
|
|
|
|
|
if(value == NULL) |
186
|
0
|
|
|
|
|
|
return NULL; |
187
|
|
|
|
|
|
|
|
188
|
0
|
0
|
|
|
|
|
if(self_destroy) { |
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
|
0
|
|
|
|
|
if(value == NULL) |
199
|
0
|
|
|
|
|
|
return NULL; |
200
|
|
|
|
|
|
|
|
201
|
0
|
0
|
|
|
|
|
if(self_destroy) { |
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
|
0
|
|
|
|
|
if(value == NULL) |
212
|
0
|
|
|
|
|
|
return NULL; |
213
|
|
|
|
|
|
|
|
214
|
0
|
0
|
|
|
|
|
if(self_destroy) { |
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
|
0
|
|
|
|
|
if(value == NULL) |
225
|
0
|
|
|
|
|
|
return NULL; |
226
|
|
|
|
|
|
|
|
227
|
0
|
0
|
|
|
|
|
if(self_destroy) { |
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
|
0
|
|
|
|
|
if(value == NULL) |
238
|
0
|
|
|
|
|
|
return NULL; |
239
|
|
|
|
|
|
|
|
240
|
0
|
0
|
|
|
|
|
if(self_destroy) { |
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
|
0
|
|
|
|
|
if(value == NULL) |
251
|
0
|
|
|
|
|
|
return NULL; |
252
|
|
|
|
|
|
|
|
253
|
0
|
0
|
|
|
|
|
if(self_destroy) { |
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
|
0
|
|
|
|
|
if(value == NULL) |
267
|
0
|
|
|
|
|
|
return NULL; |
268
|
|
|
|
|
|
|
|
269
|
0
|
0
|
|
|
|
|
if(self_destroy) { |
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
|
0
|
|
|
|
|
if(value == NULL) |
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
|
0
|
|
|
|
|
if(self_destroy) { |
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
|
0
|
|
|
|
|
if(value == NULL) |
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
|
0
|
|
|
|
|
if(self_destroy) { |
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
|
0
|
|
|
|
|
if(value == NULL) |
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
|
0
|
|
|
|
|
if(self_destroy) { |
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
|
0
|
|
|
|
|
if(value == NULL) |
339
|
0
|
|
|
|
|
|
return NULL; |
340
|
|
|
|
|
|
|
|
341
|
0
|
|
|
|
|
|
mycore_string_destroy(value, false); |
342
|
|
|
|
|
|
|
|
343
|
0
|
0
|
|
|
|
|
if(self_destroy) { |
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
|
0
|
|
|
|
|
if(value == NULL) |
357
|
0
|
|
|
|
|
|
return NULL; |
358
|
|
|
|
|
|
|
|
359
|
0
|
0
|
|
|
|
|
if(value->str.data) |
360
|
0
|
|
|
|
|
|
mycss_values_destroy_string(entry, &value->str, false); |
361
|
|
|
|
|
|
|
|
362
|
0
|
0
|
|
|
|
|
if(self_destroy) { |
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
|
0
|
|
|
|
|
if(image == NULL) |
376
|
0
|
|
|
|
|
|
return NULL; |
377
|
|
|
|
|
|
|
|
378
|
0
|
|
|
|
|
|
switch (image->type) { |
379
|
|
|
|
|
|
|
case MyCSS_PROPERTY_VALUE__URL: |
380
|
0
|
|
|
|
|
|
image->value.url = mycss_values_destroy_url(entry, image->value.url, true); |
381
|
0
|
|
|
|
|
|
break; |
382
|
|
|
|
|
|
|
|
383
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
default: |
400
|
0
|
|
|
|
|
|
break; |
401
|
|
|
|
|
|
|
} |
402
|
|
|
|
|
|
|
|
403
|
0
|
0
|
|
|
|
|
if(self_destroy) { |
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
|
0
|
|
|
|
|
if(value == NULL) |
414
|
0
|
|
|
|
|
|
return NULL; |
415
|
|
|
|
|
|
|
|
416
|
0
|
0
|
|
|
|
|
if(value->image) |
417
|
0
|
|
|
|
|
|
mycss_values_destroy_image(entry, value->image, true); |
418
|
|
|
|
|
|
|
|
419
|
0
|
0
|
|
|
|
|
if(value->str) |
420
|
0
|
|
|
|
|
|
mycss_values_destroy_string(entry, value->str, true); |
421
|
|
|
|
|
|
|
|
422
|
0
|
0
|
|
|
|
|
if(value->color) |
423
|
0
|
|
|
|
|
|
mycss_values_destroy_color(entry, value->color, true); |
424
|
|
|
|
|
|
|
|
425
|
0
|
0
|
|
|
|
|
if(self_destroy) { |
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
|
0
|
|
|
|
|
if(value == NULL) |
436
|
0
|
|
|
|
|
|
return NULL; |
437
|
|
|
|
|
|
|
|
438
|
0
|
0
|
|
|
|
|
for(size_t i = 0; i < value->options_length; i++) { |
439
|
0
|
|
|
|
|
|
mycss_values_image_image_set_option_t* option = &value->options[i]; |
440
|
|
|
|
|
|
|
|
441
|
0
|
0
|
|
|
|
|
if(option->image) |
442
|
0
|
|
|
|
|
|
mycss_values_destroy_image(entry, option->image, true); |
443
|
|
|
|
|
|
|
|
444
|
0
|
0
|
|
|
|
|
if(option->str) |
445
|
0
|
|
|
|
|
|
mycss_values_destroy_string(entry, option->str, true); |
446
|
|
|
|
|
|
|
|
447
|
0
|
0
|
|
|
|
|
if(option->resolution) |
448
|
0
|
|
|
|
|
|
mycss_values_destroy_resolution(entry, option->resolution, true); |
449
|
|
|
|
|
|
|
} |
450
|
|
|
|
|
|
|
|
451
|
0
|
|
|
|
|
|
mycss_values_destroy(entry, (void*)value->options); |
452
|
|
|
|
|
|
|
|
453
|
0
|
0
|
|
|
|
|
if(self_destroy) { |
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
|
0
|
|
|
|
|
if(value == NULL) |
464
|
0
|
|
|
|
|
|
return NULL; |
465
|
|
|
|
|
|
|
|
466
|
0
|
|
|
|
|
|
mycss_values_destroy_string(entry, &value->custom_ident.str, true); |
467
|
|
|
|
|
|
|
|
468
|
0
|
0
|
|
|
|
|
if(self_destroy) { |
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
|
0
|
|
|
|
|
if(value == NULL) |
479
|
0
|
|
|
|
|
|
return NULL; |
480
|
|
|
|
|
|
|
|
481
|
0
|
0
|
|
|
|
|
if(value->mixing_image.image) |
482
|
0
|
|
|
|
|
|
mycss_values_destroy_image(entry, value->mixing_image.image, true); |
483
|
|
|
|
|
|
|
|
484
|
0
|
0
|
|
|
|
|
if(value->mixing_image.percentage) |
485
|
0
|
|
|
|
|
|
mycss_values_destroy_percentage(entry, value->mixing_image.percentage, true); |
486
|
|
|
|
|
|
|
|
487
|
0
|
0
|
|
|
|
|
if(value->final_image.image) |
488
|
0
|
|
|
|
|
|
mycss_values_destroy_image(entry, value->final_image.image, true); |
489
|
|
|
|
|
|
|
|
490
|
0
|
0
|
|
|
|
|
if(value->final_image.color) |
491
|
0
|
|
|
|
|
|
mycss_values_destroy_color(entry, value->final_image.color, true); |
492
|
|
|
|
|
|
|
|
493
|
0
|
0
|
|
|
|
|
if(self_destroy) { |
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
|
0
|
|
|
|
|
if(value == NULL) |
507
|
0
|
|
|
|
|
|
return NULL; |
508
|
|
|
|
|
|
|
|
509
|
0
|
0
|
|
|
|
|
for(size_t i = 0; i < value->images_length; i++) { |
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
|
0
|
|
|
|
|
if(self_destroy) { |
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
|
0
|
|
|
|
|
if(value == NULL) |
529
|
0
|
|
|
|
|
|
return NULL; |
530
|
|
|
|
|
|
|
|
531
|
0
|
|
|
|
|
|
mycss_values_destroy(entry, (void*)value->entries); |
532
|
|
|
|
|
|
|
|
533
|
0
|
0
|
|
|
|
|
if(self_destroy) { |
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
|
0
|
|
|
|
|
if(value == NULL) |
544
|
0
|
|
|
|
|
|
return NULL; |
545
|
|
|
|
|
|
|
|
546
|
0
|
0
|
|
|
|
|
if(value->one.value.length) { |
547
|
0
|
|
|
|
|
|
mycss_values_destroy(entry, (void*)value->one.value.length); |
548
|
|
|
|
|
|
|
} |
549
|
|
|
|
|
|
|
|
550
|
0
|
0
|
|
|
|
|
if(value->two.value.length) { |
551
|
0
|
|
|
|
|
|
mycss_values_destroy(entry, (void*)value->two.value.length); |
552
|
|
|
|
|
|
|
} |
553
|
|
|
|
|
|
|
|
554
|
0
|
0
|
|
|
|
|
if(value->three.value.length) { |
555
|
0
|
|
|
|
|
|
mycss_values_destroy(entry, (void*)value->three.value.length); |
556
|
|
|
|
|
|
|
} |
557
|
|
|
|
|
|
|
|
558
|
0
|
0
|
|
|
|
|
if(value->four.value.length) { |
559
|
0
|
|
|
|
|
|
mycss_values_destroy(entry, (void*)value->four.value.length); |
560
|
|
|
|
|
|
|
} |
561
|
|
|
|
|
|
|
|
562
|
0
|
0
|
|
|
|
|
if(self_destroy) { |
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
|
0
|
|
|
|
|
if(value == NULL) |
573
|
0
|
|
|
|
|
|
return NULL; |
574
|
|
|
|
|
|
|
|
575
|
0
|
0
|
|
|
|
|
for(size_t i = 0; i < value->entries_length; i++) { |
576
|
0
|
0
|
|
|
|
|
if(value->entries[i].width) { |
577
|
0
|
0
|
|
|
|
|
if(value->entries[i].width->value.percentage) |
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
|
0
|
|
|
|
|
if(value->entries[i].height) { |
584
|
0
|
0
|
|
|
|
|
if(value->entries[i].height->value.percentage) |
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
|
0
|
|
|
|
|
if(self_destroy) { |
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_t * mycss_values_destroy_background(mycss_entry_t* entry, mycss_values_background_t* value, bool self_destroy) |
602
|
|
|
|
|
|
|
{ |
603
|
0
|
0
|
|
|
|
|
if(value == NULL) |
604
|
0
|
|
|
|
|
|
return NULL; |
605
|
|
|
|
|
|
|
|
606
|
0
|
0
|
|
|
|
|
if(value->color) |
607
|
0
|
|
|
|
|
|
mycss_values_destroy_color(entry, value->color->value, true); |
608
|
0
|
0
|
|
|
|
|
if(value->image) |
609
|
0
|
|
|
|
|
|
mycss_values_destroy_image(entry, value->image->value, true); |
610
|
0
|
0
|
|
|
|
|
if(value->position) |
611
|
0
|
|
|
|
|
|
mycss_values_destroy_background_position(entry, value->position->value, true); |
612
|
0
|
0
|
|
|
|
|
if(value->size) |
613
|
0
|
|
|
|
|
|
mycss_values_destroy_background_size(entry, value->size->value, true); |
614
|
0
|
0
|
|
|
|
|
if(value->repeat) |
615
|
0
|
|
|
|
|
|
mycss_values_destroy_background_repeat(entry, value->repeat->value, true); |
616
|
0
|
0
|
|
|
|
|
if(value->attachment) |
617
|
0
|
|
|
|
|
|
mycss_values_destroy_type_list(entry, value->attachment->value, true); |
618
|
0
|
0
|
|
|
|
|
if(value->clip) |
619
|
0
|
|
|
|
|
|
mycss_values_destroy_type_list(entry, value->clip->value, true); |
620
|
0
|
0
|
|
|
|
|
if(value->origin) |
621
|
0
|
|
|
|
|
|
mycss_values_destroy_type_list(entry, value->origin->value, true); |
622
|
|
|
|
|
|
|
|
623
|
0
|
0
|
|
|
|
|
if(self_destroy) { |
624
|
0
|
|
|
|
|
|
mycss_values_destroy(entry, (void*)value); |
625
|
0
|
|
|
|
|
|
return NULL; |
626
|
|
|
|
|
|
|
} |
627
|
|
|
|
|
|
|
|
628
|
0
|
|
|
|
|
|
return value; |
629
|
|
|
|
|
|
|
} |
630
|
|
|
|
|
|
|
|
631
|
|
|
|
|
|
|
/* |
632
|
|
|
|
|
|
|
* Border |
633
|
|
|
|
|
|
|
*/ |
634
|
0
|
|
|
|
|
|
mycss_values_border_t * mycss_values_destroy_border(mycss_entry_t* entry, mycss_values_border_t* value, bool self_destroy) |
635
|
|
|
|
|
|
|
{ |
636
|
0
|
0
|
|
|
|
|
if(value == NULL) |
637
|
0
|
|
|
|
|
|
return NULL; |
638
|
|
|
|
|
|
|
|
639
|
0
|
0
|
|
|
|
|
if(value->width) |
640
|
0
|
|
|
|
|
|
value->width = mycss_declaration_entry_destroy(entry->declaration, value->width, true); |
641
|
|
|
|
|
|
|
|
642
|
0
|
0
|
|
|
|
|
if(value->style) |
643
|
0
|
|
|
|
|
|
value->style = mycss_declaration_entry_destroy(entry->declaration, value->style, true); |
644
|
|
|
|
|
|
|
|
645
|
0
|
0
|
|
|
|
|
if(value->color) |
646
|
0
|
|
|
|
|
|
value->color = mycss_declaration_entry_destroy(entry->declaration, value->color, true); |
647
|
|
|
|
|
|
|
|
648
|
0
|
0
|
|
|
|
|
if(self_destroy) { |
649
|
0
|
|
|
|
|
|
mycss_values_destroy(entry, (void*)value); |
650
|
0
|
|
|
|
|
|
return NULL; |
651
|
|
|
|
|
|
|
} |
652
|
|
|
|
|
|
|
|
653
|
0
|
|
|
|
|
|
return value; |
654
|
|
|
|
|
|
|
} |
655
|
|
|
|
|
|
|
|
656
|
|
|
|
|
|
|
|