1 /* c/zx-tas3-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-tas3-data.h"
36 #define TPF zx_
37 #include "zx_ext_pt.h"
38 
39 
40 
zx_DEC_ATTR_tas3_Credentials(struct zx_ctx * c,struct zx_tas3_Credentials_s * x)41 int zx_DEC_ATTR_tas3_Credentials(struct zx_ctx* c, struct zx_tas3_Credentials_s* x)
42 {
43   switch (x->gg.attr->g.tok) {
44     case zx_id_ATTR:  x->id = x->gg.attr; return 1;
45     case zx_usage_ATTR:  x->usage = x->gg.attr; return 1;
46     case zx_Id_ATTR|zx_wsu_NS:  x->Id = x->gg.attr; return 1;
47     case zx_actor_ATTR|zx_e_NS:  x->actor = x->gg.attr; return 1;
48     case zx_mustUnderstand_ATTR|zx_e_NS:  x->mustUnderstand = x->gg.attr; return 1;
49 
50   default: return 0;
51   }
52 }
53 
zx_DEC_ELEM_tas3_Credentials(struct zx_ctx * c,struct zx_tas3_Credentials_s * x)54 int zx_DEC_ELEM_tas3_Credentials(struct zx_ctx* c, struct zx_tas3_Credentials_s* x)
55 {
56   struct zx_elem_s* el = x->gg.kids;
57   switch (el->g.tok) {
58   case zx_sa_Assertion_ELEM:
59     if (!x->Assertion)
60       x->Assertion = (struct zx_sa_Assertion_s*)el;
61     return 1;
62   case zx_sa_EncryptedAssertion_ELEM:
63     if (!x->EncryptedAssertion)
64       x->EncryptedAssertion = (struct zx_sa_EncryptedAssertion_s*)el;
65     return 1;
66   case zx_sa11_Assertion_ELEM:
67     if (!x->sa11_Assertion)
68       x->sa11_Assertion = (struct zx_sa11_Assertion_s*)el;
69     return 1;
70   case zx_ff12_Assertion_ELEM:
71     if (!x->ff12_Assertion)
72       x->ff12_Assertion = (struct zx_ff12_Assertion_s*)el;
73     return 1;
74   case zx_sa_Attribute_ELEM:
75     if (!x->Attribute)
76       x->Attribute = (struct zx_sa_Attribute_s*)el;
77     return 1;
78   case zx_sa_EncryptedAttribute_ELEM:
79     if (!x->EncryptedAttribute)
80       x->EncryptedAttribute = (struct zx_sa_EncryptedAttribute_s*)el;
81     return 1;
82   case zx_xac_Attribute_ELEM:
83     if (!x->xac_Attribute)
84       x->xac_Attribute = (struct zx_xac_Attribute_s*)el;
85     return 1;
86 
87   default: return 0;
88   }
89 }
90 
91 
92 
93 
zx_DEC_ATTR_tas3_ESLApply(struct zx_ctx * c,struct zx_tas3_ESLApply_s * x)94 int zx_DEC_ATTR_tas3_ESLApply(struct zx_ctx* c, struct zx_tas3_ESLApply_s* x)
95 {
96   switch (x->gg.attr->g.tok) {
97 
98   default: return 0;
99   }
100 }
101 
zx_DEC_ELEM_tas3_ESLApply(struct zx_ctx * c,struct zx_tas3_ESLApply_s * x)102 int zx_DEC_ELEM_tas3_ESLApply(struct zx_ctx* c, struct zx_tas3_ESLApply_s* x)
103 {
104   struct zx_elem_s* el = x->gg.kids;
105   switch (el->g.tok) {
106   case zx_tas3_ESLRef_ELEM:
107     if (!x->ESLRef)
108       x->ESLRef = (struct zx_tas3_ESLRef_s*)el;
109     return 1;
110   case zx_xa_Obligation_ELEM:
111     if (!x->Obligation)
112       x->Obligation = (struct zx_xa_Obligation_s*)el;
113     return 1;
114 
115   default: return 0;
116   }
117 }
118 
119 
120 
121 
zx_DEC_ATTR_tas3_ESLPolicies(struct zx_ctx * c,struct zx_tas3_ESLPolicies_s * x)122 int zx_DEC_ATTR_tas3_ESLPolicies(struct zx_ctx* c, struct zx_tas3_ESLPolicies_s* x)
123 {
124   switch (x->gg.attr->g.tok) {
125     case zx_id_ATTR:  x->id = x->gg.attr; return 1;
126     case zx_usage_ATTR:  x->usage = x->gg.attr; return 1;
127     case zx_Id_ATTR|zx_wsu_NS:  x->Id = x->gg.attr; return 1;
128     case zx_actor_ATTR|zx_e_NS:  x->actor = x->gg.attr; return 1;
129     case zx_mustUnderstand_ATTR|zx_e_NS:  x->mustUnderstand = x->gg.attr; return 1;
130 
131   default: return 0;
132   }
133 }
134 
zx_DEC_ELEM_tas3_ESLPolicies(struct zx_ctx * c,struct zx_tas3_ESLPolicies_s * x)135 int zx_DEC_ELEM_tas3_ESLPolicies(struct zx_ctx* c, struct zx_tas3_ESLPolicies_s* x)
136 {
137   struct zx_elem_s* el = x->gg.kids;
138   switch (el->g.tok) {
139   case zx_tas3_ESLApply_ELEM:
140     if (!x->ESLApply)
141       x->ESLApply = (struct zx_tas3_ESLApply_s*)el;
142     return 1;
143 
144   default: return 0;
145   }
146 }
147 
148 
149 
150 
zx_DEC_ATTR_tas3_ESLRef(struct zx_ctx * c,struct zx_tas3_ESLRef_s * x)151 int zx_DEC_ATTR_tas3_ESLRef(struct zx_ctx* c, struct zx_tas3_ESLRef_s* x)
152 {
153   switch (x->gg.attr->g.tok) {
154     case zx_ref_ATTR:  x->ref = x->gg.attr; return 1;
155     case zx_xpath_ATTR:  x->xpath = x->gg.attr; return 1;
156 
157   default: return 0;
158   }
159 }
160 
zx_DEC_ELEM_tas3_ESLRef(struct zx_ctx * c,struct zx_tas3_ESLRef_s * x)161 int zx_DEC_ELEM_tas3_ESLRef(struct zx_ctx* c, struct zx_tas3_ESLRef_s* x)
162 {
163   struct zx_elem_s* el = x->gg.kids;
164   switch (el->g.tok) {
165 
166   default: return 0;
167   }
168 }
169 
170 
171 
172 
zx_DEC_ATTR_tas3_Status(struct zx_ctx * c,struct zx_tas3_Status_s * x)173 int zx_DEC_ATTR_tas3_Status(struct zx_ctx* c, struct zx_tas3_Status_s* x)
174 {
175   switch (x->gg.attr->g.tok) {
176     case zx_code_ATTR:  x->code = x->gg.attr; return 1;
177     case zx_comment_ATTR:  x->comment = x->gg.attr; return 1;
178     case zx_ctlpt_ATTR:  x->ctlpt = x->gg.attr; return 1;
179     case zx_id_ATTR:  x->id = x->gg.attr; return 1;
180     case zx_ref_ATTR:  x->ref = x->gg.attr; return 1;
181     case zx_Id_ATTR|zx_wsu_NS:  x->Id = x->gg.attr; return 1;
182     case zx_actor_ATTR|zx_e_NS:  x->actor = x->gg.attr; return 1;
183     case zx_mustUnderstand_ATTR|zx_e_NS:  x->mustUnderstand = x->gg.attr; return 1;
184 
185   default: return 0;
186   }
187 }
188 
zx_DEC_ELEM_tas3_Status(struct zx_ctx * c,struct zx_tas3_Status_s * x)189 int zx_DEC_ELEM_tas3_Status(struct zx_ctx* c, struct zx_tas3_Status_s* x)
190 {
191   struct zx_elem_s* el = x->gg.kids;
192   switch (el->g.tok) {
193   case zx_lu_Status_ELEM:
194     if (!x->Status)
195       x->Status = (struct zx_lu_Status_s*)el;
196     return 1;
197 
198   default: return 0;
199   }
200 }
201 
202 
203 
204 
zx_DEC_ATTR_tas3_Trust(struct zx_ctx * c,struct zx_tas3_Trust_s * x)205 int zx_DEC_ATTR_tas3_Trust(struct zx_ctx* c, struct zx_tas3_Trust_s* x)
206 {
207   switch (x->gg.attr->g.tok) {
208     case zx_vers_ATTR:  x->vers = x->gg.attr; return 1;
209 
210   default: return 0;
211   }
212 }
213 
zx_DEC_ELEM_tas3_Trust(struct zx_ctx * c,struct zx_tas3_Trust_s * x)214 int zx_DEC_ELEM_tas3_Trust(struct zx_ctx* c, struct zx_tas3_Trust_s* x)
215 {
216   struct zx_elem_s* el = x->gg.kids;
217   switch (el->g.tok) {
218   case zx_tas3_TrustRanking_ELEM:
219     if (!x->TrustRanking)
220       x->TrustRanking = (struct zx_tas3_TrustRanking_s*)el;
221     return 1;
222 
223   default: return 0;
224   }
225 }
226 
227 
228 
229 
zx_DEC_ATTR_tas3_TrustRanking(struct zx_ctx * c,struct zx_tas3_TrustRanking_s * x)230 int zx_DEC_ATTR_tas3_TrustRanking(struct zx_ctx* c, struct zx_tas3_TrustRanking_s* x)
231 {
232   switch (x->gg.attr->g.tok) {
233     case zx_metric_ATTR:  x->metric = x->gg.attr; return 1;
234     case zx_val_ATTR:  x->val = x->gg.attr; return 1;
235 
236   default: return 0;
237   }
238 }
239 
zx_DEC_ELEM_tas3_TrustRanking(struct zx_ctx * c,struct zx_tas3_TrustRanking_s * x)240 int zx_DEC_ELEM_tas3_TrustRanking(struct zx_ctx* c, struct zx_tas3_TrustRanking_s* x)
241 {
242   struct zx_elem_s* el = x->gg.kids;
243   switch (el->g.tok) {
244 
245   default: return 0;
246   }
247 }
248 
249 
250 /* EOF -- c/zx-tas3-dec.c */
251