/* c/zx-di-dec.c - WARNING: This file was auto generated by xsd2sg.pl. DO NOT EDIT!
 * $Id$ */
/* Code generation design Copyright (c) 2006 Sampo Kellomaki (sampo@iki.fi),
 * All Rights Reserved. NO WARRANTY. See file COPYING for terms and conditions
 * of use. Some aspects of code generation were driven by schema
 * descriptions that were used as input and may be subject to their own copyright.
 * Code generation uses a template, whose copyright statement follows. */

/** dec-templ.c  -  XML decoder template, used in code generation
 ** Copyright (c) 2010 Sampo Kellomaki (sampo@iki.fi), All Rights Reserved.
 ** Copyright (c) 2006-2007 Symlabs (symlabs@symlabs.com), All Rights Reserved.
 ** Author: Sampo Kellomaki (sampo@iki.fi)
 ** This is confidential unpublished proprietary source code of the author.
 ** NO WARRANTY, not even implied warranties. Contains trade secrets.
 ** Distribution prohibited unless authorized in writing.
 ** Licensed under Apache License 2.0, see file COPYING.
 ** Id: dec-templ.c,v 1.30 2008-10-04 23:42:14 sampo Exp $
 **
 ** 28.5.2006, created, Sampo Kellomaki (sampo@iki.fi)
 ** 8.8.2006,  reworked namespace handling --Sampo
 ** 12.8.2006, added special scanning of xmlns to avoid backtracking elem recognition --Sampo
 ** 23.9.2006, added collection of WO information --Sampo
 ** 21.6.2007, improved handling of undeclared namespace prefixes --Sampo
 ** 27.10.2010, CSE refactoring, re-engineered namespace handling --Sampo
 ** 21.11.2010, re-engineered to extract most code to zx_DEC_elem, leaving just switches --Sampo
 **
 ** N.B: This template is meant to be processed by pd/xsd2sg.pl. Beware
 ** of special markers that xsd2sg.pl expects to find and understand.
 **/

#include "errmac.h"
#include "zx.h"
#include "c/zx-const.h"
#include "c/zx-data.h"
#include "c/zx-di-data.h"
#define TPF zx_
#include "zx_ext_pt.h"



int zx_DEC_ATTR_di_EndpointContext(struct zx_ctx* c, struct zx_di_EndpointContext_s* x)
{
  switch (x->gg.attr->g.tok) {

  default: return 0;
  }
}

