/**********************************************************
 * This file has been automatically created by "typemaker2"
 * from the file "bankinfoservice.xml".
 * Please do not edit this file, all changes will be lost.
 * Better edit the mentioned source file instead.
 **********************************************************/

#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

#include "./bankinfoservice_p.h"

#include <gwenhywfar/misc.h>
#include <gwenhywfar/debug.h>

/* code headers */

/* macro functions */
GWEN_LIST_FUNCTIONS(AB_BANKINFO_SERVICE, AB_BankInfoService)
GWEN_LIST2_FUNCTIONS(AB_BANKINFO_SERVICE, AB_BankInfoService)


AB_BANKINFO_SERVICE *AB_BankInfoService_new(void) {
  AB_BANKINFO_SERVICE *p_struct;

  GWEN_NEW_OBJECT(AB_BANKINFO_SERVICE, p_struct)
  p_struct->_refCount=1;
  GWEN_LIST_INIT(AB_BANKINFO_SERVICE, p_struct)
  /* members */
  p_struct->type=NULL;
  p_struct->address=NULL;
  p_struct->suffix=NULL;
  p_struct->pversion=NULL;
  p_struct->hversion=NULL;
  p_struct->mode=NULL;
  p_struct->aux1=NULL;
  p_struct->aux2=NULL;
  p_struct->aux3=NULL;
  p_struct->aux4=NULL;
  p_struct->userFlags=0;
  /* virtual functions */

  return p_struct;
}

void AB_BankInfoService_free(AB_BANKINFO_SERVICE *p_struct) {
  if (p_struct) {
  assert(p_struct->_refCount);
  if (p_struct->_refCount==1) {
    GWEN_LIST_FINI(AB_BANKINFO_SERVICE, p_struct)
  /* members */
    free(p_struct->type); p_struct->type=NULL;
    free(p_struct->address); p_struct->address=NULL;
    free(p_struct->suffix); p_struct->suffix=NULL;
    free(p_struct->pversion); p_struct->pversion=NULL;
    free(p_struct->hversion); p_struct->hversion=NULL;
    free(p_struct->mode); p_struct->mode=NULL;
    free(p_struct->aux1); p_struct->aux1=NULL;
    free(p_struct->aux2); p_struct->aux2=NULL;
    free(p_struct->aux3); p_struct->aux3=NULL;
    free(p_struct->aux4); p_struct->aux4=NULL;
    p_struct->_refCount=0;
    GWEN_FREE_OBJECT(p_struct);
  }
  else
    p_struct->_refCount--;
  }
}

void AB_BankInfoService_Attach(AB_BANKINFO_SERVICE *p_struct) {
  assert(p_struct);
  assert(p_struct->_refCount);
  p_struct->_refCount++;
}

