1 /* c/zx-idp-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-idp-data.h"
36 #define TPF zx_
37 #include "zx_ext_pt.h"
38 
39 
40 
zx_DEC_ATTR_idp_AssertionItem(struct zx_ctx * c,struct zx_idp_AssertionItem_s * x)41 int zx_DEC_ATTR_idp_AssertionItem(struct zx_ctx* c, struct zx_idp_AssertionItem_s* x)
42 {
43   switch (x->gg.attr->g.tok) {
44     case zx_created_ATTR:  x->created = x->gg.attr; return 1;
45     case zx_id_ATTR:  x->id = x->gg.attr; return 1;
46 
47   default: return 0;
48   }
49 }
50 
zx_DEC_ELEM_idp_AssertionItem(struct zx_ctx * c,struct zx_idp_AssertionItem_s * x)51 int zx_DEC_ELEM_idp_AssertionItem(struct zx_ctx* c, struct zx_idp_AssertionItem_s* x)
52 {
53   struct zx_elem_s* el = x->gg.kids;
54   switch (el->g.tok) {
55   case zx_idp_MEDInfo_ELEM:
56     if (!x->MEDInfo)
57       x->MEDInfo = (struct zx_idp_MEDInfo_s*)el;
58     return 1;
59   case zx_sa_Assertion_ELEM:
60     if (!x->Assertion)
61       x->Assertion = (struct zx_sa_Assertion_s*)el;
62     return 1;
63 
64   default: return 0;
65   }
66 }
67 
68 
69 
70 
zx_DEC_ATTR_idp_AuthnContextRestriction(struct zx_ctx * c,struct zx_idp_AuthnContextRestriction_s * x)71 int zx_DEC_ATTR_idp_AuthnContextRestriction(struct zx_ctx* c, struct zx_idp_AuthnContextRestriction_s* x)
72 {
73   switch (x->gg.attr->g.tok) {
74 
75   default: return 0;
76   }
77 }
78 
zx_DEC_ELEM_idp_AuthnContextRestriction(struct zx_ctx * c,struct zx_idp_AuthnContextRestriction_s * x)79 int zx_DEC_ELEM_idp_AuthnContextRestriction(struct zx_ctx* c, struct zx_idp_AuthnContextRestriction_s* x)
80 {
81   struct zx_elem_s* el = x->gg.kids;
82   switch (el->g.tok) {
83   case zx_sa_AuthnContext_ELEM:
84     if (!x->AuthnContext)
85       x->AuthnContext = (struct zx_sa_AuthnContext_s*)el;
86     return 1;
87 
88   default: return 0;
89   }
90 }
91 
92 
93 
94 
zx_DEC_ATTR_idp_CreatedStatus(struct zx_ctx * c,struct zx_idp_CreatedStatus_s * x)95 int zx_DEC_ATTR_idp_CreatedStatus(struct zx_ctx* c, struct zx_idp_CreatedStatus_s* x)
96 {
97   switch (x->gg.attr->g.tok) {
98 
99   default: return 0;
100   }
101 }
102 
zx_DEC_ELEM_idp_CreatedStatus(struct zx_ctx * c,struct zx_idp_CreatedStatus_s * x)103 int zx_DEC_ELEM_idp_CreatedStatus(struct zx_ctx* c, struct zx_idp_CreatedStatus_s* x)
104 {
105   struct zx_elem_s* el = x->gg.kids;
106   switch (el->g.tok) {
107   case zx_idp_CreatedStatusItem_ELEM:
108     if (!x->CreatedStatusItem)
109       x->CreatedStatusItem = (struct zx_idp_CreatedStatusItem_s*)el;
110     return 1;
111 
112   default: return 0;
113   }
114 }
115 
116 
117 
118 
zx_DEC_ATTR_idp_CreatedStatusItem(struct zx_ctx * c,struct zx_idp_CreatedStatusItem_s * x)119 int zx_DEC_ATTR_idp_CreatedStatusItem(struct zx_ctx* c, struct zx_idp_CreatedStatusItem_s* x)
120 {
121   switch (x->gg.attr->g.tok) {
122     case zx_firstUsed_ATTR:  x->firstUsed = x->gg.attr; return 1;
123     case zx_ref_ATTR:  x->ref = x->gg.attr; return 1;
124     case zx_used_ATTR:  x->used = x->gg.attr; return 1;
125 
126   default: return 0;
127   }
128 }
129 
zx_DEC_ELEM_idp_CreatedStatusItem(struct zx_ctx * c,struct zx_idp_CreatedStatusItem_s * x)130 int zx_DEC_ELEM_idp_CreatedStatusItem(struct zx_ctx* c, struct zx_idp_CreatedStatusItem_s* x)
131 {
132   struct zx_elem_s* el = x->gg.kids;
133   switch (el->g.tok) {
134 
135   default: return 0;
136   }
137 }
138 
139 
140 
141 
zx_DEC_ATTR_idp_CreatedStatusResponse(struct zx_ctx * c,struct zx_idp_CreatedStatusResponse_s * x)142 int zx_DEC_ATTR_idp_CreatedStatusResponse(struct zx_ctx* c, struct zx_idp_CreatedStatusResponse_s* x)
143 {
144   switch (x->gg.attr->g.tok) {
145 
146   default: return 0;
147   }
148 }
149 
zx_DEC_ELEM_idp_CreatedStatusResponse(struct zx_ctx * c,struct zx_idp_CreatedStatusResponse_s * x)150 int zx_DEC_ELEM_idp_CreatedStatusResponse(struct zx_ctx* c, struct zx_idp_CreatedStatusResponse_s* x)
151 {
152   struct zx_elem_s* el = x->gg.kids;
153   switch (el->g.tok) {
154   case zx_lu_Status_ELEM:
155     if (!x->Status)
156       x->Status = (struct zx_lu_Status_s*)el;
157     return 1;
158 
159   default: return 0;
160   }
161 }
162 
163 
164 
165 
zx_DEC_ATTR_idp_GetAssertion(struct zx_ctx * c,struct zx_idp_GetAssertion_s * x)166 int zx_DEC_ATTR_idp_GetAssertion(struct zx_ctx* c, struct zx_idp_GetAssertion_s* x)
167 {
168   switch (x->gg.attr->g.tok) {
169     case zx_purpose_ATTR:  x->purpose = x->gg.attr; return 1;
170 
171   default: return 0;
172   }
173 }
174 
zx_DEC_ELEM_idp_GetAssertion(struct zx_ctx * c,struct zx_idp_GetAssertion_s * x)175 int zx_DEC_ELEM_idp_GetAssertion(struct zx_ctx* c, struct zx_idp_GetAssertion_s* x)
176 {
177   struct zx_elem_s* el = x->gg.kids;
178   switch (el->g.tok) {
179   case zx_sp_AuthnRequest_ELEM:
180     if (!x->AuthnRequest)
181       x->AuthnRequest = (struct zx_sp_AuthnRequest_s*)el;
182     return 1;
183 
184   default: return 0;
185   }
186 }
187 
188 
189 
190 
zx_DEC_ATTR_idp_GetAssertionResponse(struct zx_ctx * c,struct zx_idp_GetAssertionResponse_s * x)191 int zx_DEC_ATTR_idp_GetAssertionResponse(struct zx_ctx* c, struct zx_idp_GetAssertionResponse_s* x)
192 {
193   switch (x->gg.attr->g.tok) {
194 
195   default: return 0;
196   }
197 }
198 
zx_DEC_ELEM_idp_GetAssertionResponse(struct zx_ctx * c,struct zx_idp_GetAssertionResponse_s * x)199 int zx_DEC_ELEM_idp_GetAssertionResponse(struct zx_ctx* c, struct zx_idp_GetAssertionResponse_s* x)
200 {
201   struct zx_elem_s* el = x->gg.kids;
202   switch (el->g.tok) {
203   case zx_lu_Status_ELEM:
204     if (!x->Status)
205       x->Status = (struct zx_lu_Status_s*)el;
206     return 1;
207   case zx_idp_GetAssertionResponseItem_ELEM:
208     if (!x->GetAssertionResponseItem)
209       x->GetAssertionResponseItem = (struct zx_idp_GetAssertionResponseItem_s*)el;
210     return 1;
211 
212   default: return 0;
213   }
214 }
215 
216 
217 
218 
zx_DEC_ATTR_idp_GetAssertionResponseItem(struct zx_ctx * c,struct zx_idp_GetAssertionResponseItem_s * x)219 int zx_DEC_ATTR_idp_GetAssertionResponseItem(struct zx_ctx* c, struct zx_idp_GetAssertionResponseItem_s* x)
220 {
221   switch (x->gg.attr->g.tok) {
222     case zx_id_ATTR:  x->id = x->gg.attr; return 1;
223     case zx_ref_ATTR:  x->ref = x->gg.attr; return 1;
224 
225   default: return 0;
226   }
227 }
228 
zx_DEC_ELEM_idp_GetAssertionResponseItem(struct zx_ctx * c,struct zx_idp_GetAssertionResponseItem_s * x)229 int zx_DEC_ELEM_idp_GetAssertionResponseItem(struct zx_ctx* c, struct zx_idp_GetAssertionResponseItem_s* x)
230 {
231   struct zx_elem_s* el = x->gg.kids;
232   switch (el->g.tok) {
233   case zx_idp_AssertionItem_ELEM:
234     if (!x->AssertionItem)
235       x->AssertionItem = (struct zx_idp_AssertionItem_s*)el;
236     return 1;
237 
238   default: return 0;
239   }
240 }
241 
242 
243 
244 
zx_DEC_ATTR_idp_GetProviderInfo(struct zx_ctx * c,struct zx_idp_GetProviderInfo_s * x)245 int zx_DEC_ATTR_idp_GetProviderInfo(struct zx_ctx* c, struct zx_idp_GetProviderInfo_s* x)
246 {
247   switch (x->gg.attr->g.tok) {
248     case zx_all_ATTR:  x->all = x->gg.attr; return 1;
249 
250   default: return 0;
251   }
252 }
253 
zx_DEC_ELEM_idp_GetProviderInfo(struct zx_ctx * c,struct zx_idp_GetProviderInfo_s * x)254 int zx_DEC_ELEM_idp_GetProviderInfo(struct zx_ctx* c, struct zx_idp_GetProviderInfo_s* x)
255 {
256   struct zx_elem_s* el = x->gg.kids;
257   switch (el->g.tok) {
258   case zx_idp_ProviderID_ELEM:
259     if (!x->ProviderID)
260       x->ProviderID = el;
261     return 1;
262 
263   default: return 0;
264   }
265 }
266 
267 
268 
269 
zx_DEC_ATTR_idp_GetProviderInfoResponse(struct zx_ctx * c,struct zx_idp_GetProviderInfoResponse_s * x)270 int zx_DEC_ATTR_idp_GetProviderInfoResponse(struct zx_ctx* c, struct zx_idp_GetProviderInfoResponse_s* x)
271 {
272   switch (x->gg.attr->g.tok) {
273 
274   default: return 0;
275   }
276 }
277 
zx_DEC_ELEM_idp_GetProviderInfoResponse(struct zx_ctx * c,struct zx_idp_GetProviderInfoResponse_s * x)278 int zx_DEC_ELEM_idp_GetProviderInfoResponse(struct zx_ctx* c, struct zx_idp_GetProviderInfoResponse_s* x)
279 {
280   struct zx_elem_s* el = x->gg.kids;
281   switch (el->g.tok) {
282   case zx_lu_Status_ELEM:
283     if (!x->Status)
284       x->Status = (struct zx_lu_Status_s*)el;
285     return 1;
286   case zx_idp_ProviderInfo_ELEM:
287     if (!x->ProviderInfo)
288       x->ProviderInfo = (struct zx_idp_ProviderInfo_s*)el;
289     return 1;
290 
291   default: return 0;
292   }
293 }
294 
295 
296 
297 
zx_DEC_ATTR_idp_MEDInfo(struct zx_ctx * c,struct zx_idp_MEDInfo_s * x)298 int zx_DEC_ATTR_idp_MEDInfo(struct zx_ctx* c, struct zx_idp_MEDInfo_s* x)
299 {
300   switch (x->gg.attr->g.tok) {
301 
302   default: return 0;
303   }
304 }
305 
zx_DEC_ELEM_idp_MEDInfo(struct zx_ctx * c,struct zx_idp_MEDInfo_s * x)306 int zx_DEC_ELEM_idp_MEDInfo(struct zx_ctx* c, struct zx_idp_MEDInfo_s* x)
307 {
308   struct zx_elem_s* el = x->gg.kids;
309   switch (el->g.tok) {
310   case zx_sa_NameID_ELEM:
311     if (!x->NameID)
312       x->NameID = (struct zx_sa_NameID_s*)el;
313     return 1;
314   case zx_sa_AttributeStatement_ELEM:
315     if (!x->AttributeStatement)
316       x->AttributeStatement = (struct zx_sa_AttributeStatement_s*)el;
317     return 1;
318 
319   default: return 0;
320   }
321 }
322 
323 
324 
325 
zx_DEC_ATTR_idp_ProviderInfo(struct zx_ctx * c,struct zx_idp_ProviderInfo_s * x)326 int zx_DEC_ATTR_idp_ProviderInfo(struct zx_ctx* c, struct zx_idp_ProviderInfo_s* x)
327 {
328   switch (x->gg.attr->g.tok) {
329     case zx_name_ATTR:  x->name = x->gg.attr; return 1;
330     case zx_providerID_ATTR:  x->providerID = x->gg.attr; return 1;
331 
332   default: return 0;
333   }
334 }
335 
zx_DEC_ELEM_idp_ProviderInfo(struct zx_ctx * c,struct zx_idp_ProviderInfo_s * x)336 int zx_DEC_ELEM_idp_ProviderInfo(struct zx_ctx* c, struct zx_idp_ProviderInfo_s* x)
337 {
338   struct zx_elem_s* el = x->gg.kids;
339   switch (el->g.tok) {
340 
341   default: return 0;
342   }
343 }
344 
345 
346 
347 
zx_DEC_ATTR_idp_SubjectRestriction(struct zx_ctx * c,struct zx_idp_SubjectRestriction_s * x)348 int zx_DEC_ATTR_idp_SubjectRestriction(struct zx_ctx* c, struct zx_idp_SubjectRestriction_s* x)
349 {
350   switch (x->gg.attr->g.tok) {
351 
352   default: return 0;
353   }
354 }
355 
zx_DEC_ELEM_idp_SubjectRestriction(struct zx_ctx * c,struct zx_idp_SubjectRestriction_s * x)356 int zx_DEC_ELEM_idp_SubjectRestriction(struct zx_ctx* c, struct zx_idp_SubjectRestriction_s* x)
357 {
358   struct zx_elem_s* el = x->gg.kids;
359   switch (el->g.tok) {
360   case zx_sa_Subject_ELEM:
361     if (!x->Subject)
362       x->Subject = (struct zx_sa_Subject_s*)el;
363     return 1;
364 
365   default: return 0;
366   }
367 }
368 
369 
370 /* EOF -- c/zx-idp-dec.c */
371