int zx_DEC_ELEM_di_EndpointContext(struct zx_ctx* c, struct zx_di_EndpointContext_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_di_Address_ELEM:
    if (!x->Address)
      x->Address = el;
    return 1;
  case zx_sbf_Framework_ELEM:
    if (!x->Framework)
      x->Framework = (struct zx_sbf_Framework_s*)el;
    return 1;
  case zx_di_SecurityMechID_ELEM:
    if (!x->SecurityMechID)
      x->SecurityMechID = el;
    return 1;
  case zx_di_Action_ELEM:
    if (!x->Action)
      x->Action = el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_di_Framework(struct zx_ctx* c, struct zx_di_Framework_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_version_ATTR:  x->version = x->gg.attr; return 1;
    case zx_Id_ATTR|zx_wsu_NS:  x->Id = x->gg.attr; return 1;
    case zx_actor_ATTR|zx_e_NS:  x->actor = x->gg.attr; return 1;
    case zx_mustUnderstand_ATTR|zx_e_NS:  x->mustUnderstand = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_di_Framework(struct zx_ctx* c, struct zx_di_Framework_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {

  default: return 0;
  }
}




int zx_DEC_ATTR_di_Keys(struct zx_ctx* c, struct zx_di_Keys_s* x)
{
  switch (x->gg.attr->g.tok) {

  default: return 0;
  }
}

int zx_DEC_ELEM_di_Keys(struct zx_ctx* c, struct zx_di_Keys_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_md_KeyDescriptor_ELEM:
    if (!x->KeyDescriptor)
      x->KeyDescriptor = (struct zx_md_KeyDescriptor_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_di_Options(struct zx_ctx* c, struct zx_di_Options_s* x)
{
  switch (x->gg.attr->g.tok) {

  default: return 0;
  }
}

int zx_DEC_ELEM_di_Options(struct zx_ctx* c, struct zx_di_Options_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_di_Option_ELEM:
    if (!x->Option)
      x->Option = el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_di_Query(struct zx_ctx* c, struct zx_di_Query_s* x)
{
  switch (x->gg.attr->g.tok) {

  default: return 0;
  }
}

int zx_DEC_ELEM_di_Query(struct zx_ctx* c, struct zx_di_Query_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_di_RequestedService_ELEM:
    if (!x->RequestedService)
      x->RequestedService = (struct zx_di_RequestedService_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_di_QueryResponse(struct zx_ctx* c, struct zx_di_QueryResponse_s* x)
{
  switch (x->gg.attr->g.tok) {

  default: return 0;
  }
}

int zx_DEC_ELEM_di_QueryResponse(struct zx_ctx* c, struct zx_di_QueryResponse_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_lu_Status_ELEM:
    if (!x->Status)
      x->Status = (struct zx_lu_Status_s*)el;
    return 1;
  case zx_a_EndpointReference_ELEM:
    if (!x->EndpointReference)
      x->EndpointReference = (struct zx_a_EndpointReference_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_di_RequestedService(struct zx_ctx* c, struct zx_di_RequestedService_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_reqID_ATTR:  x->reqID = x->gg.attr; return 1;
    case zx_resultsType_ATTR:  x->resultsType = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_di_RequestedService(struct zx_ctx* c, struct zx_di_RequestedService_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_di_ServiceType_ELEM:
    if (!x->ServiceType)
      x->ServiceType = el;
    return 1;
  case zx_di_ProviderID_ELEM:
    if (!x->ProviderID)
      x->ProviderID = el;
    return 1;
  case zx_di_Options_ELEM:
    if (!x->Options)
      x->Options = (struct zx_di_Options_s*)el;
    return 1;
  case zx_di_SecurityMechID_ELEM:
    if (!x->SecurityMechID)
      x->SecurityMechID = el;
    return 1;
  case zx_di_Framework_ELEM:
    if (!x->Framework)
      x->Framework = (struct zx_di_Framework_s*)el;
    return 1;
  case zx_di_Action_ELEM:
    if (!x->Action)
      x->Action = el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_di_SecurityContext(struct zx_ctx* c, struct zx_di_SecurityContext_s* x)
{
  switch (x->gg.attr->g.tok) {

  default: return 0;
  }
}

int zx_DEC_ELEM_di_SecurityContext(struct zx_ctx* c, struct zx_di_SecurityContext_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_di_SecurityMechID_ELEM:
    if (!x->SecurityMechID)
      x->SecurityMechID = el;
    return 1;
  case zx_sec_Token_ELEM:
    if (!x->Token)
      x->Token = (struct zx_sec_Token_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_di_ServiceContext(struct zx_ctx* c, struct zx_di_ServiceContext_s* x)
{
  switch (x->gg.attr->g.tok) {

  default: return 0;
  }
}

int zx_DEC_ELEM_di_ServiceContext(struct zx_ctx* c, struct zx_di_ServiceContext_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_di_ServiceType_ELEM:
    if (!x->ServiceType)
      x->ServiceType = el;
    return 1;
  case zx_di_Options_ELEM:
    if (!x->Options)
      x->Options = (struct zx_di_Options_s*)el;
    return 1;
  case zx_di_EndpointContext_ELEM:
    if (!x->EndpointContext)
      x->EndpointContext = (struct zx_di_EndpointContext_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_di_SvcMD(struct zx_ctx* c, struct zx_di_SvcMD_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_svcMDID_ATTR:  x->svcMDID = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_di_SvcMD(struct zx_ctx* c, struct zx_di_SvcMD_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_di_Abstract_ELEM:
    if (!x->Abstract)
      x->Abstract = el;
    return 1;
  case zx_di_ProviderID_ELEM:
    if (!x->ProviderID)
      x->ProviderID = el;
    return 1;
  case zx_di_ServiceContext_ELEM:
    if (!x->ServiceContext)
      x->ServiceContext = (struct zx_di_ServiceContext_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_di_SvcMDAssociationAdd(struct zx_ctx* c, struct zx_di_SvcMDAssociationAdd_s* x)
{
  switch (x->gg.attr->g.tok) {

  default: return 0;
  }
}

int zx_DEC_ELEM_di_SvcMDAssociationAdd(struct zx_ctx* c, struct zx_di_SvcMDAssociationAdd_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_di_SvcMDID_ELEM:
    if (!x->SvcMDID)
      x->SvcMDID = el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_di_SvcMDAssociationAddResponse(struct zx_ctx* c, struct zx_di_SvcMDAssociationAddResponse_s* x)
{
  switch (x->gg.attr->g.tok) {

  default: return 0;
  }
}

int zx_DEC_ELEM_di_SvcMDAssociationAddResponse(struct zx_ctx* c, struct zx_di_SvcMDAssociationAddResponse_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_lu_Status_ELEM:
    if (!x->Status)
      x->Status = (struct zx_lu_Status_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_di_SvcMDAssociationDelete(struct zx_ctx* c, struct zx_di_SvcMDAssociationDelete_s* x)
{
  switch (x->gg.attr->g.tok) {

  default: return 0;
  }
}

int zx_DEC_ELEM_di_SvcMDAssociationDelete(struct zx_ctx* c, struct zx_di_SvcMDAssociationDelete_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_di_SvcMDID_ELEM:
    if (!x->SvcMDID)
      x->SvcMDID = el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_di_SvcMDAssociationDeleteResponse(struct zx_ctx* c, struct zx_di_SvcMDAssociationDeleteResponse_s* x)
{
  switch (x->gg.attr->g.tok) {

  default: return 0;
  }
}

int zx_DEC_ELEM_di_SvcMDAssociationDeleteResponse(struct zx_ctx* c, struct zx_di_SvcMDAssociationDeleteResponse_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_lu_Status_ELEM:
    if (!x->Status)
      x->Status = (struct zx_lu_Status_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_di_SvcMDAssociationQuery(struct zx_ctx* c, struct zx_di_SvcMDAssociationQuery_s* x)
{
  switch (x->gg.attr->g.tok) {

  default: return 0;
  }
}

int zx_DEC_ELEM_di_SvcMDAssociationQuery(struct zx_ctx* c, struct zx_di_SvcMDAssociationQuery_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_di_SvcMDID_ELEM:
    if (!x->SvcMDID)
      x->SvcMDID = el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_di_SvcMDAssociationQueryResponse(struct zx_ctx* c, struct zx_di_SvcMDAssociationQueryResponse_s* x)
{
  switch (x->gg.attr->g.tok) {

  default: return 0;
  }
}

int zx_DEC_ELEM_di_SvcMDAssociationQueryResponse(struct zx_ctx* c, struct zx_di_SvcMDAssociationQueryResponse_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_lu_Status_ELEM:
    if (!x->Status)
      x->Status = (struct zx_lu_Status_s*)el;
    return 1;
  case zx_di_SvcMDID_ELEM:
    if (!x->SvcMDID)
      x->SvcMDID = el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_di_SvcMDDelete(struct zx_ctx* c, struct zx_di_SvcMDDelete_s* x)
{
  switch (x->gg.attr->g.tok) {

  default: return 0;
  }
}

int zx_DEC_ELEM_di_SvcMDDelete(struct zx_ctx* c, struct zx_di_SvcMDDelete_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_di_SvcMDID_ELEM:
    if (!x->SvcMDID)
      x->SvcMDID = el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_di_SvcMDDeleteResponse(struct zx_ctx* c, struct zx_di_SvcMDDeleteResponse_s* x)
{
  switch (x->gg.attr->g.tok) {

  default: return 0;
  }
}

int zx_DEC_ELEM_di_SvcMDDeleteResponse(struct zx_ctx* c, struct zx_di_SvcMDDeleteResponse_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_lu_Status_ELEM:
    if (!x->Status)
      x->Status = (struct zx_lu_Status_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_di_SvcMDQuery(struct zx_ctx* c, struct zx_di_SvcMDQuery_s* x)
{
  switch (x->gg.attr->g.tok) {

  default: return 0;
  }
}

int zx_DEC_ELEM_di_SvcMDQuery(struct zx_ctx* c, struct zx_di_SvcMDQuery_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_di_SvcMDID_ELEM:
    if (!x->SvcMDID)
      x->SvcMDID = el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_di_SvcMDQueryResponse(struct zx_ctx* c, struct zx_di_SvcMDQueryResponse_s* x)
{
  switch (x->gg.attr->g.tok) {

  default: return 0;
  }
}

int zx_DEC_ELEM_di_SvcMDQueryResponse(struct zx_ctx* c, struct zx_di_SvcMDQueryResponse_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_lu_Status_ELEM:
    if (!x->Status)
      x->Status = (struct zx_lu_Status_s*)el;
    return 1;
  case zx_di_SvcMD_ELEM:
    if (!x->SvcMD)
      x->SvcMD = (struct zx_di_SvcMD_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_di_SvcMDRegister(struct zx_ctx* c, struct zx_di_SvcMDRegister_s* x)
{
  switch (x->gg.attr->g.tok) {

  default: return 0;
  }
}

int zx_DEC_ELEM_di_SvcMDRegister(struct zx_ctx* c, struct zx_di_SvcMDRegister_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_di_SvcMD_ELEM:
    if (!x->SvcMD)
      x->SvcMD = (struct zx_di_SvcMD_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_di_SvcMDRegisterResponse(struct zx_ctx* c, struct zx_di_SvcMDRegisterResponse_s* x)
{
  switch (x->gg.attr->g.tok) {

  default: return 0;
  }
}

int zx_DEC_ELEM_di_SvcMDRegisterResponse(struct zx_ctx* c, struct zx_di_SvcMDRegisterResponse_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_lu_Status_ELEM:
    if (!x->Status)
      x->Status = (struct zx_lu_Status_s*)el;
    return 1;
  case zx_di_SvcMDID_ELEM:
    if (!x->SvcMDID)
      x->SvcMDID = el;
    return 1;
  case zx_di_Keys_ELEM:
    if (!x->Keys)
      x->Keys = (struct zx_di_Keys_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_di_SvcMDReplace(struct zx_ctx* c, struct zx_di_SvcMDReplace_s* x)
{
  switch (x->gg.attr->g.tok) {

  default: return 0;
  }
}

int zx_DEC_ELEM_di_SvcMDReplace(struct zx_ctx* c, struct zx_di_SvcMDReplace_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_di_SvcMD_ELEM:
    if (!x->SvcMD)
      x->SvcMD = (struct zx_di_SvcMD_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_di_SvcMDReplaceResponse(struct zx_ctx* c, struct zx_di_SvcMDReplaceResponse_s* x)
{
  switch (x->gg.attr->g.tok) {

  default: return 0;
  }
}

int zx_DEC_ELEM_di_SvcMDReplaceResponse(struct zx_ctx* c, struct zx_di_SvcMDReplaceResponse_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_lu_Status_ELEM:
    if (!x->Status)
      x->Status = (struct zx_lu_Status_s*)el;
    return 1;

  default: return 0;
  }
}


/* EOF -- c/zx-di-dec.c */