AB_BANKINFO_SERVICE *AB_BankInfoService_dup(const AB_BANKINFO_SERVICE *p_src) {
  AB_BANKINFO_SERVICE *p_struct;

  assert(p_src);
  p_struct=AB_BankInfoService_new();
  /* member "type" */
  if (p_struct->type) {
    free(p_struct->type); p_struct->type=NULL;
    p_struct->type=NULL;
  }
  if (p_src->type) {
    p_struct->type=strdup(p_src->type);
  }


  /* member "address" */
  if (p_struct->address) {
    free(p_struct->address); p_struct->address=NULL;
    p_struct->address=NULL;
  }
  if (p_src->address) {
    p_struct->address=strdup(p_src->address);
  }


  /* member "suffix" */
  if (p_struct->suffix) {
    free(p_struct->suffix); p_struct->suffix=NULL;
    p_struct->suffix=NULL;
  }
  if (p_src->suffix) {
    p_struct->suffix=strdup(p_src->suffix);
  }


  /* member "pversion" */
  if (p_struct->pversion) {
    free(p_struct->pversion); p_struct->pversion=NULL;
    p_struct->pversion=NULL;
  }
  if (p_src->pversion) {
    p_struct->pversion=strdup(p_src->pversion);
  }


  /* member "hversion" */
  if (p_struct->hversion) {
    free(p_struct->hversion); p_struct->hversion=NULL;
    p_struct->hversion=NULL;
  }
  if (p_src->hversion) {
    p_struct->hversion=strdup(p_src->hversion);
  }


  /* member "mode" */
  if (p_struct->mode) {
    free(p_struct->mode); p_struct->mode=NULL;
    p_struct->mode=NULL;
  }
  if (p_src->mode) {
    p_struct->mode=strdup(p_src->mode);
  }


  /* member "aux1" */
  if (p_struct->aux1) {
    free(p_struct->aux1); p_struct->aux1=NULL;
    p_struct->aux1=NULL;
  }
  if (p_src->aux1) {
    p_struct->aux1=strdup(p_src->aux1);
  }


  /* member "aux2" */
  if (p_struct->aux2) {
    free(p_struct->aux2); p_struct->aux2=NULL;
    p_struct->aux2=NULL;
  }
  if (p_src->aux2) {
    p_struct->aux2=strdup(p_src->aux2);
  }


  /* member "aux3" */
  if (p_struct->aux3) {
    free(p_struct->aux3); p_struct->aux3=NULL;
    p_struct->aux3=NULL;
  }
  if (p_src->aux3) {
    p_struct->aux3=strdup(p_src->aux3);
  }


  /* member "aux4" */
  if (p_struct->aux4) {
    free(p_struct->aux4); p_struct->aux4=NULL;
    p_struct->aux4=NULL;
  }
  if (p_src->aux4) {
    p_struct->aux4=strdup(p_src->aux4);
  }


  /* member "userFlags" */
    p_struct->userFlags=p_src->userFlags;


  return p_struct;
}

AB_BANKINFO_SERVICE *AB_BankInfoService_copy(AB_BANKINFO_SERVICE *p_struct, const AB_BANKINFO_SERVICE *p_src) {
  assert(p_struct);
  assert(p_src);
  /* member "type" */
  if (p_struct->type) {
    free(p_struct->type); p_struct->type=NULL;
    p_struct->type=NULL;
  }
  if (p_src->type) {
    p_struct->type=strdup(p_src->type);
  }


  /* member "address" */
  if (p_struct->address) {
    free(p_struct->address); p_struct->address=NULL;
    p_struct->address=NULL;
  }
  if (p_src->address) {
    p_struct->address=strdup(p_src->address);
  }


  /* member "suffix" */
  if (p_struct->suffix) {
    free(p_struct->suffix); p_struct->suffix=NULL;
    p_struct->suffix=NULL;
  }
  if (p_src->suffix) {
    p_struct->suffix=strdup(p_src->suffix);
  }


  /* member "pversion" */
  if (p_struct->pversion) {
    free(p_struct->pversion); p_struct->pversion=NULL;
    p_struct->pversion=NULL;
  }
  if (p_src->pversion) {
    p_struct->pversion=strdup(p_src->pversion);
  }


  /* member "hversion" */
  if (p_struct->hversion) {
    free(p_struct->hversion); p_struct->hversion=NULL;
    p_struct->hversion=NULL;
  }
  if (p_src->hversion) {
    p_struct->hversion=strdup(p_src->hversion);
  }


  /* member "mode" */
  if (p_struct->mode) {
    free(p_struct->mode); p_struct->mode=NULL;
    p_struct->mode=NULL;
  }
  if (p_src->mode) {
    p_struct->mode=strdup(p_src->mode);
  }


  /* member "aux1" */
  if (p_struct->aux1) {
    free(p_struct->aux1); p_struct->aux1=NULL;
    p_struct->aux1=NULL;
  }
  if (p_src->aux1) {
    p_struct->aux1=strdup(p_src->aux1);
  }


  /* member "aux2" */
  if (p_struct->aux2) {
    free(p_struct->aux2); p_struct->aux2=NULL;
    p_struct->aux2=NULL;
  }
  if (p_src->aux2) {
    p_struct->aux2=strdup(p_src->aux2);
  }


  /* member "aux3" */
  if (p_struct->aux3) {
    free(p_struct->aux3); p_struct->aux3=NULL;
    p_struct->aux3=NULL;
  }
  if (p_src->aux3) {
    p_struct->aux3=strdup(p_src->aux3);
  }


  /* member "aux4" */
  if (p_struct->aux4) {
    free(p_struct->aux4); p_struct->aux4=NULL;
    p_struct->aux4=NULL;
  }
  if (p_src->aux4) {
    p_struct->aux4=strdup(p_src->aux4);
  }


  /* member "userFlags" */
    p_struct->userFlags=p_src->userFlags;


  return p_struct;
}

