/* c/zx-demomed-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-demomed-data.h"
#define TPF zx_
#include "zx_ext_pt.h"



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

  default: return 0;
  }
}

int zx_DEC_ELEM_demomed_DeleteObjectRequest(struct zx_ctx* c, struct zx_demomed_DeleteObjectRequest_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_demomed_ObjectID_ELEM:
    if (!x->ObjectID)
      x->ObjectID = el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_demomed_DeleteObjectResponse(struct zx_ctx* c, struct zx_demomed_DeleteObjectResponse_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_demomed_Count_ELEM:
    if (!x->Count)
      x->Count = el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_demomed_GetObjectListRequest(struct zx_ctx* c, struct zx_demomed_GetObjectListRequest_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_demomed_ObjectSearchParm_ELEM:
    if (!x->ObjectSearchParm)
      x->ObjectSearchParm = (struct zx_demomed_ObjectSearchParm_s*)el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_demomed_GetObjectListResponse(struct zx_ctx* c, struct zx_demomed_GetObjectListResponse_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_demomed_ObjectInfo_ELEM:
    if (!x->ObjectInfo)
      x->ObjectInfo = (struct zx_demomed_ObjectInfo_s*)el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_demomed_GetObjectRequest(struct zx_ctx* c, struct zx_demomed_GetObjectRequest_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_demomed_ObjectID_ELEM:
    if (!x->ObjectID)
      x->ObjectID = el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_demomed_GetObjectResponse(struct zx_ctx* c, struct zx_demomed_GetObjectResponse_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_demomed_ObjectData_ELEM:
    if (!x->ObjectData)
      x->ObjectData = (struct zx_demomed_ObjectData_s*)el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_demomed_Object(struct zx_ctx* c, struct zx_demomed_Object_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_demomed_ObjectInfo_ELEM:
    if (!x->ObjectInfo)
      x->ObjectInfo = (struct zx_demomed_ObjectInfo_s*)el;
    return 1;
  case zx_demomed_ObjectData_ELEM:
    if (!x->ObjectData)
      x->ObjectData = (struct zx_demomed_ObjectData_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_demomed_ObjectData(struct zx_ctx* c, struct zx_demomed_ObjectData_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_objectID_ATTR:  x->objectID = x->gg.attr; return 1;

  default: return 0;
  }
}

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

  default: return 0;
  }
}




int zx_DEC_ATTR_demomed_ObjectInfo(struct zx_ctx* c, struct zx_demomed_ObjectInfo_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_objectID_ATTR:  x->objectID = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_demomed_ObjectInfo(struct zx_ctx* c, struct zx_demomed_ObjectInfo_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_demomed_Dir_ELEM:
    if (!x->Dir)
      x->Dir = el;
    return 1;
  case zx_demomed_Name_ELEM:
    if (!x->Name)
      x->Name = el;
    return 1;
  case zx_demomed_Type_ELEM:
    if (!x->Type)
      x->Type = el;
    return 1;
  case zx_demomed_Created_ELEM:
    if (!x->Created)
      x->Created = el;
    return 1;
  case zx_demomed_Comment_ELEM:
    if (!x->Comment)
      x->Comment = el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_demomed_ObjectSearchParm(struct zx_ctx* c, struct zx_demomed_ObjectSearchParm_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_demomed_Dir_ELEM:
    if (!x->Dir)
      x->Dir = el;
    return 1;
  case zx_demomed_Name_ELEM:
    if (!x->Name)
      x->Name = el;
    return 1;
  case zx_demomed_Type_ELEM:
    if (!x->Type)
      x->Type = el;
    return 1;
  case zx_demomed_objectID_ELEM:
    if (!x->objectID)
      x->objectID = el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_demomed_ObjectStoreInfo(struct zx_ctx* c, struct zx_demomed_ObjectStoreInfo_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_objectID_ATTR:  x->objectID = x->gg.attr; return 1;
    case zx_storeRef_ATTR:  x->storeRef = x->gg.attr; return 1;

  default: return 0;
  }
}

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

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_demomed_StoreObjectRequest(struct zx_ctx* c, struct zx_demomed_StoreObjectRequest_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_demomed_Object_ELEM:
    if (!x->Object)
      x->Object = (struct zx_demomed_Object_s*)el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_demomed_StoreObjectResponse(struct zx_ctx* c, struct zx_demomed_StoreObjectResponse_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_demomed_ObjectStoreInfo_ELEM:
    if (!x->ObjectStoreInfo)
      x->ObjectStoreInfo = (struct zx_demomed_ObjectStoreInfo_s*)el;
    return 1;

  default: return 0;
  }
}


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