1 /* c/zx-im-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-im-data.h" 36 #define TPF zx_ 37 #include "zx_ext_pt.h" 38 39 40 41 int zx_DEC_ATTR_im_IdentityMappingRequest(struct zx_ctx* c, struct zx_im_IdentityMappingRequest_s* x) 42 { 43 switch (x->gg.attr->g.tok) { 44 45 default: return 0; 46 } 47 } 48 49 int zx_DEC_ELEM_im_IdentityMappingRequest(struct zx_ctx* c, struct zx_im_IdentityMappingRequest_s* x) 50 { 51 struct zx_elem_s* el = x->gg.kids; 52 switch (el->g.tok) { 53 case zx_im_MappingInput_ELEM: 54 if (!x->MappingInput) 55 x->MappingInput = (struct zx_im_MappingInput_s*)el; 56 return 1; 57 58 default: return 0; 59 } 60 } 61 62 63 64 65 int zx_DEC_ATTR_im_IdentityMappingResponse(struct zx_ctx* c, struct zx_im_IdentityMappingResponse_s* x) 66 { 67 switch (x->gg.attr->g.tok) { 68 69 default: return 0; 70 } 71 } 72 73 int zx_DEC_ELEM_im_IdentityMappingResponse(struct zx_ctx* c, struct zx_im_IdentityMappingResponse_s* x) 74 { 75 struct zx_elem_s* el = x->gg.kids; 76 switch (el->g.tok) { 77 case zx_lu_Status_ELEM: 78 if (!x->Status) 79 x->Status = (struct zx_lu_Status_s*)el; 80 return 1; 81 case zx_im_MappingOutput_ELEM: 82 if (!x->MappingOutput) 83 x->MappingOutput = (struct zx_im_MappingOutput_s*)el; 84 return 1; 85 86 default: return 0; 87 } 88 } 89 90 91 92 93 int zx_DEC_ATTR_im_MappingInput(struct zx_ctx* c, struct zx_im_MappingInput_s* x) 94 { 95 switch (x->gg.attr->g.tok) { 96 case zx_reqID_ATTR: x->reqID = x->gg.attr; return 1; 97 98 default: return 0; 99 } 100 } 101 102 int zx_DEC_ELEM_im_MappingInput(struct zx_ctx* c, struct zx_im_MappingInput_s* x) 103 { 104 struct zx_elem_s* el = x->gg.kids; 105 switch (el->g.tok) { 106 case zx_sec_TokenPolicy_ELEM: 107 if (!x->TokenPolicy) 108 x->TokenPolicy = (struct zx_sec_TokenPolicy_s*)el; 109 return 1; 110 case zx_sec_Token_ELEM: 111 if (!x->Token) 112 x->Token = (struct zx_sec_Token_s*)el; 113 return 1; 114 115 default: return 0; 116 } 117 } 118 119 120 121 122 int zx_DEC_ATTR_im_MappingOutput(struct zx_ctx* c, struct zx_im_MappingOutput_s* x) 123 { 124 switch (x->gg.attr->g.tok) { 125 case zx_reqRef_ATTR: x->reqRef = x->gg.attr; return 1; 126 127 default: return 0; 128 } 129 } 130 131 int zx_DEC_ELEM_im_MappingOutput(struct zx_ctx* c, struct zx_im_MappingOutput_s* x) 132 { 133 struct zx_elem_s* el = x->gg.kids; 134 switch (el->g.tok) { 135 case zx_sec_Token_ELEM: 136 if (!x->Token) 137 x->Token = (struct zx_sec_Token_s*)el; 138 return 1; 139 140 default: return 0; 141 } 142 } 143 144 145 /* EOF -- c/zx-im-dec.c */ 146