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



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

  default: return 0;
  }
}

int zx_DEC_ELEM_pmm_PMActivate(struct zx_ctx* c, struct zx_pmm_PMActivate_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_pmm_PMActivateItem_ELEM:
    if (!x->PMActivateItem)
      x->PMActivateItem = (struct zx_pmm_PMActivateItem_s*)el;
    return 1;
  case zx_dp_NotifyTo_ELEM:
    if (!x->NotifyTo)
      x->NotifyTo = el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_pmm_PMActivateItem(struct zx_ctx* c, struct zx_pmm_PMActivateItem_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_at_ATTR:  x->at = x->gg.attr; return 1;
    case zx_itemID_ATTR:  x->itemID = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_pmm_PMActivateItem(struct zx_ctx* c, struct zx_pmm_PMActivateItem_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_prov_PMID_ELEM:
    if (!x->PMID)
      x->PMID = (struct zx_prov_PMID_s*)el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_pmm_PMActivateResponse(struct zx_ctx* c, struct zx_pmm_PMActivateResponse_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_pmm_PMDeactivate(struct zx_ctx* c, struct zx_pmm_PMDeactivate_s* x)
{
  switch (x->gg.attr->g.tok) {

  default: return 0;
  }
}

int zx_DEC_ELEM_pmm_PMDeactivate(struct zx_ctx* c, struct zx_pmm_PMDeactivate_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_pmm_PMDeactivateItem_ELEM:
    if (!x->PMDeactivateItem)
      x->PMDeactivateItem = (struct zx_pmm_PMDeactivateItem_s*)el;
    return 1;
  case zx_dp_NotifyTo_ELEM:
    if (!x->NotifyTo)
      x->NotifyTo = el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_pmm_PMDeactivateItem(struct zx_ctx* c, struct zx_pmm_PMDeactivateItem_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_at_ATTR:  x->at = x->gg.attr; return 1;
    case zx_itemID_ATTR:  x->itemID = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_pmm_PMDeactivateItem(struct zx_ctx* c, struct zx_pmm_PMDeactivateItem_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_prov_PMID_ELEM:
    if (!x->PMID)
      x->PMID = (struct zx_prov_PMID_s*)el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_pmm_PMDeactivateResponse(struct zx_ctx* c, struct zx_pmm_PMDeactivateResponse_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_pmm_PMDelete(struct zx_ctx* c, struct zx_pmm_PMDelete_s* x)
{
  switch (x->gg.attr->g.tok) {

  default: return 0;
  }
}

int zx_DEC_ELEM_pmm_PMDelete(struct zx_ctx* c, struct zx_pmm_PMDelete_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_pmm_PMDeleteItem_ELEM:
    if (!x->PMDeleteItem)
      x->PMDeleteItem = (struct zx_pmm_PMDeleteItem_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_pmm_PMDeleteItem(struct zx_ctx* c, struct zx_pmm_PMDeleteItem_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_itemID_ATTR:  x->itemID = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_pmm_PMDeleteItem(struct zx_ctx* c, struct zx_pmm_PMDeleteItem_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_prov_PMID_ELEM:
    if (!x->PMID)
      x->PMID = (struct zx_prov_PMID_s*)el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_pmm_PMDeleteResponse(struct zx_ctx* c, struct zx_pmm_PMDeleteResponse_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_pmm_PMGetStatus(struct zx_ctx* c, struct zx_pmm_PMGetStatus_s* x)
{
  switch (x->gg.attr->g.tok) {

  default: return 0;
  }
}

int zx_DEC_ELEM_pmm_PMGetStatus(struct zx_ctx* c, struct zx_pmm_PMGetStatus_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_prov_PMID_ELEM:
    if (!x->PMID)
      x->PMID = (struct zx_prov_PMID_s*)el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_pmm_PMGetStatusResponse(struct zx_ctx* c, struct zx_pmm_PMGetStatusResponse_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_prov_PMStatus_ELEM:
    if (!x->PMStatus)
      x->PMStatus = (struct zx_prov_PMStatus_s*)el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_pmm_PMSetStatus(struct zx_ctx* c, struct zx_pmm_PMSetStatus_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_prov_PMStatus_ELEM:
    if (!x->PMStatus)
      x->PMStatus = (struct zx_prov_PMStatus_s*)el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_pmm_PMSetStatusResponse(struct zx_ctx* c, struct zx_pmm_PMSetStatusResponse_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_pmm_PMUpdate(struct zx_ctx* c, struct zx_pmm_PMUpdate_s* x)
{
  switch (x->gg.attr->g.tok) {

  default: return 0;
  }
}

int zx_DEC_ELEM_pmm_PMUpdate(struct zx_ctx* c, struct zx_pmm_PMUpdate_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_pmm_PMUpdateItem_ELEM:
    if (!x->PMUpdateItem)
      x->PMUpdateItem = (struct zx_pmm_PMUpdateItem_s*)el;
    return 1;
  case zx_dp_NotifyTo_ELEM:
    if (!x->NotifyTo)
      x->NotifyTo = el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_pmm_PMUpdateItem(struct zx_ctx* c, struct zx_pmm_PMUpdateItem_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_at_ATTR:  x->at = x->gg.attr; return 1;
    case zx_itemID_ATTR:  x->itemID = x->gg.attr; return 1;
    case zx_type_ATTR:  x->type = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_pmm_PMUpdateItem(struct zx_ctx* c, struct zx_pmm_PMUpdateItem_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_prov_PMDescriptor_ELEM:
    if (!x->PMDescriptor)
      x->PMDescriptor = (struct zx_prov_PMDescriptor_s*)el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_pmm_PMUpdateResponse(struct zx_ctx* c, struct zx_pmm_PMUpdateResponse_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_pmm_Provision(struct zx_ctx* c, struct zx_pmm_Provision_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_wait_ATTR:  x->wait = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_pmm_Provision(struct zx_ctx* c, struct zx_pmm_Provision_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_prov_ProvisioningHandle_ELEM:
    if (!x->ProvisioningHandle)
      x->ProvisioningHandle = (struct zx_prov_ProvisioningHandle_s*)el;
    return 1;
  case zx_prov_PMDescriptor_ELEM:
    if (!x->PMDescriptor)
      x->PMDescriptor = (struct zx_prov_PMDescriptor_s*)el;
    return 1;
  case zx_dp_NotifyTo_ELEM:
    if (!x->NotifyTo)
      x->NotifyTo = el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_pmm_ProvisionResponse(struct zx_ctx* c, struct zx_pmm_ProvisionResponse_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-pmm-dec.c */