const char *AB_BankInfoService_GetType(const AB_BANKINFO_SERVICE *p_struct){
  assert(p_struct);
  return p_struct->type;
}

const char *AB_BankInfoService_GetAddress(const AB_BANKINFO_SERVICE *p_struct){
  assert(p_struct);
  return p_struct->address;
}

const char *AB_BankInfoService_GetSuffix(const AB_BANKINFO_SERVICE *p_struct){
  assert(p_struct);
  return p_struct->suffix;
}

const char *AB_BankInfoService_GetPversion(const AB_BANKINFO_SERVICE *p_struct){
  assert(p_struct);
  return p_struct->pversion;
}

const char *AB_BankInfoService_GetHversion(const AB_BANKINFO_SERVICE *p_struct){
  assert(p_struct);
  return p_struct->hversion;
}

const char *AB_BankInfoService_GetMode(const AB_BANKINFO_SERVICE *p_struct){
  assert(p_struct);
  return p_struct->mode;
}

const char *AB_BankInfoService_GetAux1(const AB_BANKINFO_SERVICE *p_struct){
  assert(p_struct);
  return p_struct->aux1;
}

const char *AB_BankInfoService_GetAux2(const AB_BANKINFO_SERVICE *p_struct){
  assert(p_struct);
  return p_struct->aux2;
}

const char *AB_BankInfoService_GetAux3(const AB_BANKINFO_SERVICE *p_struct){
  assert(p_struct);
  return p_struct->aux3;
}

const char *AB_BankInfoService_GetAux4(const AB_BANKINFO_SERVICE *p_struct){
  assert(p_struct);
  return p_struct->aux4;
}

uint32_t AB_BankInfoService_GetUserFlags(const AB_BANKINFO_SERVICE *p_struct){
  assert(p_struct);
  return p_struct->userFlags;
}

void AB_BankInfoService_SetType(AB_BANKINFO_SERVICE *p_struct, const char *p_src){
  assert(p_struct);
  if (p_struct->type) {
    free(p_struct->type); p_struct->type=NULL;
    p_struct->type=NULL;
  }
  if (p_src) {
    p_struct->type=strdup(p_src);
  }
  else {
    p_struct->type=NULL;
  }

}

void AB_BankInfoService_SetAddress(AB_BANKINFO_SERVICE *p_struct, const char *p_src){
  assert(p_struct);
  if (p_struct->address) {
    free(p_struct->address); p_struct->address=NULL;
    p_struct->address=NULL;
  }
  if (p_src) {
    p_struct->address=strdup(p_src);
  }
  else {
    p_struct->address=NULL;
  }

}

void AB_BankInfoService_SetSuffix(AB_BANKINFO_SERVICE *p_struct, const char *p_src){
  assert(p_struct);
  if (p_struct->suffix) {
    free(p_struct->suffix); p_struct->suffix=NULL;
    p_struct->suffix=NULL;
  }
  if (p_src) {
    p_struct->suffix=strdup(p_src);
  }
  else {
    p_struct->suffix=NULL;
  }

}

void AB_BankInfoService_SetPversion(AB_BANKINFO_SERVICE *p_struct, const char *p_src){
  assert(p_struct);
  if (p_struct->pversion) {
    free(p_struct->pversion); p_struct->pversion=NULL;
    p_struct->pversion=NULL;
  }
  if (p_src) {
    p_struct->pversion=strdup(p_src);
  }
  else {
    p_struct->pversion=NULL;
  }

}

