1 /* c/zx-wsu-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-wsu-data.h"
36 #define TPF zx_
37 #include "zx_ext_pt.h"
38
39
40
zx_DEC_ATTR_wsu_Created(struct zx_ctx * c,struct zx_wsu_Created_s * x)41 int zx_DEC_ATTR_wsu_Created(struct zx_ctx* c, struct zx_wsu_Created_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_id_ATTR: x->id = x->gg.attr; return 1;
46 case zx_Id_ATTR|zx_wsu_NS: x->Id = x->gg.attr; return 1;
47
48 default: return 0;
49 }
50 }
51
zx_DEC_ELEM_wsu_Created(struct zx_ctx * c,struct zx_wsu_Created_s * x)52 int zx_DEC_ELEM_wsu_Created(struct zx_ctx* c, struct zx_wsu_Created_s* x)
53 {
54 struct zx_elem_s* el = x->gg.kids;
55 switch (el->g.tok) {
56
57 default: return 0;
58 }
59 }
60
61
62
63
zx_DEC_ATTR_wsu_Expires(struct zx_ctx * c,struct zx_wsu_Expires_s * x)64 int zx_DEC_ATTR_wsu_Expires(struct zx_ctx* c, struct zx_wsu_Expires_s* x)
65 {
66 switch (x->gg.attr->g.tok) {
67 case zx_ID_ATTR: x->ID = x->gg.attr; return 1;
68 case zx_id_ATTR: x->id = x->gg.attr; return 1;
69 case zx_Id_ATTR|zx_wsu_NS: x->Id = x->gg.attr; return 1;
70
71 default: return 0;
72 }
73 }
74
zx_DEC_ELEM_wsu_Expires(struct zx_ctx * c,struct zx_wsu_Expires_s * x)75 int zx_DEC_ELEM_wsu_Expires(struct zx_ctx* c, struct zx_wsu_Expires_s* x)
76 {
77 struct zx_elem_s* el = x->gg.kids;
78 switch (el->g.tok) {
79
80 default: return 0;
81 }
82 }
83
84
85
86
zx_DEC_ATTR_wsu_Timestamp(struct zx_ctx * c,struct zx_wsu_Timestamp_s * x)87 int zx_DEC_ATTR_wsu_Timestamp(struct zx_ctx* c, struct zx_wsu_Timestamp_s* x)
88 {
89 switch (x->gg.attr->g.tok) {
90 case zx_ID_ATTR: x->ID = x->gg.attr; return 1;
91 case zx_id_ATTR: x->id = x->gg.attr; return 1;
92 case zx_Id_ATTR|zx_wsu_NS: x->Id = x->gg.attr; return 1;
93
94 default: return 0;
95 }
96 }
97
zx_DEC_ELEM_wsu_Timestamp(struct zx_ctx * c,struct zx_wsu_Timestamp_s * x)98 int zx_DEC_ELEM_wsu_Timestamp(struct zx_ctx* c, struct zx_wsu_Timestamp_s* x)
99 {
100 struct zx_elem_s* el = x->gg.kids;
101 switch (el->g.tok) {
102 case zx_wsu_Created_ELEM:
103 if (!x->Created)
104 x->Created = (struct zx_wsu_Created_s*)el;
105 return 1;
106 case zx_wsu_Expires_ELEM:
107 if (!x->Expires)
108 x->Expires = (struct zx_wsu_Expires_s*)el;
109 return 1;
110
111 default: return 0;
112 }
113 }
114
115
116 /* EOF -- c/zx-wsu-dec.c */
117