Branch data Line data Source code
1 : : /* c/zx-as-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-as-data.h"
36 : : #define TPF zx_
37 : : #include "zx_ext_pt.h"
38 : :
39 : :
40 : :
41 : : int zx_DEC_ATTR_as_Extensions(struct zx_ctx* c, struct zx_as_Extensions_s* x)
42 : 0 : {
43 : 0 : switch (x->gg.attr->g.tok) {
44 : :
45 : 0 : default: return 0;
46 : : }
47 : : }
48 : :
49 : : int zx_DEC_ELEM_as_Extensions(struct zx_ctx* c, struct zx_as_Extensions_s* x)
50 : 0 : {
51 : 0 : struct zx_elem_s* el = x->gg.kids;
52 : 0 : switch (el->g.tok) {
53 : :
54 : 0 : default: return 0;
55 : : }
56 : : }
57 : :
58 : :
59 : :
60 : :
61 : : int zx_DEC_ATTR_as_Parameter(struct zx_ctx* c, struct zx_as_Parameter_s* x)
62 : 0 : {
63 [ # # ]: 0 : switch (x->gg.attr->g.tok) {
64 : 0 : case zx_name_ATTR: x->name = x->gg.attr; return 1;
65 : :
66 : 0 : default: return 0;
67 : : }
68 : : }
69 : :
70 : : int zx_DEC_ELEM_as_Parameter(struct zx_ctx* c, struct zx_as_Parameter_s* x)
71 : 0 : {
72 : 0 : struct zx_elem_s* el = x->gg.kids;
73 : 0 : switch (el->g.tok) {
74 : :
75 : 0 : default: return 0;
76 : : }
77 : : }
78 : :
79 : :
80 : :
81 : :
82 : : int zx_DEC_ATTR_as_PasswordTransforms(struct zx_ctx* c, struct zx_as_PasswordTransforms_s* x)
83 : 0 : {
84 : 0 : switch (x->gg.attr->g.tok) {
85 : :
86 : 0 : default: return 0;
87 : : }
88 : : }
89 : :
90 : : int zx_DEC_ELEM_as_PasswordTransforms(struct zx_ctx* c, struct zx_as_PasswordTransforms_s* x)
91 : 0 : {
92 : 0 : struct zx_elem_s* el = x->gg.kids;
93 [ # # ]: 0 : switch (el->g.tok) {
94 : : case zx_as_Transform_ELEM:
95 [ # # ]: 0 : if (!x->Transform)
96 : 0 : x->Transform = (struct zx_as_Transform_s*)el;
97 : 0 : return 1;
98 : :
99 : 0 : default: return 0;
100 : : }
101 : : }
102 : :
103 : :
104 : :
105 : :
106 : : int zx_DEC_ATTR_as_SASLRequest(struct zx_ctx* c, struct zx_as_SASLRequest_s* x)
107 : 1018 : {
108 [ - - + - ]: 1018 : switch (x->gg.attr->g.tok) {
109 : 0 : case zx_advisoryAuthnID_ATTR: x->advisoryAuthnID = x->gg.attr; return 1;
110 : 0 : case zx_authzID_ATTR: x->authzID = x->gg.attr; return 1;
111 : 1018 : case zx_mechanism_ATTR: x->mechanism = x->gg.attr; return 1;
112 : :
113 : 0 : default: return 0;
114 : : }
115 : : }
116 : :
117 : : int zx_DEC_ELEM_as_SASLRequest(struct zx_ctx* c, struct zx_as_SASLRequest_s* x)
118 : 1018 : {
119 : 1018 : struct zx_elem_s* el = x->gg.kids;
120 [ + - - - ]: 1018 : switch (el->g.tok) {
121 : : case zx_as_Data_ELEM:
122 [ + - ]: 1018 : if (!x->Data)
123 : 1018 : x->Data = el;
124 : 1018 : return 1;
125 : : case zx_sp_RequestedAuthnContext_ELEM:
126 [ # # ]: 0 : if (!x->RequestedAuthnContext)
127 : 0 : x->RequestedAuthnContext = (struct zx_sp_RequestedAuthnContext_s*)el;
128 : 0 : return 1;
129 : : case zx_as_Extensions_ELEM:
130 [ # # ]: 0 : if (!x->Extensions)
131 : 0 : x->Extensions = (struct zx_as_Extensions_s*)el;
132 : 0 : return 1;
133 : :
134 : 0 : default: return 0;
135 : : }
136 : : }
137 : :
138 : :
139 : :
140 : :
141 : : int zx_DEC_ATTR_as_SASLResponse(struct zx_ctx* c, struct zx_as_SASLResponse_s* x)
142 : 0 : {
143 [ # # ]: 0 : switch (x->gg.attr->g.tok) {
144 : 0 : case zx_serverMechanism_ATTR: x->serverMechanism = x->gg.attr; return 1;
145 : :
146 : 0 : default: return 0;
147 : : }
148 : : }
149 : :
150 : : int zx_DEC_ELEM_as_SASLResponse(struct zx_ctx* c, struct zx_as_SASLResponse_s* x)
151 : 2047 : {
152 : 2047 : struct zx_elem_s* el = x->gg.kids;
153 [ + - - + : 2047 : switch (el->g.tok) {
- ]
154 : : case zx_lu_Status_ELEM:
155 [ + - ]: 1017 : if (!x->Status)
156 : 1017 : x->Status = (struct zx_lu_Status_s*)el;
157 : 1017 : return 1;
158 : : case zx_as_PasswordTransforms_ELEM:
159 [ # # ]: 0 : if (!x->PasswordTransforms)
160 : 0 : x->PasswordTransforms = (struct zx_as_PasswordTransforms_s*)el;
161 : 0 : return 1;
162 : : case zx_as_Data_ELEM:
163 [ # # ]: 0 : if (!x->Data)
164 : 0 : x->Data = el;
165 : 0 : return 1;
166 : : case zx_a_EndpointReference_ELEM:
167 [ + + ]: 1030 : if (!x->EndpointReference)
168 : 1015 : x->EndpointReference = (struct zx_a_EndpointReference_s*)el;
169 : 1030 : return 1;
170 : :
171 : 0 : default: return 0;
172 : : }
173 : : }
174 : :
175 : :
176 : :
177 : :
178 : : int zx_DEC_ATTR_as_Transform(struct zx_ctx* c, struct zx_as_Transform_s* x)
179 : 0 : {
180 [ # # ]: 0 : switch (x->gg.attr->g.tok) {
181 : 0 : case zx_name_ATTR: x->name = x->gg.attr; return 1;
182 : :
183 : 0 : default: return 0;
184 : : }
185 : : }
186 : :
187 : : int zx_DEC_ELEM_as_Transform(struct zx_ctx* c, struct zx_as_Transform_s* x)
188 : 0 : {
189 : 0 : struct zx_elem_s* el = x->gg.kids;
190 [ # # ]: 0 : switch (el->g.tok) {
191 : : case zx_as_Parameter_ELEM:
192 [ # # ]: 0 : if (!x->Parameter)
193 : 0 : x->Parameter = (struct zx_as_Parameter_s*)el;
194 : 0 : return 1;
195 : :
196 : 0 : default: return 0;
197 : : }
198 : : }
199 : :
200 : :
201 : : /* EOF -- c/zx-as-dec.c */
|