void AB_BankInfoService_SetHversion(AB_BANKINFO_SERVICE *p_struct, const char *p_src){
  assert(p_struct);
  if (p_struct->hversion) {
    free(p_struct->hversion); p_struct->hversion=NULL;
    p_struct->hversion=NULL;
  }
  if (p_src) {
    p_struct->hversion=strdup(p_src);
  }
  else {
    p_struct->hversion=NULL;
  }

}

void AB_BankInfoService_SetMode(AB_BANKINFO_SERVICE *p_struct, const char *p_src){
  assert(p_struct);
  if (p_struct->mode) {
    free(p_struct->mode); p_struct->mode=NULL;
    p_struct->mode=NULL;
  }
  if (p_src) {
    p_struct->mode=strdup(p_src);
  }
  else {
    p_struct->mode=NULL;
  }

}

void AB_BankInfoService_SetAux1(AB_BANKINFO_SERVICE *p_struct, const char *p_src){
  assert(p_struct);
  if (p_struct->aux1) {
    free(p_struct->aux1); p_struct->aux1=NULL;
    p_struct->aux1=NULL;
  }
  if (p_src) {
    p_struct->aux1=strdup(p_src);
  }
  else {
    p_struct->aux1=NULL;
  }

}

void AB_BankInfoService_SetAux2(AB_BANKINFO_SERVICE *p_struct, const char *p_src){
  assert(p_struct);
  if (p_struct->aux2) {
    free(p_struct->aux2); p_struct->aux2=NULL;
    p_struct->aux2=NULL;
  }
  if (p_src) {
    p_struct->aux2=strdup(p_src);
  }
  else {
    p_struct->aux2=NULL;
  }

}

void AB_BankInfoService_SetAux3(AB_BANKINFO_SERVICE *p_struct, const char *p_src){
  assert(p_struct);
  if (p_struct->aux3) {
    free(p_struct->aux3); p_struct->aux3=NULL;
    p_struct->aux3=NULL;
  }
  if (p_src) {
    p_struct->aux3=strdup(p_src);
  }
  else {
    p_struct->aux3=NULL;
  }

}

void AB_BankInfoService_SetAux4(AB_BANKINFO_SERVICE *p_struct, const char *p_src){
  assert(p_struct);
  if (p_struct->aux4) {
    free(p_struct->aux4); p_struct->aux4=NULL;
    p_struct->aux4=NULL;
  }
  if (p_src) {
    p_struct->aux4=strdup(p_src);
  }
  else {
    p_struct->aux4=NULL;
  }

}

void AB_BankInfoService_SetUserFlags(AB_BANKINFO_SERVICE *p_struct, uint32_t p_src){
  assert(p_struct);
  p_struct->userFlags=p_src;
}

void AB_BankInfoService_AddUserFlags(AB_BANKINFO_SERVICE *p_struct, uint32_t p_src) {
  assert(p_struct);
  p_struct->userFlags|=p_src;
}


void AB_BankInfoService_SubUserFlags(AB_BANKINFO_SERVICE *p_struct, uint32_t p_src) {
  assert(p_struct);
  p_struct->userFlags&=~p_src;
}



AB_BANKINFO_SERVICE_LIST *AB_BankInfoService_List_dup(const AB_BANKINFO_SERVICE_LIST *p_src) {
  AB_BANKINFO_SERVICE_LIST *p_dest;
  AB_BANKINFO_SERVICE *p_elem;

  assert(p_src);
  p_dest=AB_BankInfoService_List_new();
  p_elem=AB_BankInfoService_List_First(p_src);
  while(p_elem) {
    AB_BANKINFO_SERVICE *p_cpy;

    p_cpy=AB_BankInfoService_dup(p_elem);
    AB_BankInfoService_List_Add(p_cpy, p_dest);
    p_elem=AB_BankInfoService_List_Next(p_elem);
  }

  return p_dest;
}

