Branch data Line data Source code
1 : : /* c/zx-ds-dec.c - WARNING: This file was auto generated by xsd2sg.pl. DO NOT EDIT!
2 : : * $Id$ */
3 : : /* Code generation design Copyright (c) 2006 Sampo Kellomaki (sampo@iki.fi),
4 : : * All Rights Reserved. NO WARRANTY. See file COPYING for terms and conditions
5 : : * of use. Some aspects of code generation were driven by schema
6 : : * descriptions that were used as input and may be subject to their own copyright.
7 : : * Code generation uses a template, whose copyright statement follows. */
8 : :
9 : : /** dec-templ.c - XML decoder template, used in code generation
10 : : ** Copyright (c) 2010 Sampo Kellomaki (sampo@iki.fi), All Rights Reserved.
11 : : ** Copyright (c) 2006-2007 Symlabs (symlabs@symlabs.com), All Rights Reserved.
12 : : ** Author: Sampo Kellomaki (sampo@iki.fi)
13 : : ** This is confidential unpublished proprietary source code of the author.
14 : : ** NO WARRANTY, not even implied warranties. Contains trade secrets.
15 : : ** Distribution prohibited unless authorized in writing.
16 : : ** Licensed under Apache License 2.0, see file COPYING.
17 : : ** Id: dec-templ.c,v 1.30 2008-10-04 23:42:14 sampo Exp $
18 : : **
19 : : ** 28.5.2006, created, Sampo Kellomaki (sampo@iki.fi)
20 : : ** 8.8.2006, reworked namespace handling --Sampo
21 : : ** 12.8.2006, added special scanning of xmlns to avoid backtracking elem recognition --Sampo
22 : : ** 23.9.2006, added collection of WO information --Sampo
23 : : ** 21.6.2007, improved handling of undeclared namespace prefixes --Sampo
24 : : ** 27.10.2010, CSE refactoring, re-engineered namespace handling --Sampo
25 : : ** 21.11.2010, re-engineered to extract most code to zx_DEC_elem, leaving just switches --Sampo
26 : : **
27 : : ** N.B: This template is meant to be processed by pd/xsd2sg.pl. Beware
28 : : ** of special markers that xsd2sg.pl expects to find and understand.
29 : : **/
30 : :
31 : : #include "errmac.h"
32 : : #include "zx.h"
33 : : #include "c/zx-const.h"
34 : : #include "c/zx-data.h"
35 : : #include "c/zx-ds-data.h"
36 : : #define TPF zx_
37 : : #include "zx_ext_pt.h"
38 : :
39 : :
40 : :
41 : : int zx_DEC_ATTR_ds_CanonicalizationMethod(struct zx_ctx* c, struct zx_ds_CanonicalizationMethod_s* x)
42 : 8556 : {
43 [ + - ]: 8556 : switch (x->gg.attr->g.tok) {
44 : 8556 : case zx_Algorithm_ATTR: x->Algorithm = x->gg.attr; return 1;
45 : :
46 : 0 : default: return 0;
47 : : }
48 : : }
49 : :
50 : : int zx_DEC_ELEM_ds_CanonicalizationMethod(struct zx_ctx* c, struct zx_ds_CanonicalizationMethod_s* x)
51 : 0 : {
52 : 0 : struct zx_elem_s* el = x->gg.kids;
53 : 0 : switch (el->g.tok) {
54 : :
55 : 0 : default: return 0;
56 : : }
57 : : }
58 : :
59 : :
60 : :
61 : :
62 : : int zx_DEC_ATTR_ds_DSAKeyValue(struct zx_ctx* c, struct zx_ds_DSAKeyValue_s* x)
63 : 0 : {
64 : 0 : switch (x->gg.attr->g.tok) {
65 : :
66 : 0 : default: return 0;
67 : : }
68 : : }
69 : :
70 : : int zx_DEC_ELEM_ds_DSAKeyValue(struct zx_ctx* c, struct zx_ds_DSAKeyValue_s* x)
71 : 0 : {
72 : 0 : struct zx_elem_s* el = x->gg.kids;
73 [ # # # # : 0 : switch (el->g.tok) {
# # # # ]
74 : : case zx_ds_P_ELEM:
75 [ # # ]: 0 : if (!x->P)
76 : 0 : x->P = el;
77 : 0 : return 1;
78 : : case zx_ds_Q_ELEM:
79 [ # # ]: 0 : if (!x->Q)
80 : 0 : x->Q = el;
81 : 0 : return 1;
82 : : case zx_ds_G_ELEM:
83 [ # # ]: 0 : if (!x->G)
84 : 0 : x->G = el;
85 : 0 : return 1;
86 : : case zx_ds_Y_ELEM:
87 [ # # ]: 0 : if (!x->Y)
88 : 0 : x->Y = el;
89 : 0 : return 1;
90 : : case zx_ds_J_ELEM:
91 [ # # ]: 0 : if (!x->J)
92 : 0 : x->J = el;
93 : 0 : return 1;
94 : : case zx_ds_Seed_ELEM:
95 [ # # ]: 0 : if (!x->Seed)
96 : 0 : x->Seed = el;
97 : 0 : return 1;
98 : : case zx_ds_PgenCounter_ELEM:
99 [ # # ]: 0 : if (!x->PgenCounter)
100 : 0 : x->PgenCounter = el;
101 : 0 : return 1;
102 : :
103 : 0 : default: return 0;
104 : : }
105 : : }
106 : :
107 : :
108 : :
109 : :
110 : : int zx_DEC_ATTR_ds_DigestMethod(struct zx_ctx* c, struct zx_ds_DigestMethod_s* x)
111 : 27654 : {
112 [ + - ]: 27654 : switch (x->gg.attr->g.tok) {
113 : 27654 : case zx_Algorithm_ATTR: x->Algorithm = x->gg.attr; return 1;
114 : :
115 : 0 : default: return 0;
116 : : }
117 : : }
118 : :
119 : : int zx_DEC_ELEM_ds_DigestMethod(struct zx_ctx* c, struct zx_ds_DigestMethod_s* x)
120 : 0 : {
121 : 0 : struct zx_elem_s* el = x->gg.kids;
122 : 0 : switch (el->g.tok) {
123 : :
124 : 0 : default: return 0;
125 : : }
126 : : }
127 : :
128 : :
129 : :
130 : :
131 : : int zx_DEC_ATTR_ds_KeyInfo(struct zx_ctx* c, struct zx_ds_KeyInfo_s* x)
132 : 0 : {
133 [ # # ]: 0 : switch (x->gg.attr->g.tok) {
134 : 0 : case zx_Id_ATTR: x->Id = x->gg.attr; return 1;
135 : :
136 : 0 : default: return 0;
137 : : }
138 : : }
139 : :
140 : : int zx_DEC_ELEM_ds_KeyInfo(struct zx_ctx* c, struct zx_ds_KeyInfo_s* x)
141 : 27945 : {
142 : 27945 : struct zx_elem_s* el = x->gg.kids;
143 [ - + + + : 27945 : switch (el->g.tok) {
- - - +
- ]
144 : : case zx_ds_KeyName_ELEM:
145 [ # # ]: 0 : if (!x->KeyName)
146 : 0 : x->KeyName = el;
147 : 0 : return 1;
148 : : case zx_ds_KeyValue_ELEM:
149 [ + - ]: 1 : if (!x->KeyValue)
150 : 1 : x->KeyValue = (struct zx_ds_KeyValue_s*)el;
151 : 1 : return 1;
152 : : case zx_ds_RetrievalMethod_ELEM:
153 [ + - ]: 11025 : if (!x->RetrievalMethod)
154 : 11025 : x->RetrievalMethod = (struct zx_ds_RetrievalMethod_s*)el;
155 : 11025 : return 1;
156 : : case zx_ds_X509Data_ELEM:
157 [ + - ]: 15083 : if (!x->X509Data)
158 : 15083 : x->X509Data = (struct zx_ds_X509Data_s*)el;
159 : 15083 : return 1;
160 : : case zx_ds_PGPData_ELEM:
161 [ # # ]: 0 : if (!x->PGPData)
162 : 0 : x->PGPData = (struct zx_ds_PGPData_s*)el;
163 : 0 : return 1;
164 : : case zx_ds_SPKIData_ELEM:
165 [ # # ]: 0 : if (!x->SPKIData)
166 : 0 : x->SPKIData = (struct zx_ds_SPKIData_s*)el;
167 : 0 : return 1;
168 : : case zx_ds_MgmtData_ELEM:
169 [ # # ]: 0 : if (!x->MgmtData)
170 : 0 : x->MgmtData = el;
171 : 0 : return 1;
172 : : case zx_xenc_EncryptedKey_ELEM:
173 [ + - ]: 1836 : if (!x->EncryptedKey)
174 : 1836 : x->EncryptedKey = (struct zx_xenc_EncryptedKey_s*)el;
175 : 1836 : return 1;
176 : :
177 : 0 : default: return 0;
178 : : }
179 : : }
180 : :
181 : :
182 : :
183 : :
184 : : int zx_DEC_ATTR_ds_KeyValue(struct zx_ctx* c, struct zx_ds_KeyValue_s* x)
185 : 0 : {
186 : 0 : switch (x->gg.attr->g.tok) {
187 : :
188 : 0 : default: return 0;
189 : : }
190 : : }
191 : :
192 : : int zx_DEC_ELEM_ds_KeyValue(struct zx_ctx* c, struct zx_ds_KeyValue_s* x)
193 : 1 : {
194 : 1 : struct zx_elem_s* el = x->gg.kids;
195 [ - + - ]: 1 : switch (el->g.tok) {
196 : : case zx_ds_DSAKeyValue_ELEM:
197 [ # # ]: 0 : if (!x->DSAKeyValue)
198 : 0 : x->DSAKeyValue = (struct zx_ds_DSAKeyValue_s*)el;
199 : 0 : return 1;
200 : : case zx_ds_RSAKeyValue_ELEM:
201 [ + - ]: 1 : if (!x->RSAKeyValue)
202 : 1 : x->RSAKeyValue = (struct zx_ds_RSAKeyValue_s*)el;
203 : 1 : return 1;
204 : :
205 : 0 : default: return 0;
206 : : }
207 : : }
208 : :
209 : :
210 : :
211 : :
212 : : int zx_DEC_ATTR_ds_Manifest(struct zx_ctx* c, struct zx_ds_Manifest_s* x)
213 : 0 : {
214 [ # # ]: 0 : switch (x->gg.attr->g.tok) {
215 : 0 : case zx_Id_ATTR: x->Id = x->gg.attr; return 1;
216 : :
217 : 0 : default: return 0;
218 : : }
219 : : }
220 : :
221 : : int zx_DEC_ELEM_ds_Manifest(struct zx_ctx* c, struct zx_ds_Manifest_s* x)
222 : 0 : {
223 : 0 : struct zx_elem_s* el = x->gg.kids;
224 [ # # ]: 0 : switch (el->g.tok) {
225 : : case zx_ds_Reference_ELEM:
226 [ # # ]: 0 : if (!x->Reference)
227 : 0 : x->Reference = (struct zx_ds_Reference_s*)el;
228 : 0 : return 1;
229 : :
230 : 0 : default: return 0;
231 : : }
232 : : }
233 : :
234 : :
235 : :
236 : :
237 : : int zx_DEC_ATTR_ds_Object(struct zx_ctx* c, struct zx_ds_Object_s* x)
238 : 0 : {
239 [ # # # # ]: 0 : switch (x->gg.attr->g.tok) {
240 : 0 : case zx_Encoding_ATTR: x->Encoding = x->gg.attr; return 1;
241 : 0 : case zx_Id_ATTR: x->Id = x->gg.attr; return 1;
242 : 0 : case zx_MimeType_ATTR: x->MimeType = x->gg.attr; return 1;
243 : :
244 : 0 : default: return 0;
245 : : }
246 : : }
247 : :
248 : : int zx_DEC_ELEM_ds_Object(struct zx_ctx* c, struct zx_ds_Object_s* x)
249 : 0 : {
250 : 0 : struct zx_elem_s* el = x->gg.kids;
251 : 0 : switch (el->g.tok) {
252 : :
253 : 0 : default: return 0;
254 : : }
255 : : }
256 : :
257 : :
258 : :
259 : :
260 : : int zx_DEC_ATTR_ds_PGPData(struct zx_ctx* c, struct zx_ds_PGPData_s* x)
261 : 0 : {
262 : 0 : switch (x->gg.attr->g.tok) {
263 : :
264 : 0 : default: return 0;
265 : : }
266 : : }
267 : :
268 : : int zx_DEC_ELEM_ds_PGPData(struct zx_ctx* c, struct zx_ds_PGPData_s* x)
269 : 0 : {
270 : 0 : struct zx_elem_s* el = x->gg.kids;
271 [ # # # ]: 0 : switch (el->g.tok) {
272 : : case zx_ds_PGPKeyID_ELEM:
273 [ # # ]: 0 : if (!x->PGPKeyID)
274 : 0 : x->PGPKeyID = el;
275 : 0 : return 1;
276 : : case zx_ds_PGPKeyPacket_ELEM:
277 [ # # ]: 0 : if (!x->PGPKeyPacket)
278 : 0 : x->PGPKeyPacket = el;
279 : 0 : return 1;
280 : :
281 : 0 : default: return 0;
282 : : }
283 : : }
284 : :
285 : :
286 : :
287 : :
288 : : int zx_DEC_ATTR_ds_RSAKeyValue(struct zx_ctx* c, struct zx_ds_RSAKeyValue_s* x)
289 : 0 : {
290 : 0 : switch (x->gg.attr->g.tok) {
291 : :
292 : 0 : default: return 0;
293 : : }
294 : : }
295 : :
296 : : int zx_DEC_ELEM_ds_RSAKeyValue(struct zx_ctx* c, struct zx_ds_RSAKeyValue_s* x)
297 : 2 : {
298 : 2 : struct zx_elem_s* el = x->gg.kids;
299 [ + + - ]: 2 : switch (el->g.tok) {
300 : : case zx_ds_Modulus_ELEM:
301 [ + - ]: 1 : if (!x->Modulus)
302 : 1 : x->Modulus = el;
303 : 1 : return 1;
304 : : case zx_ds_Exponent_ELEM:
305 [ + - ]: 1 : if (!x->Exponent)
306 : 1 : x->Exponent = el;
307 : 1 : return 1;
308 : :
309 : 0 : default: return 0;
310 : : }
311 : : }
312 : :
313 : :
314 : :
315 : :
316 : : int zx_DEC_ATTR_ds_Reference(struct zx_ctx* c, struct zx_ds_Reference_s* x)
317 : 27654 : {
318 [ - - + - ]: 27654 : switch (x->gg.attr->g.tok) {
319 : 0 : case zx_Id_ATTR: x->Id = x->gg.attr; return 1;
320 : 0 : case zx_Type_ATTR: x->Type = x->gg.attr; return 1;
321 : 27654 : case zx_URI_ATTR: x->URI = x->gg.attr; return 1;
322 : :
323 : 0 : default: return 0;
324 : : }
325 : : }
326 : :
327 : : int zx_DEC_ELEM_ds_Reference(struct zx_ctx* c, struct zx_ds_Reference_s* x)
328 : 82962 : {
329 : 82962 : struct zx_elem_s* el = x->gg.kids;
330 [ + + + - ]: 82962 : switch (el->g.tok) {
331 : : case zx_ds_Transforms_ELEM:
332 [ + - ]: 27654 : if (!x->Transforms)
333 : 27654 : x->Transforms = (struct zx_ds_Transforms_s*)el;
334 : 27654 : return 1;
335 : : case zx_ds_DigestMethod_ELEM:
336 [ + - ]: 27654 : if (!x->DigestMethod)
337 : 27654 : x->DigestMethod = (struct zx_ds_DigestMethod_s*)el;
338 : 27654 : return 1;
339 : : case zx_ds_DigestValue_ELEM:
340 [ + - ]: 27654 : if (!x->DigestValue)
341 : 27654 : x->DigestValue = el;
342 : 27654 : return 1;
343 : :
344 : 0 : default: return 0;
345 : : }
346 : : }
347 : :
348 : :
349 : :
350 : :
351 : : int zx_DEC_ATTR_ds_RetrievalMethod(struct zx_ctx* c, struct zx_ds_RetrievalMethod_s* x)
352 : 22050 : {
353 [ + + - ]: 22050 : switch (x->gg.attr->g.tok) {
354 : 11025 : case zx_Type_ATTR: x->Type = x->gg.attr; return 1;
355 : 11025 : case zx_URI_ATTR: x->URI = x->gg.attr; return 1;
356 : :
357 : 0 : default: return 0;
358 : : }
359 : : }
360 : :
361 : : int zx_DEC_ELEM_ds_RetrievalMethod(struct zx_ctx* c, struct zx_ds_RetrievalMethod_s* x)
362 : 0 : {
363 : 0 : struct zx_elem_s* el = x->gg.kids;
364 [ # # ]: 0 : switch (el->g.tok) {
365 : : case zx_ds_Transforms_ELEM:
366 [ # # ]: 0 : if (!x->Transforms)
367 : 0 : x->Transforms = (struct zx_ds_Transforms_s*)el;
368 : 0 : return 1;
369 : :
370 : 0 : default: return 0;
371 : : }
372 : : }
373 : :
374 : :
375 : :
376 : :
377 : : int zx_DEC_ATTR_ds_SPKIData(struct zx_ctx* c, struct zx_ds_SPKIData_s* x)
378 : 0 : {
379 : 0 : switch (x->gg.attr->g.tok) {
380 : :
381 : 0 : default: return 0;
382 : : }
383 : : }
384 : :
385 : : int zx_DEC_ELEM_ds_SPKIData(struct zx_ctx* c, struct zx_ds_SPKIData_s* x)
386 : 0 : {
387 : 0 : struct zx_elem_s* el = x->gg.kids;
388 [ # # ]: 0 : switch (el->g.tok) {
389 : : case zx_ds_SPKISexp_ELEM:
390 [ # # ]: 0 : if (!x->SPKISexp)
391 : 0 : x->SPKISexp = el;
392 : 0 : return 1;
393 : :
394 : 0 : default: return 0;
395 : : }
396 : : }
397 : :
398 : :
399 : :
400 : :
401 : : int zx_DEC_ATTR_ds_Signature(struct zx_ctx* c, struct zx_ds_Signature_s* x)
402 : 1 : {
403 [ + - ]: 1 : switch (x->gg.attr->g.tok) {
404 : 1 : case zx_Id_ATTR: x->Id = x->gg.attr; return 1;
405 : :
406 : 0 : default: return 0;
407 : : }
408 : : }
409 : :
410 : : int zx_DEC_ELEM_ds_Signature(struct zx_ctx* c, struct zx_ds_Signature_s* x)
411 : 17123 : {
412 : 17123 : struct zx_elem_s* el = x->gg.kids;
413 [ + + + - : 17123 : switch (el->g.tok) {
- ]
414 : : case zx_ds_SignedInfo_ELEM:
415 [ + - ]: 8556 : if (!x->SignedInfo)
416 : 8556 : x->SignedInfo = (struct zx_ds_SignedInfo_s*)el;
417 : 8556 : return 1;
418 : : case zx_ds_SignatureValue_ELEM:
419 [ + - ]: 8556 : if (!x->SignatureValue)
420 : 8556 : x->SignatureValue = (struct zx_ds_SignatureValue_s*)el;
421 : 8556 : return 1;
422 : : case zx_ds_KeyInfo_ELEM:
423 [ + - ]: 11 : if (!x->KeyInfo)
424 : 11 : x->KeyInfo = (struct zx_ds_KeyInfo_s*)el;
425 : 11 : return 1;
426 : : case zx_ds_Object_ELEM:
427 [ # # ]: 0 : if (!x->Object)
428 : 0 : x->Object = (struct zx_ds_Object_s*)el;
429 : 0 : return 1;
430 : :
431 : 0 : default: return 0;
432 : : }
433 : : }
434 : :
435 : :
436 : :
437 : :
438 : : int zx_DEC_ATTR_ds_SignatureMethod(struct zx_ctx* c, struct zx_ds_SignatureMethod_s* x)
439 : 8556 : {
440 [ + - ]: 8556 : switch (x->gg.attr->g.tok) {
441 : 8556 : case zx_Algorithm_ATTR: x->Algorithm = x->gg.attr; return 1;
442 : :
443 : 0 : default: return 0;
444 : : }
445 : : }
446 : :
447 : : int zx_DEC_ELEM_ds_SignatureMethod(struct zx_ctx* c, struct zx_ds_SignatureMethod_s* x)
448 : 0 : {
449 : 0 : struct zx_elem_s* el = x->gg.kids;
450 [ # # ]: 0 : switch (el->g.tok) {
451 : : case zx_ds_HMACOutputLength_ELEM:
452 [ # # ]: 0 : if (!x->HMACOutputLength)
453 : 0 : x->HMACOutputLength = el;
454 : 0 : return 1;
455 : :
456 : 0 : default: return 0;
457 : : }
458 : : }
459 : :
460 : :
461 : :
462 : :
463 : : int zx_DEC_ATTR_ds_SignatureProperties(struct zx_ctx* c, struct zx_ds_SignatureProperties_s* x)
464 : 0 : {
465 [ # # ]: 0 : switch (x->gg.attr->g.tok) {
466 : 0 : case zx_Id_ATTR: x->Id = x->gg.attr; return 1;
467 : :
468 : 0 : default: return 0;
469 : : }
470 : : }
471 : :
472 : : int zx_DEC_ELEM_ds_SignatureProperties(struct zx_ctx* c, struct zx_ds_SignatureProperties_s* x)
473 : 0 : {
474 : 0 : struct zx_elem_s* el = x->gg.kids;
475 [ # # ]: 0 : switch (el->g.tok) {
476 : : case zx_ds_SignatureProperty_ELEM:
477 [ # # ]: 0 : if (!x->SignatureProperty)
478 : 0 : x->SignatureProperty = (struct zx_ds_SignatureProperty_s*)el;
479 : 0 : return 1;
480 : :
481 : 0 : default: return 0;
482 : : }
483 : : }
484 : :
485 : :
486 : :
487 : :
488 : : int zx_DEC_ATTR_ds_SignatureProperty(struct zx_ctx* c, struct zx_ds_SignatureProperty_s* x)
489 : 0 : {
490 [ # # # ]: 0 : switch (x->gg.attr->g.tok) {
491 : 0 : case zx_Id_ATTR: x->Id = x->gg.attr; return 1;
492 : 0 : case zx_Target_ATTR: x->Target = x->gg.attr; return 1;
493 : :
494 : 0 : default: return 0;
495 : : }
496 : : }
497 : :
498 : : int zx_DEC_ELEM_ds_SignatureProperty(struct zx_ctx* c, struct zx_ds_SignatureProperty_s* x)
499 : 0 : {
500 : 0 : struct zx_elem_s* el = x->gg.kids;
501 : 0 : switch (el->g.tok) {
502 : :
503 : 0 : default: return 0;
504 : : }
505 : : }
506 : :
507 : :
508 : :
509 : :
510 : : int zx_DEC_ATTR_ds_SignatureValue(struct zx_ctx* c, struct zx_ds_SignatureValue_s* x)
511 : 0 : {
512 [ # # ]: 0 : switch (x->gg.attr->g.tok) {
513 : 0 : case zx_Id_ATTR: x->Id = x->gg.attr; return 1;
514 : :
515 : 0 : default: return 0;
516 : : }
517 : : }
518 : :
519 : : int zx_DEC_ELEM_ds_SignatureValue(struct zx_ctx* c, struct zx_ds_SignatureValue_s* x)
520 : 0 : {
521 : 0 : struct zx_elem_s* el = x->gg.kids;
522 : 0 : switch (el->g.tok) {
523 : :
524 : 0 : default: return 0;
525 : : }
526 : : }
527 : :
528 : :
529 : :
530 : :
531 : : int zx_DEC_ATTR_ds_SignedInfo(struct zx_ctx* c, struct zx_ds_SignedInfo_s* x)
532 : 0 : {
533 [ # # ]: 0 : switch (x->gg.attr->g.tok) {
534 : 0 : case zx_Id_ATTR: x->Id = x->gg.attr; return 1;
535 : :
536 : 0 : default: return 0;
537 : : }
538 : : }
539 : :
540 : : int zx_DEC_ELEM_ds_SignedInfo(struct zx_ctx* c, struct zx_ds_SignedInfo_s* x)
541 : 44766 : {
542 : 44766 : struct zx_elem_s* el = x->gg.kids;
543 [ + + + - ]: 44766 : switch (el->g.tok) {
544 : : case zx_ds_CanonicalizationMethod_ELEM:
545 [ + - ]: 8556 : if (!x->CanonicalizationMethod)
546 : 8556 : x->CanonicalizationMethod = (struct zx_ds_CanonicalizationMethod_s*)el;
547 : 8556 : return 1;
548 : : case zx_ds_SignatureMethod_ELEM:
549 [ + - ]: 8556 : if (!x->SignatureMethod)
550 : 8556 : x->SignatureMethod = (struct zx_ds_SignatureMethod_s*)el;
551 : 8556 : return 1;
552 : : case zx_ds_Reference_ELEM:
553 [ + + ]: 27654 : if (!x->Reference)
554 : 8556 : x->Reference = (struct zx_ds_Reference_s*)el;
555 : 27654 : return 1;
556 : :
557 : 0 : default: return 0;
558 : : }
559 : : }
560 : :
561 : :
562 : :
563 : :
564 : : int zx_DEC_ATTR_ds_Transform(struct zx_ctx* c, struct zx_ds_Transform_s* x)
565 : 55308 : {
566 [ + - ]: 55308 : switch (x->gg.attr->g.tok) {
567 : 55308 : case zx_Algorithm_ATTR: x->Algorithm = x->gg.attr; return 1;
568 : :
569 : 0 : default: return 0;
570 : : }
571 : : }
572 : :
573 : : int zx_DEC_ELEM_ds_Transform(struct zx_ctx* c, struct zx_ds_Transform_s* x)
574 : 10 : {
575 : 10 : struct zx_elem_s* el = x->gg.kids;
576 [ - + - ]: 10 : switch (el->g.tok) {
577 : : case zx_ds_XPath_ELEM:
578 [ # # ]: 0 : if (!x->XPath)
579 : 0 : x->XPath = el;
580 : 0 : return 1;
581 : : case zx_exca_InclusiveNamespaces_ELEM:
582 [ + - ]: 10 : if (!x->InclusiveNamespaces)
583 : 10 : x->InclusiveNamespaces = (struct zx_exca_InclusiveNamespaces_s*)el;
584 : 10 : return 1;
585 : :
586 : 0 : default: return 0;
587 : : }
588 : : }
589 : :
590 : :
591 : :
592 : :
593 : : int zx_DEC_ATTR_ds_Transforms(struct zx_ctx* c, struct zx_ds_Transforms_s* x)
594 : 0 : {
595 : 0 : switch (x->gg.attr->g.tok) {
596 : :
597 : 0 : default: return 0;
598 : : }
599 : : }
600 : :
601 : : int zx_DEC_ELEM_ds_Transforms(struct zx_ctx* c, struct zx_ds_Transforms_s* x)
602 : 55308 : {
603 : 55308 : struct zx_elem_s* el = x->gg.kids;
604 [ + - ]: 55308 : switch (el->g.tok) {
605 : : case zx_ds_Transform_ELEM:
606 [ + + ]: 55308 : if (!x->Transform)
607 : 27654 : x->Transform = (struct zx_ds_Transform_s*)el;
608 : 55308 : return 1;
609 : :
610 : 0 : default: return 0;
611 : : }
612 : : }
613 : :
614 : :
615 : :
616 : :
617 : : int zx_DEC_ATTR_ds_X509Data(struct zx_ctx* c, struct zx_ds_X509Data_s* x)
618 : 0 : {
619 : 0 : switch (x->gg.attr->g.tok) {
620 : :
621 : 0 : default: return 0;
622 : : }
623 : : }
624 : :
625 : : int zx_DEC_ELEM_ds_X509Data(struct zx_ctx* c, struct zx_ds_X509Data_s* x)
626 : 15083 : {
627 : 15083 : struct zx_elem_s* el = x->gg.kids;
628 [ - - - + : 15083 : switch (el->g.tok) {
- - ]
629 : : case zx_ds_X509IssuerSerial_ELEM:
630 [ # # ]: 0 : if (!x->X509IssuerSerial)
631 : 0 : x->X509IssuerSerial = (struct zx_ds_X509IssuerSerial_s*)el;
632 : 0 : return 1;
633 : : case zx_ds_X509SKI_ELEM:
634 [ # # ]: 0 : if (!x->X509SKI)
635 : 0 : x->X509SKI = el;
636 : 0 : return 1;
637 : : case zx_ds_X509SubjectName_ELEM:
638 [ # # ]: 0 : if (!x->X509SubjectName)
639 : 0 : x->X509SubjectName = el;
640 : 0 : return 1;
641 : : case zx_ds_X509Certificate_ELEM:
642 [ + - ]: 15083 : if (!x->X509Certificate)
643 : 15083 : x->X509Certificate = el;
644 : 15083 : return 1;
645 : : case zx_ds_X509CRL_ELEM:
646 [ # # ]: 0 : if (!x->X509CRL)
647 : 0 : x->X509CRL = el;
648 : 0 : return 1;
649 : :
650 : 0 : default: return 0;
651 : : }
652 : : }
653 : :
654 : :
655 : :
656 : :
657 : : int zx_DEC_ATTR_ds_X509IssuerSerial(struct zx_ctx* c, struct zx_ds_X509IssuerSerial_s* x)
658 : 0 : {
659 : 0 : switch (x->gg.attr->g.tok) {
660 : :
661 : 0 : default: return 0;
662 : : }
663 : : }
664 : :
665 : : int zx_DEC_ELEM_ds_X509IssuerSerial(struct zx_ctx* c, struct zx_ds_X509IssuerSerial_s* x)
666 : 0 : {
667 : 0 : struct zx_elem_s* el = x->gg.kids;
668 [ # # # ]: 0 : switch (el->g.tok) {
669 : : case zx_ds_X509IssuerName_ELEM:
670 [ # # ]: 0 : if (!x->X509IssuerName)
671 : 0 : x->X509IssuerName = el;
672 : 0 : return 1;
673 : : case zx_ds_X509SerialNumber_ELEM:
674 [ # # ]: 0 : if (!x->X509SerialNumber)
675 : 0 : x->X509SerialNumber = el;
676 : 0 : return 1;
677 : :
678 : 0 : default: return 0;
679 : : }
680 : : }
681 : :
682 : :
683 : : /* EOF -- c/zx-ds-dec.c */
|