void AB_BankInfoService_ReadDb(AB_BANKINFO_SERVICE *p_struct, GWEN_DB_NODE *p_db){
  assert(p_struct);
  /* member "type" */
  if (p_struct->type) {
    free(p_struct->type); p_struct->type=NULL;
    p_struct->type=NULL;
  }
  { const char *s; s=GWEN_DB_GetCharValue(p_db, "type", 0, NULL); if (s) p_struct->type=strdup(s); }
  /* member "address" */
  if (p_struct->address) {
    free(p_struct->address); p_struct->address=NULL;
    p_struct->address=NULL;
  }
  { const char *s; s=GWEN_DB_GetCharValue(p_db, "address", 0, NULL); if (s) p_struct->address=strdup(s); }
  /* member "suffix" */
  if (p_struct->suffix) {
    free(p_struct->suffix); p_struct->suffix=NULL;
    p_struct->suffix=NULL;
  }
  { const char *s; s=GWEN_DB_GetCharValue(p_db, "suffix", 0, NULL); if (s) p_struct->suffix=strdup(s); }
  /* member "pversion" */
  if (p_struct->pversion) {
    free(p_struct->pversion); p_struct->pversion=NULL;
    p_struct->pversion=NULL;
  }
  { const char *s; s=GWEN_DB_GetCharValue(p_db, "pversion", 0, NULL); if (s) p_struct->pversion=strdup(s); }
  /* member "hversion" */
  if (p_struct->hversion) {
    free(p_struct->hversion); p_struct->hversion=NULL;
    p_struct->hversion=NULL;
  }
  { const char *s; s=GWEN_DB_GetCharValue(p_db, "hversion", 0, NULL); if (s) p_struct->hversion=strdup(s); }
  /* member "mode" */
  if (p_struct->mode) {
    free(p_struct->mode); p_struct->mode=NULL;
    p_struct->mode=NULL;
  }
  { const char *s; s=GWEN_DB_GetCharValue(p_db, "mode", 0, NULL); if (s) p_struct->mode=strdup(s); }
  /* member "aux1" */
  if (p_struct->aux1) {
    free(p_struct->aux1); p_struct->aux1=NULL;
    p_struct->aux1=NULL;
  }
  { const char *s; s=GWEN_DB_GetCharValue(p_db, "aux1", 0, NULL); if (s) p_struct->aux1=strdup(s); }
  /* member "aux2" */
  if (p_struct->aux2) {
    free(p_struct->aux2); p_struct->aux2=NULL;
    p_struct->aux2=NULL;
  }
  { const char *s; s=GWEN_DB_GetCharValue(p_db, "aux2", 0, NULL); if (s) p_struct->aux2=strdup(s); }
  /* member "aux3" */
  if (p_struct->aux3) {
    free(p_struct->aux3); p_struct->aux3=NULL;
    p_struct->aux3=NULL;
  }
  { const char *s; s=GWEN_DB_GetCharValue(p_db, "aux3", 0, NULL); if (s) p_struct->aux3=strdup(s); }
  /* member "aux4" */
  if (p_struct->aux4) {
    free(p_struct->aux4); p_struct->aux4=NULL;
    p_struct->aux4=NULL;
  }
  { const char *s; s=GWEN_DB_GetCharValue(p_db, "aux4", 0, NULL); if (s) p_struct->aux4=strdup(s); }
  /* member "userFlags" */
  p_struct->userFlags=GWEN_DB_GetIntValue(p_db, "userFlags", 0, 0);
}

int AB_BankInfoService_WriteDb(const AB_BANKINFO_SERVICE *p_struct, GWEN_DB_NODE *p_db) {
  int p_rv;

  assert(p_struct);
  /* member "type" */
  if (p_struct->type) p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "type", p_struct->type); else { GWEN_DB_DeleteVar(p_db, "type"); p_rv=0; }
  if (p_rv<0) {
    DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
    return p_rv;
  }


  /* member "address" */
  if (p_struct->address) p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "address", p_struct->address); else { GWEN_DB_DeleteVar(p_db, "address"); p_rv=0; }
  if (p_rv<0) {
    DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
    return p_rv;
  }


  /* member "suffix" */
  if (p_struct->suffix) p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "suffix", p_struct->suffix); else { GWEN_DB_DeleteVar(p_db, "suffix"); p_rv=0; }
  if (p_rv<0) {
    DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
    return p_rv;
  }


  /* member "pversion" */
  if (p_struct->pversion) p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "pversion", p_struct->pversion); else { GWEN_DB_DeleteVar(p_db, "pversion"); p_rv=0; }
  if (p_rv<0) {
    DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
    return p_rv;
  }


  /* member "hversion" */
  if (p_struct->hversion) p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "hversion", p_struct->hversion); else { GWEN_DB_DeleteVar(p_db, "hversion"); p_rv=0; }
  if (p_rv<0) {
    DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
    return p_rv;
  }


  /* member "mode" */
  if (p_struct->mode) p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "mode", p_struct->mode); else { GWEN_DB_DeleteVar(p_db, "mode"); p_rv=0; }
  if (p_rv<0) {
    DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
    return p_rv;
  }


  /* member "aux1" */
  if (p_struct->aux1) p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "aux1", p_struct->aux1); else { GWEN_DB_DeleteVar(p_db, "aux1"); p_rv=0; }
  if (p_rv<0) {
    DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
    return p_rv;
  }


  /* member "aux2" */
  if (p_struct->aux2) p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "aux2", p_struct->aux2); else { GWEN_DB_DeleteVar(p_db, "aux2"); p_rv=0; }
  if (p_rv<0) {
    DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
    return p_rv;
  }


  /* member "aux3" */
  if (p_struct->aux3) p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "aux3", p_struct->aux3); else { GWEN_DB_DeleteVar(p_db, "aux3"); p_rv=0; }
  if (p_rv<0) {
    DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
    return p_rv;
  }


  /* member "aux4" */
  if (p_struct->aux4) p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "aux4", p_struct->aux4); else { GWEN_DB_DeleteVar(p_db, "aux4"); p_rv=0; }
  if (p_rv<0) {
    DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
    return p_rv;
  }


  /* member "userFlags" */
  p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "userFlags", p_struct->userFlags);
  if (p_rv<0) {
    DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
    return p_rv;
  }


  return 0;
}

AB_BANKINFO_SERVICE *AB_BankInfoService_fromDb(GWEN_DB_NODE *p_db) {
  AB_BANKINFO_SERVICE *p_struct;
  p_struct=AB_BankInfoService_new();
  AB_BankInfoService_ReadDb(p_struct, p_db);
  return p_struct;
}

int AB_BankInfoService_toDb(const AB_BANKINFO_SERVICE *p_struct, GWEN_DB_NODE *p_db) {
  return AB_BankInfoService_WriteDb(p_struct, p_db);
}

void AB_BankInfoService_ReadXml(AB_BANKINFO_SERVICE *p_struct, GWEN_XMLNODE *p_db){
  assert(p_struct);
  /* member "type" */
  if (p_struct->type) {
    free(p_struct->type); p_struct->type=NULL;
    p_struct->type=NULL;
  }
  { const char *s; s=GWEN_XMLNode_GetCharValue(p_db, "type", NULL); if (s) p_struct->type=strdup(s); }
  /* member "address" */
  if (p_struct->address) {
    free(p_struct->address); p_struct->address=NULL;
    p_struct->address=NULL;
  }
  { const char *s; s=GWEN_XMLNode_GetCharValue(p_db, "address", NULL); if (s) p_struct->address=strdup(s); }
  /* member "suffix" */
  if (p_struct->suffix) {
    free(p_struct->suffix); p_struct->suffix=NULL;
    p_struct->suffix=NULL;
  }
  { const char *s; s=GWEN_XMLNode_GetCharValue(p_db, "suffix", NULL); if (s) p_struct->suffix=strdup(s); }
  /* member "pversion" */
  if (p_struct->pversion) {
    free(p_struct->pversion); p_struct->pversion=NULL;
    p_struct->pversion=NULL;
  }
  { const char *s; s=GWEN_XMLNode_GetCharValue(p_db, "pversion", NULL); if (s) p_struct->pversion=strdup(s); }
  /* member "hversion" */
  if (p_struct->hversion) {
    free(p_struct->hversion); p_struct->hversion=NULL;
    p_struct->hversion=NULL;
  }
  { const char *s; s=GWEN_XMLNode_GetCharValue(p_db, "hversion", NULL); if (s) p_struct->hversion=strdup(s); }
  /* member "mode" */
  if (p_struct->mode) {
    free(p_struct->mode); p_struct->mode=NULL;
    p_struct->mode=NULL;
  }
  { const char *s; s=GWEN_XMLNode_GetCharValue(p_db, "mode", NULL); if (s) p_struct->mode=strdup(s); }
  /* member "aux1" */
  if (p_struct->aux1) {
    free(p_struct->aux1); p_struct->aux1=NULL;
    p_struct->aux1=NULL;
  }
  { const char *s; s=GWEN_XMLNode_GetCharValue(p_db, "aux1", NULL); if (s) p_struct->aux1=strdup(s); }
  /* member "aux2" */
  if (p_struct->aux2) {
    free(p_struct->aux2); p_struct->aux2=NULL;
    p_struct->aux2=NULL;
  }
  { const char *s; s=GWEN_XMLNode_GetCharValue(p_db, "aux2", NULL); if (s) p_struct->aux2=strdup(s); }
  /* member "aux3" */
  if (p_struct->aux3) {
    free(p_struct->aux3); p_struct->aux3=NULL;
    p_struct->aux3=NULL;
  }
  { const char *s; s=GWEN_XMLNode_GetCharValue(p_db, "aux3", NULL); if (s) p_struct->aux3=strdup(s); }
  /* member "aux4" */
  if (p_struct->aux4) {
    free(p_struct->aux4); p_struct->aux4=NULL;
    p_struct->aux4=NULL;
  }
  { const char *s; s=GWEN_XMLNode_GetCharValue(p_db, "aux4", NULL); if (s) p_struct->aux4=strdup(s); }
  /* member "userFlags" */
  p_struct->userFlags=GWEN_XMLNode_GetIntValue(p_db, "userFlags", 0);
}

void AB_BankInfoService_WriteXml(const AB_BANKINFO_SERVICE *p_struct, GWEN_XMLNODE *p_db) {
  assert(p_struct);
  /* member "type" */
  GWEN_XMLNode_SetCharValue(p_db, "type", p_struct->type);


  /* member "address" */
  GWEN_XMLNode_SetCharValue(p_db, "address", p_struct->address);


  /* member "suffix" */
  GWEN_XMLNode_SetCharValue(p_db, "suffix", p_struct->suffix);


  /* member "pversion" */
  GWEN_XMLNode_SetCharValue(p_db, "pversion", p_struct->pversion);


  /* member "hversion" */
  GWEN_XMLNode_SetCharValue(p_db, "hversion", p_struct->hversion);


  /* member "mode" */
  GWEN_XMLNode_SetCharValue(p_db, "mode", p_struct->mode);


  /* member "aux1" */
  GWEN_XMLNode_SetCharValue(p_db, "aux1", p_struct->aux1);


  /* member "aux2" */
  GWEN_XMLNode_SetCharValue(p_db, "aux2", p_struct->aux2);


  /* member "aux3" */
  GWEN_XMLNode_SetCharValue(p_db, "aux3", p_struct->aux3);


  /* member "aux4" */
  GWEN_XMLNode_SetCharValue(p_db, "aux4", p_struct->aux4);


  /* member "userFlags" */
  GWEN_XMLNode_SetIntValue(p_db, "userFlags", p_struct->userFlags);


}

void AB_BankInfoService_toXml(const AB_BANKINFO_SERVICE *p_struct, GWEN_XMLNODE *p_db) {
  AB_BankInfoService_WriteXml(p_struct, p_db);
}

AB_BANKINFO_SERVICE *AB_BankInfoService_fromXml(GWEN_XMLNODE *p_db) {
  AB_BANKINFO_SERVICE *p_struct;
  p_struct=AB_BankInfoService_new();
  AB_BankInfoService_ReadXml(p_struct, p_db);
  return p_struct;
}


/* code headers */

