/* This file is auto-generated from "transactionlimits.xml" by the typemaker
   tool of Gwenhywfar. 
   Do not edit this file -- all changes will be lost! */
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif

#include "transactionlimits_p.h"
#include <gwenhywfar/misc.h>
#include <gwenhywfar/db.h>
#include <gwenhywfar/debug.h>
#include <assert.h>
#include <stdlib.h>
#include <strings.h>

#include <gwenhywfar/types.h>
#include <gwenhywfar/stringlist.h>
#include <aqbanking/error.h>
#include <aqbanking/textkeydescr.h>


GWEN_LIST_FUNCTIONS(AB_TRANSACTION_LIMITS, AB_TransactionLimits)
GWEN_LIST2_FUNCTIONS(AB_TRANSACTION_LIMITS, AB_TransactionLimits)




AB_TRANSACTION_LIMITS *AB_TransactionLimits_new(void) {
  AB_TRANSACTION_LIMITS *st;

  GWEN_NEW_OBJECT(AB_TRANSACTION_LIMITS, st)
  st->_usage=1;
  GWEN_LIST_INIT(AB_TRANSACTION_LIMITS, st)
  st->valuesTextKey=GWEN_StringList_new();
  st->textKeys=AB_TextKeyDescr_List_new();
  st->valuesCycleWeek=GWEN_StringList_new();
  st->valuesCycleMonth=GWEN_StringList_new();
  st->valuesExecutionDayWeek=GWEN_StringList_new();
  st->valuesExecutionDayMonth=GWEN_StringList_new();
  return st;
}


void AB_TransactionLimits_free(AB_TRANSACTION_LIMITS *st) {
  if (st) {
    assert(st->_usage);
    if (--(st->_usage)==0) {
  if (st->valuesTextKey)
    GWEN_StringList_free(st->valuesTextKey);
  if (st->textKeys)
    AB_TextKeyDescr_List_free(st->textKeys);
  if (st->valuesCycleWeek)
    GWEN_StringList_free(st->valuesCycleWeek);
  if (st->valuesCycleMonth)
    GWEN_StringList_free(st->valuesCycleMonth);
  if (st->valuesExecutionDayWeek)
    GWEN_StringList_free(st->valuesExecutionDayWeek);
  if (st->valuesExecutionDayMonth)
    GWEN_StringList_free(st->valuesExecutionDayMonth);
  GWEN_LIST_FINI(AB_TRANSACTION_LIMITS, st)
  GWEN_FREE_OBJECT(st);
    }
  }

}


AB_TRANSACTION_LIMITS *AB_TransactionLimits_dup(const AB_TRANSACTION_LIMITS *d) {
  AB_TRANSACTION_LIMITS *st;

  assert(d);
  st=AB_TransactionLimits_new();
  st->maxLenLocalName=d->maxLenLocalName;
  st->minLenLocalName=d->minLenLocalName;
  st->maxLenRemoteName=d->maxLenRemoteName;
  st->minLenRemoteName=d->minLenRemoteName;
  st->maxLinesRemoteName=d->maxLinesRemoteName;
  st->minLinesRemoteName=d->minLinesRemoteName;
  st->maxLenLocalBankCode=d->maxLenLocalBankCode;
  st->minLenLocalBankCode=d->minLenLocalBankCode;
  st->maxLenLocalAccountNumber=d->maxLenLocalAccountNumber;
  st->minLenLocalAccountNumber=d->minLenLocalAccountNumber;
  st->maxLenLocalSuffix=d->maxLenLocalSuffix;
  st->minLenLocalSuffix=d->minLenLocalSuffix;
  st->maxLenRemoteBankCode=d->maxLenRemoteBankCode;
  st->minLenRemoteBankCode=d->minLenRemoteBankCode;
  st->maxLenRemoteAccountNumber=d->maxLenRemoteAccountNumber;
  st->minLenRemoteAccountNumber=d->minLenRemoteAccountNumber;
  st->maxLenRemoteSuffix=d->maxLenRemoteSuffix;
  st->minLenRemoteSuffix=d->minLenRemoteSuffix;
  st->maxLenRemoteIban=d->maxLenRemoteIban;
  st->minLenRemoteIban=d->minLenRemoteIban;
  st->maxLenTextKey=d->maxLenTextKey;
  st->minLenTextKey=d->minLenTextKey;
  if (d->valuesTextKey) {
    GWEN_StringList_free(st->valuesTextKey);
    st->valuesTextKey=GWEN_StringList_dup(d->valuesTextKey);
  }
  if (d->textKeys) {
    AB_TextKeyDescr_List_free(st->textKeys);
    st->textKeys=AB_TextKeyDescr_List_dup(d->textKeys);
  }
  st->maxLenCustomerReference=d->maxLenCustomerReference;
  st->minLenCustomerReference=d->minLenCustomerReference;
  st->maxLenBankReference=d->maxLenBankReference;
  st->minLenBankReference=d->minLenBankReference;
  st->maxLenPurpose=d->maxLenPurpose;
  st->minLenPurpose=d->minLenPurpose;
  st->maxLinesPurpose=d->maxLinesPurpose;
  st->minLinesPurpose=d->minLinesPurpose;
  st->needDate=d->needDate;
  st->minValueSetupTime=d->minValueSetupTime;
  st->maxValueSetupTime=d->maxValueSetupTime;
  st->minValueSetupTimeFirst=d->minValueSetupTimeFirst;
  st->maxValueSetupTimeFirst=d->maxValueSetupTimeFirst;
  st->minValueSetupTimeOnce=d->minValueSetupTimeOnce;
  st->maxValueSetupTimeOnce=d->maxValueSetupTimeOnce;
  st->minValueSetupTimeRecurring=d->minValueSetupTimeRecurring;
  st->maxValueSetupTimeRecurring=d->maxValueSetupTimeRecurring;
  st->minValueSetupTimeFinal=d->minValueSetupTimeFinal;
  st->maxValueSetupTimeFinal=d->maxValueSetupTimeFinal;
  if (d->valuesCycleWeek) {
    GWEN_StringList_free(st->valuesCycleWeek);
    st->valuesCycleWeek=GWEN_StringList_dup(d->valuesCycleWeek);
  }
  if (d->valuesCycleMonth) {
    GWEN_StringList_free(st->valuesCycleMonth);
    st->valuesCycleMonth=GWEN_StringList_dup(d->valuesCycleMonth);
  }
  if (d->valuesExecutionDayWeek) {
    GWEN_StringList_free(st->valuesExecutionDayWeek);
    st->valuesExecutionDayWeek=GWEN_StringList_dup(d->valuesExecutionDayWeek);
  }
  if (d->valuesExecutionDayMonth) {
    GWEN_StringList_free(st->valuesExecutionDayMonth);
    st->valuesExecutionDayMonth=GWEN_StringList_dup(d->valuesExecutionDayMonth);
  }
  st->allowMonthly=d->allowMonthly;
  st->allowWeekly=d->allowWeekly;
  st->allowChangeRecipientAccount=d->allowChangeRecipientAccount;
  st->allowChangeRecipientName=d->allowChangeRecipientName;
  st->allowChangeValue=d->allowChangeValue;
  st->allowChangeTextKey=d->allowChangeTextKey;
  st->allowChangePurpose=d->allowChangePurpose;
  st->allowChangeFirstExecutionDate=d->allowChangeFirstExecutionDate;
  st->allowChangeLastExecutionDate=d->allowChangeLastExecutionDate;
  st->allowChangeCycle=d->allowChangeCycle;
  st->allowChangePeriod=d->allowChangePeriod;
  st->allowChangeExecutionDay=d->allowChangeExecutionDay;
  return st;
}


int AB_TransactionLimits_toDb(const AB_TRANSACTION_LIMITS *st, GWEN_DB_NODE *db) {
  assert(st);
  assert(db);
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "maxLenLocalName", st->maxLenLocalName))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "minLenLocalName", st->minLenLocalName))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "maxLenRemoteName", st->maxLenRemoteName))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "minLenRemoteName", st->minLenRemoteName))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "maxLinesRemoteName", st->maxLinesRemoteName))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "minLinesRemoteName", st->minLinesRemoteName))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "maxLenLocalBankCode", st->maxLenLocalBankCode))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "minLenLocalBankCode", st->minLenLocalBankCode))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "maxLenLocalAccountNumber", st->maxLenLocalAccountNumber))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "minLenLocalAccountNumber", st->minLenLocalAccountNumber))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "maxLenLocalSuffix", st->maxLenLocalSuffix))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "minLenLocalSuffix", st->minLenLocalSuffix))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "maxLenRemoteBankCode", st->maxLenRemoteBankCode))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "minLenRemoteBankCode", st->minLenRemoteBankCode))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "maxLenRemoteAccountNumber", st->maxLenRemoteAccountNumber))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "minLenRemoteAccountNumber", st->minLenRemoteAccountNumber))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "maxLenRemoteSuffix", st->maxLenRemoteSuffix))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "minLenRemoteSuffix", st->minLenRemoteSuffix))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "maxLenRemoteIban", st->maxLenRemoteIban))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "minLenRemoteIban", st->minLenRemoteIban))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "maxLenTextKey", st->maxLenTextKey))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "minLenTextKey", st->minLenTextKey))
    return -1;
  if (st->valuesTextKey)
    {
      GWEN_STRINGLISTENTRY *se;

      GWEN_DB_DeleteVar(db, "valuesTextKey");
      se=GWEN_StringList_FirstEntry(st->valuesTextKey);
      while(se) {
        const char *s;

        s=GWEN_StringListEntry_Data(se);
        assert(s);
        if (GWEN_DB_SetCharValue(db, GWEN_DB_FLAGS_DEFAULT, "valuesTextKey", s))
          return -1;
        se=GWEN_StringListEntry_Next(se);
      } /* while */
    }
  if (st->textKeys)
  if (1) {
    GWEN_DB_NODE *dbT;
    AB_TEXTKEY_DESCR *e;

    dbT=GWEN_DB_GetGroup(db, GWEN_PATH_FLAGS_CREATE_GROUP, "textKeys");
    assert(dbT);
    e=AB_TextKeyDescr_List_First(st->textKeys);
    while(e) {
      if (AB_TextKeyDescr_toDb(e, GWEN_DB_GetGroup(dbT, GWEN_PATH_FLAGS_CREATE_GROUP, "element")))
        return -1;
      e=AB_TextKeyDescr_List_Next(e);
    } /* while */
  } /* if (1) */
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "maxLenCustomerReference", st->maxLenCustomerReference))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "minLenCustomerReference", st->minLenCustomerReference))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "maxLenBankReference", st->maxLenBankReference))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "minLenBankReference", st->minLenBankReference))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "maxLenPurpose", st->maxLenPurpose))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "minLenPurpose", st->minLenPurpose))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "maxLinesPurpose", st->maxLinesPurpose))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "minLinesPurpose", st->minLinesPurpose))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "needDate", st->needDate))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "minValueSetupTime", st->minValueSetupTime))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "maxValueSetupTime", st->maxValueSetupTime))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "minValueSetupTimeFirst", st->minValueSetupTimeFirst))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "maxValueSetupTimeFirst", st->maxValueSetupTimeFirst))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "minValueSetupTimeOnce", st->minValueSetupTimeOnce))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "maxValueSetupTimeOnce", st->maxValueSetupTimeOnce))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "minValueSetupTimeRecurring", st->minValueSetupTimeRecurring))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "maxValueSetupTimeRecurring", st->maxValueSetupTimeRecurring))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "minValueSetupTimeFinal", st->minValueSetupTimeFinal))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "maxValueSetupTimeFinal", st->maxValueSetupTimeFinal))
    return -1;
  if (st->valuesCycleWeek)
    {
      GWEN_STRINGLISTENTRY *se;

      GWEN_DB_DeleteVar(db, "valuesCycleWeek");
      se=GWEN_StringList_FirstEntry(st->valuesCycleWeek);
      while(se) {
        const char *s;

        s=GWEN_StringListEntry_Data(se);
        assert(s);
        if (GWEN_DB_SetCharValue(db, GWEN_DB_FLAGS_DEFAULT, "valuesCycleWeek", s))
          return -1;
        se=GWEN_StringListEntry_Next(se);
      } /* while */
    }
  if (st->valuesCycleMonth)
    {
      GWEN_STRINGLISTENTRY *se;

      GWEN_DB_DeleteVar(db, "valuesCycleMonth");
      se=GWEN_StringList_FirstEntry(st->valuesCycleMonth);
      while(se) {
        const char *s;

        s=GWEN_StringListEntry_Data(se);
        assert(s);
        if (GWEN_DB_SetCharValue(db, GWEN_DB_FLAGS_DEFAULT, "valuesCycleMonth", s))
          return -1;
        se=GWEN_StringListEntry_Next(se);
      } /* while */
    }
  if (st->valuesExecutionDayWeek)
    {
      GWEN_STRINGLISTENTRY *se;

      GWEN_DB_DeleteVar(db, "valuesExecutionDayWeek");
      se=GWEN_StringList_FirstEntry(st->valuesExecutionDayWeek);
      while(se) {
        const char *s;

        s=GWEN_StringListEntry_Data(se);
        assert(s);
        if (GWEN_DB_SetCharValue(db, GWEN_DB_FLAGS_DEFAULT, "valuesExecutionDayWeek", s))
          return -1;
        se=GWEN_StringListEntry_Next(se);
      } /* while */
    }
  if (st->valuesExecutionDayMonth)
    {
      GWEN_STRINGLISTENTRY *se;

      GWEN_DB_DeleteVar(db, "valuesExecutionDayMonth");
      se=GWEN_StringList_FirstEntry(st->valuesExecutionDayMonth);
      while(se) {
        const char *s;

        s=GWEN_StringListEntry_Data(se);
        assert(s);
        if (GWEN_DB_SetCharValue(db, GWEN_DB_FLAGS_DEFAULT, "valuesExecutionDayMonth", s))
          return -1;
        se=GWEN_StringListEntry_Next(se);
      } /* while */
    }
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "allowMonthly", st->allowMonthly))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "allowWeekly", st->allowWeekly))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "allowChangeRecipientAccount", st->allowChangeRecipientAccount))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "allowChangeRecipientName", st->allowChangeRecipientName))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "allowChangeValue", st->allowChangeValue))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "allowChangeTextKey", st->allowChangeTextKey))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "allowChangePurpose", st->allowChangePurpose))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "allowChangeFirstExecutionDate", st->allowChangeFirstExecutionDate))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "allowChangeLastExecutionDate", st->allowChangeLastExecutionDate))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "allowChangeCycle", st->allowChangeCycle))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "allowChangePeriod", st->allowChangePeriod))
    return -1;
  if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "allowChangeExecutionDay", st->allowChangeExecutionDay))
    return -1;
  return 0;
}


int AB_TransactionLimits_ReadDb(AB_TRANSACTION_LIMITS *st, GWEN_DB_NODE *db) {
  assert(st);
  assert(db);
  AB_TransactionLimits_SetMaxLenLocalName(st, GWEN_DB_GetIntValue(db, "maxLenLocalName", 0, 0));
  AB_TransactionLimits_SetMinLenLocalName(st, GWEN_DB_GetIntValue(db, "minLenLocalName", 0, 0));
  AB_TransactionLimits_SetMaxLenRemoteName(st, GWEN_DB_GetIntValue(db, "maxLenRemoteName", 0, 0));
  AB_TransactionLimits_SetMinLenRemoteName(st, GWEN_DB_GetIntValue(db, "minLenRemoteName", 0, 0));
  AB_TransactionLimits_SetMaxLinesRemoteName(st, GWEN_DB_GetIntValue(db, "maxLinesRemoteName", 0, 0));
  AB_TransactionLimits_SetMinLinesRemoteName(st, GWEN_DB_GetIntValue(db, "minLinesRemoteName", 0, 0));
  AB_TransactionLimits_SetMaxLenLocalBankCode(st, GWEN_DB_GetIntValue(db, "maxLenLocalBankCode", 0, 0));
  AB_TransactionLimits_SetMinLenLocalBankCode(st, GWEN_DB_GetIntValue(db, "minLenLocalBankCode", 0, 0));
  AB_TransactionLimits_SetMaxLenLocalAccountNumber(st, GWEN_DB_GetIntValue(db, "maxLenLocalAccountNumber", 0, 0));
  AB_TransactionLimits_SetMinLenLocalAccountNumber(st, GWEN_DB_GetIntValue(db, "minLenLocalAccountNumber", 0, 0));
  AB_TransactionLimits_SetMaxLenLocalSuffix(st, GWEN_DB_GetIntValue(db, "maxLenLocalSuffix", 0, 0));
  AB_TransactionLimits_SetMinLenLocalSuffix(st, GWEN_DB_GetIntValue(db, "minLenLocalSuffix", 0, 0));
  AB_TransactionLimits_SetMaxLenRemoteBankCode(st, GWEN_DB_GetIntValue(db, "maxLenRemoteBankCode", 0, 0));
  AB_TransactionLimits_SetMinLenRemoteBankCode(st, GWEN_DB_GetIntValue(db, "minLenRemoteBankCode", 0, 0));
  AB_TransactionLimits_SetMaxLenRemoteAccountNumber(st, GWEN_DB_GetIntValue(db, "maxLenRemoteAccountNumber", 0, 0));
  AB_TransactionLimits_SetMinLenRemoteAccountNumber(st, GWEN_DB_GetIntValue(db, "minLenRemoteAccountNumber", 0, 0));
  AB_TransactionLimits_SetMaxLenRemoteSuffix(st, GWEN_DB_GetIntValue(db, "maxLenRemoteSuffix", 0, 0));
  AB_TransactionLimits_SetMinLenRemoteSuffix(st, GWEN_DB_GetIntValue(db, "minLenRemoteSuffix", 0, 0));
  AB_TransactionLimits_SetMaxLenRemoteIban(st, GWEN_DB_GetIntValue(db, "maxLenRemoteIban", 0, 0));
  AB_TransactionLimits_SetMinLenRemoteIban(st, GWEN_DB_GetIntValue(db, "minLenRemoteIban", 0, 0));
  AB_TransactionLimits_SetMaxLenTextKey(st, GWEN_DB_GetIntValue(db, "maxLenTextKey", 0, 0));
  AB_TransactionLimits_SetMinLenTextKey(st, GWEN_DB_GetIntValue(db, "minLenTextKey", 0, 0));
  if (1) {
    int i;

    for (i=0; ; i++) {
      const char *s;

      s=GWEN_DB_GetCharValue(db, "valuesTextKey", i, 0);
      if (!s)
        break;
      AB_TransactionLimits_AddValuesTextKey(st, s, 0);
    } /* for */
  }
  st->textKeys=AB_TextKeyDescr_List_new();
  if (1) {/* just for local vars */
    GWEN_DB_NODE *dbT;
    AB_TEXTKEY_DESCR *e;

    dbT=GWEN_DB_GetGroup(db, GWEN_PATH_FLAGS_NAMEMUSTEXIST, "textKeys");
    if (dbT) {
      GWEN_DB_NODE *dbT2;

      dbT2=GWEN_DB_FindFirstGroup(dbT, "element");
      while(dbT2) {
        e=AB_TextKeyDescr_fromDb(dbT2);
        if (!e) {
          DBG_ERROR(0, "Bad element for type \"AB_TEXTKEY_DESCR\"");
          if (GWEN_Logger_GetLevel(0)>=GWEN_LoggerLevel_Debug)
            GWEN_DB_Dump(dbT2, 2);
          AB_TransactionLimits_free(st);
          return 0;
        }
        AB_TextKeyDescr_List_Add(e, st->textKeys);    dbT2=GWEN_DB_FindNextGroup(dbT2, "element");
      } /* while */
    } /* if (dbT) */
  } /* if (1) */
  AB_TransactionLimits_SetMaxLenCustomerReference(st, GWEN_DB_GetIntValue(db, "maxLenCustomerReference", 0, 0));
  AB_TransactionLimits_SetMinLenCustomerReference(st, GWEN_DB_GetIntValue(db, "minLenCustomerReference", 0, 0));
  AB_TransactionLimits_SetMaxLenBankReference(st, GWEN_DB_GetIntValue(db, "maxLenBankReference", 0, 0));
  AB_TransactionLimits_SetMinLenBankReference(st, GWEN_DB_GetIntValue(db, "minLenBankReference", 0, 0));
  AB_TransactionLimits_SetMaxLenPurpose(st, GWEN_DB_GetIntValue(db, "maxLenPurpose", 0, 0));
  AB_TransactionLimits_SetMinLenPurpose(st, GWEN_DB_GetIntValue(db, "minLenPurpose", 0, 0));
  AB_TransactionLimits_SetMaxLinesPurpose(st, GWEN_DB_GetIntValue(db, "maxLinesPurpose", 0, 0));
  AB_TransactionLimits_SetMinLinesPurpose(st, GWEN_DB_GetIntValue(db, "minLinesPurpose", 0, 0));
  AB_TransactionLimits_SetNeedDate(st, GWEN_DB_GetIntValue(db, "needDate", 0, 0));
  AB_TransactionLimits_SetMinValueSetupTime(st, GWEN_DB_GetIntValue(db, "minValueSetupTime", 0, 0));
  AB_TransactionLimits_SetMaxValueSetupTime(st, GWEN_DB_GetIntValue(db, "maxValueSetupTime", 0, 0));
  AB_TransactionLimits_SetMinValueSetupTimeFirst(st, GWEN_DB_GetIntValue(db, "minValueSetupTimeFirst", 0, 0));
  AB_TransactionLimits_SetMaxValueSetupTimeFirst(st, GWEN_DB_GetIntValue(db, "maxValueSetupTimeFirst", 0, 0));
  AB_TransactionLimits_SetMinValueSetupTimeOnce(st, GWEN_DB_GetIntValue(db, "minValueSetupTimeOnce", 0, 0));
  AB_TransactionLimits_SetMaxValueSetupTimeOnce(st, GWEN_DB_GetIntValue(db, "maxValueSetupTimeOnce", 0, 0));
  AB_TransactionLimits_SetMinValueSetupTimeRecurring(st, GWEN_DB_GetIntValue(db, "minValueSetupTimeRecurring", 0, 0));
  AB_TransactionLimits_SetMaxValueSetupTimeRecurring(st, GWEN_DB_GetIntValue(db, "maxValueSetupTimeRecurring", 0, 0));
  AB_TransactionLimits_SetMinValueSetupTimeFinal(st, GWEN_DB_GetIntValue(db, "minValueSetupTimeFinal", 0, 0));
  AB_TransactionLimits_SetMaxValueSetupTimeFinal(st, GWEN_DB_GetIntValue(db, "maxValueSetupTimeFinal", 0, 0));
  if (1) {
    int i;

    for (i=0; ; i++) {
      const char *s;

      s=GWEN_DB_GetCharValue(db, "valuesCycleWeek", i, 0);
      if (!s)
        break;
      AB_TransactionLimits_AddValuesCycleWeek(st, s, 0);
    } /* for */
  }
  if (1) {
    int i;

    for (i=0; ; i++) {
      const char *s;

      s=GWEN_DB_GetCharValue(db, "valuesCycleMonth", i, 0);
      if (!s)
        break;
      AB_TransactionLimits_AddValuesCycleMonth(st, s, 0);
    } /* for */
  }
  if (1) {
    int i;

    for (i=0; ; i++) {
      const char *s;

      s=GWEN_DB_GetCharValue(db, "valuesExecutionDayWeek", i, 0);
      if (!s)
        break;
      AB_TransactionLimits_AddValuesExecutionDayWeek(st, s, 0);
    } /* for */
  }
  if (1) {
    int i;

    for (i=0; ; i++) {
      const char *s;

      s=GWEN_DB_GetCharValue(db, "valuesExecutionDayMonth", i, 0);
      if (!s)
        break;
      AB_TransactionLimits_AddValuesExecutionDayMonth(st, s, 0);
    } /* for */
  }
  AB_TransactionLimits_SetAllowMonthly(st, GWEN_DB_GetIntValue(db, "allowMonthly", 0, 0));
  AB_TransactionLimits_SetAllowWeekly(st, GWEN_DB_GetIntValue(db, "allowWeekly", 0, 0));
  AB_TransactionLimits_SetAllowChangeRecipientAccount(st, GWEN_DB_GetIntValue(db, "allowChangeRecipientAccount", 0, 0));
  AB_TransactionLimits_SetAllowChangeRecipientName(st, GWEN_DB_GetIntValue(db, "allowChangeRecipientName", 0, 0));
  AB_TransactionLimits_SetAllowChangeValue(st, GWEN_DB_GetIntValue(db, "allowChangeValue", 0, 0));
  AB_TransactionLimits_SetAllowChangeTextKey(st, GWEN_DB_GetIntValue(db, "allowChangeTextKey", 0, 0));
  AB_TransactionLimits_SetAllowChangePurpose(st, GWEN_DB_GetIntValue(db, "allowChangePurpose", 0, 0));
  AB_TransactionLimits_SetAllowChangeFirstExecutionDate(st, GWEN_DB_GetIntValue(db, "allowChangeFirstExecutionDate", 0, 0));
  AB_TransactionLimits_SetAllowChangeLastExecutionDate(st, GWEN_DB_GetIntValue(db, "allowChangeLastExecutionDate", 0, 0));
  AB_TransactionLimits_SetAllowChangeCycle(st, GWEN_DB_GetIntValue(db, "allowChangeCycle", 0, 0));
  AB_TransactionLimits_SetAllowChangePeriod(st, GWEN_DB_GetIntValue(db, "allowChangePeriod", 0, 0));
  AB_TransactionLimits_SetAllowChangeExecutionDay(st, GWEN_DB_GetIntValue(db, "allowChangeExecutionDay", 0, 0));
  return 0;
}


AB_TRANSACTION_LIMITS *AB_TransactionLimits_fromDb(GWEN_DB_NODE *db) {
  AB_TRANSACTION_LIMITS *st;

  assert(db);
  st=AB_TransactionLimits_new();
  AB_TransactionLimits_ReadDb(st, db);
  st->_modified=0;
  return st;
}




int AB_TransactionLimits_GetMaxLenLocalName(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->maxLenLocalName;
}


void AB_TransactionLimits_SetMaxLenLocalName(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->maxLenLocalName=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetMinLenLocalName(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->minLenLocalName;
}


void AB_TransactionLimits_SetMinLenLocalName(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->minLenLocalName=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetMaxLenRemoteName(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->maxLenRemoteName;
}


void AB_TransactionLimits_SetMaxLenRemoteName(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->maxLenRemoteName=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetMinLenRemoteName(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->minLenRemoteName;
}


void AB_TransactionLimits_SetMinLenRemoteName(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->minLenRemoteName=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetMaxLinesRemoteName(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->maxLinesRemoteName;
}


void AB_TransactionLimits_SetMaxLinesRemoteName(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->maxLinesRemoteName=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetMinLinesRemoteName(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->minLinesRemoteName;
}


void AB_TransactionLimits_SetMinLinesRemoteName(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->minLinesRemoteName=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetMaxLenLocalBankCode(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->maxLenLocalBankCode;
}


void AB_TransactionLimits_SetMaxLenLocalBankCode(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->maxLenLocalBankCode=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetMinLenLocalBankCode(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->minLenLocalBankCode;
}


void AB_TransactionLimits_SetMinLenLocalBankCode(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->minLenLocalBankCode=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetMaxLenLocalAccountNumber(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->maxLenLocalAccountNumber;
}


void AB_TransactionLimits_SetMaxLenLocalAccountNumber(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->maxLenLocalAccountNumber=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetMinLenLocalAccountNumber(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->minLenLocalAccountNumber;
}


void AB_TransactionLimits_SetMinLenLocalAccountNumber(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->minLenLocalAccountNumber=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetMaxLenLocalSuffix(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->maxLenLocalSuffix;
}


void AB_TransactionLimits_SetMaxLenLocalSuffix(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->maxLenLocalSuffix=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetMinLenLocalSuffix(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->minLenLocalSuffix;
}


void AB_TransactionLimits_SetMinLenLocalSuffix(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->minLenLocalSuffix=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetMaxLenRemoteBankCode(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->maxLenRemoteBankCode;
}


void AB_TransactionLimits_SetMaxLenRemoteBankCode(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->maxLenRemoteBankCode=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetMinLenRemoteBankCode(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->minLenRemoteBankCode;
}


void AB_TransactionLimits_SetMinLenRemoteBankCode(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->minLenRemoteBankCode=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetMaxLenRemoteAccountNumber(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->maxLenRemoteAccountNumber;
}


void AB_TransactionLimits_SetMaxLenRemoteAccountNumber(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->maxLenRemoteAccountNumber=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetMinLenRemoteAccountNumber(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->minLenRemoteAccountNumber;
}


void AB_TransactionLimits_SetMinLenRemoteAccountNumber(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->minLenRemoteAccountNumber=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetMaxLenRemoteSuffix(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->maxLenRemoteSuffix;
}


void AB_TransactionLimits_SetMaxLenRemoteSuffix(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->maxLenRemoteSuffix=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetMinLenRemoteSuffix(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->minLenRemoteSuffix;
}


void AB_TransactionLimits_SetMinLenRemoteSuffix(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->minLenRemoteSuffix=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetMaxLenRemoteIban(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->maxLenRemoteIban;
}


void AB_TransactionLimits_SetMaxLenRemoteIban(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->maxLenRemoteIban=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetMinLenRemoteIban(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->minLenRemoteIban;
}


void AB_TransactionLimits_SetMinLenRemoteIban(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->minLenRemoteIban=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetMaxLenTextKey(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->maxLenTextKey;
}


void AB_TransactionLimits_SetMaxLenTextKey(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->maxLenTextKey=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetMinLenTextKey(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->minLenTextKey;
}


void AB_TransactionLimits_SetMinLenTextKey(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->minLenTextKey=d;
  st->_modified=1;
}




GWEN_STRINGLIST *AB_TransactionLimits_GetValuesTextKey(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->valuesTextKey;
}


void AB_TransactionLimits_SetValuesTextKey(AB_TRANSACTION_LIMITS *st, GWEN_STRINGLIST *d) {
  assert(st);
  if (st->valuesTextKey)
    GWEN_StringList_free(st->valuesTextKey);
  if (d)
    st->valuesTextKey=GWEN_StringList_dup(d);
  else
    st->valuesTextKey=0;
  st->_modified=1;
}




void AB_TransactionLimits_AddValuesTextKey(AB_TRANSACTION_LIMITS *st, const char *d, int chk){
  assert(st);
  assert(d);
  if (GWEN_StringList_AppendString(st->valuesTextKey, d, 0, chk))
    st->_modified=1;
}


void AB_TransactionLimits_RemoveValuesTextKey(AB_TRANSACTION_LIMITS *st, const char *d) {
  if (GWEN_StringList_RemoveString(st->valuesTextKey, d))
    st->_modified=1;
}


void AB_TransactionLimits_ClearValuesTextKey(AB_TRANSACTION_LIMITS *st) {
  if (GWEN_StringList_Count(st->valuesTextKey)) {
    GWEN_StringList_Clear(st->valuesTextKey);
    st->_modified=1;
  }
}


int AB_TransactionLimits_HasValuesTextKey(const AB_TRANSACTION_LIMITS *st, const char *d) {
  return GWEN_StringList_HasString(st->valuesTextKey, d);
}




AB_TEXTKEY_DESCR_LIST *AB_TransactionLimits_GetTextKeys(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->textKeys;
}


void AB_TransactionLimits_SetTextKeys(AB_TRANSACTION_LIMITS *st, AB_TEXTKEY_DESCR_LIST *d) {
  assert(st);
  if (st->textKeys)
    AB_TextKeyDescr_List_free(st->textKeys);
  if (d) {
    AB_TEXTKEY_DESCR *e;

  st->textKeys=AB_TextKeyDescr_List_new();
    e=AB_TextKeyDescr_List_First(d);
    while(e) {
      AB_TEXTKEY_DESCR *ne;

      ne=AB_TextKeyDescr_dup(e);
      assert(ne);
      AB_TextKeyDescr_List_Add(ne, st->textKeys);
      e=AB_TextKeyDescr_List_Next(e);
    } /* while (e) */
  } /* if LIST */
  else
    st->textKeys=0;
  st->_modified=1;
}




int AB_TransactionLimits_GetMaxLenCustomerReference(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->maxLenCustomerReference;
}


void AB_TransactionLimits_SetMaxLenCustomerReference(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->maxLenCustomerReference=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetMinLenCustomerReference(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->minLenCustomerReference;
}


void AB_TransactionLimits_SetMinLenCustomerReference(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->minLenCustomerReference=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetMaxLenBankReference(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->maxLenBankReference;
}


void AB_TransactionLimits_SetMaxLenBankReference(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->maxLenBankReference=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetMinLenBankReference(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->minLenBankReference;
}


void AB_TransactionLimits_SetMinLenBankReference(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->minLenBankReference=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetMaxLenPurpose(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->maxLenPurpose;
}


void AB_TransactionLimits_SetMaxLenPurpose(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->maxLenPurpose=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetMinLenPurpose(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->minLenPurpose;
}


void AB_TransactionLimits_SetMinLenPurpose(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->minLenPurpose=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetMaxLinesPurpose(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->maxLinesPurpose;
}


void AB_TransactionLimits_SetMaxLinesPurpose(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->maxLinesPurpose=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetMinLinesPurpose(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->minLinesPurpose;
}


void AB_TransactionLimits_SetMinLinesPurpose(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->minLinesPurpose=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetNeedDate(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->needDate;
}


void AB_TransactionLimits_SetNeedDate(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->needDate=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetMinValueSetupTime(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->minValueSetupTime;
}


void AB_TransactionLimits_SetMinValueSetupTime(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->minValueSetupTime=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetMaxValueSetupTime(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->maxValueSetupTime;
}


void AB_TransactionLimits_SetMaxValueSetupTime(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->maxValueSetupTime=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetMinValueSetupTimeFirst(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->minValueSetupTimeFirst;
}


void AB_TransactionLimits_SetMinValueSetupTimeFirst(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->minValueSetupTimeFirst=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetMaxValueSetupTimeFirst(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->maxValueSetupTimeFirst;
}


void AB_TransactionLimits_SetMaxValueSetupTimeFirst(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->maxValueSetupTimeFirst=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetMinValueSetupTimeOnce(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->minValueSetupTimeOnce;
}


void AB_TransactionLimits_SetMinValueSetupTimeOnce(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->minValueSetupTimeOnce=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetMaxValueSetupTimeOnce(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->maxValueSetupTimeOnce;
}


void AB_TransactionLimits_SetMaxValueSetupTimeOnce(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->maxValueSetupTimeOnce=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetMinValueSetupTimeRecurring(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->minValueSetupTimeRecurring;
}


void AB_TransactionLimits_SetMinValueSetupTimeRecurring(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->minValueSetupTimeRecurring=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetMaxValueSetupTimeRecurring(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->maxValueSetupTimeRecurring;
}


void AB_TransactionLimits_SetMaxValueSetupTimeRecurring(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->maxValueSetupTimeRecurring=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetMinValueSetupTimeFinal(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->minValueSetupTimeFinal;
}


void AB_TransactionLimits_SetMinValueSetupTimeFinal(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->minValueSetupTimeFinal=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetMaxValueSetupTimeFinal(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->maxValueSetupTimeFinal;
}


void AB_TransactionLimits_SetMaxValueSetupTimeFinal(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->maxValueSetupTimeFinal=d;
  st->_modified=1;
}




GWEN_STRINGLIST *AB_TransactionLimits_GetValuesCycleWeek(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->valuesCycleWeek;
}


void AB_TransactionLimits_SetValuesCycleWeek(AB_TRANSACTION_LIMITS *st, GWEN_STRINGLIST *d) {
  assert(st);
  if (st->valuesCycleWeek)
    GWEN_StringList_free(st->valuesCycleWeek);
  if (d)
    st->valuesCycleWeek=GWEN_StringList_dup(d);
  else
    st->valuesCycleWeek=0;
  st->_modified=1;
}




void AB_TransactionLimits_AddValuesCycleWeek(AB_TRANSACTION_LIMITS *st, const char *d, int chk){
  assert(st);
  assert(d);
  if (GWEN_StringList_AppendString(st->valuesCycleWeek, d, 0, chk))
    st->_modified=1;
}


void AB_TransactionLimits_RemoveValuesCycleWeek(AB_TRANSACTION_LIMITS *st, const char *d) {
  if (GWEN_StringList_RemoveString(st->valuesCycleWeek, d))
    st->_modified=1;
}


void AB_TransactionLimits_ClearValuesCycleWeek(AB_TRANSACTION_LIMITS *st) {
  if (GWEN_StringList_Count(st->valuesCycleWeek)) {
    GWEN_StringList_Clear(st->valuesCycleWeek);
    st->_modified=1;
  }
}


int AB_TransactionLimits_HasValuesCycleWeek(const AB_TRANSACTION_LIMITS *st, const char *d) {
  return GWEN_StringList_HasString(st->valuesCycleWeek, d);
}




GWEN_STRINGLIST *AB_TransactionLimits_GetValuesCycleMonth(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->valuesCycleMonth;
}


void AB_TransactionLimits_SetValuesCycleMonth(AB_TRANSACTION_LIMITS *st, GWEN_STRINGLIST *d) {
  assert(st);
  if (st->valuesCycleMonth)
    GWEN_StringList_free(st->valuesCycleMonth);
  if (d)
    st->valuesCycleMonth=GWEN_StringList_dup(d);
  else
    st->valuesCycleMonth=0;
  st->_modified=1;
}




void AB_TransactionLimits_AddValuesCycleMonth(AB_TRANSACTION_LIMITS *st, const char *d, int chk){
  assert(st);
  assert(d);
  if (GWEN_StringList_AppendString(st->valuesCycleMonth, d, 0, chk))
    st->_modified=1;
}


void AB_TransactionLimits_RemoveValuesCycleMonth(AB_TRANSACTION_LIMITS *st, const char *d) {
  if (GWEN_StringList_RemoveString(st->valuesCycleMonth, d))
    st->_modified=1;
}


void AB_TransactionLimits_ClearValuesCycleMonth(AB_TRANSACTION_LIMITS *st) {
  if (GWEN_StringList_Count(st->valuesCycleMonth)) {
    GWEN_StringList_Clear(st->valuesCycleMonth);
    st->_modified=1;
  }
}


int AB_TransactionLimits_HasValuesCycleMonth(const AB_TRANSACTION_LIMITS *st, const char *d) {
  return GWEN_StringList_HasString(st->valuesCycleMonth, d);
}




GWEN_STRINGLIST *AB_TransactionLimits_GetValuesExecutionDayWeek(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->valuesExecutionDayWeek;
}


void AB_TransactionLimits_SetValuesExecutionDayWeek(AB_TRANSACTION_LIMITS *st, GWEN_STRINGLIST *d) {
  assert(st);
  if (st->valuesExecutionDayWeek)
    GWEN_StringList_free(st->valuesExecutionDayWeek);
  if (d)
    st->valuesExecutionDayWeek=GWEN_StringList_dup(d);
  else
    st->valuesExecutionDayWeek=0;
  st->_modified=1;
}




void AB_TransactionLimits_AddValuesExecutionDayWeek(AB_TRANSACTION_LIMITS *st, const char *d, int chk){
  assert(st);
  assert(d);
  if (GWEN_StringList_AppendString(st->valuesExecutionDayWeek, d, 0, chk))
    st->_modified=1;
}


void AB_TransactionLimits_RemoveValuesExecutionDayWeek(AB_TRANSACTION_LIMITS *st, const char *d) {
  if (GWEN_StringList_RemoveString(st->valuesExecutionDayWeek, d))
    st->_modified=1;
}


void AB_TransactionLimits_ClearValuesExecutionDayWeek(AB_TRANSACTION_LIMITS *st) {
  if (GWEN_StringList_Count(st->valuesExecutionDayWeek)) {
    GWEN_StringList_Clear(st->valuesExecutionDayWeek);
    st->_modified=1;
  }
}


int AB_TransactionLimits_HasValuesExecutionDayWeek(const AB_TRANSACTION_LIMITS *st, const char *d) {
  return GWEN_StringList_HasString(st->valuesExecutionDayWeek, d);
}




GWEN_STRINGLIST *AB_TransactionLimits_GetValuesExecutionDayMonth(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->valuesExecutionDayMonth;
}


void AB_TransactionLimits_SetValuesExecutionDayMonth(AB_TRANSACTION_LIMITS *st, GWEN_STRINGLIST *d) {
  assert(st);
  if (st->valuesExecutionDayMonth)
    GWEN_StringList_free(st->valuesExecutionDayMonth);
  if (d)
    st->valuesExecutionDayMonth=GWEN_StringList_dup(d);
  else
    st->valuesExecutionDayMonth=0;
  st->_modified=1;
}




void AB_TransactionLimits_AddValuesExecutionDayMonth(AB_TRANSACTION_LIMITS *st, const char *d, int chk){
  assert(st);
  assert(d);
  if (GWEN_StringList_AppendString(st->valuesExecutionDayMonth, d, 0, chk))
    st->_modified=1;
}


void AB_TransactionLimits_RemoveValuesExecutionDayMonth(AB_TRANSACTION_LIMITS *st, const char *d) {
  if (GWEN_StringList_RemoveString(st->valuesExecutionDayMonth, d))
    st->_modified=1;
}


void AB_TransactionLimits_ClearValuesExecutionDayMonth(AB_TRANSACTION_LIMITS *st) {
  if (GWEN_StringList_Count(st->valuesExecutionDayMonth)) {
    GWEN_StringList_Clear(st->valuesExecutionDayMonth);
    st->_modified=1;
  }
}


int AB_TransactionLimits_HasValuesExecutionDayMonth(const AB_TRANSACTION_LIMITS *st, const char *d) {
  return GWEN_StringList_HasString(st->valuesExecutionDayMonth, d);
}




int AB_TransactionLimits_GetAllowMonthly(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->allowMonthly;
}


void AB_TransactionLimits_SetAllowMonthly(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->allowMonthly=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetAllowWeekly(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->allowWeekly;
}


void AB_TransactionLimits_SetAllowWeekly(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->allowWeekly=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetAllowChangeRecipientAccount(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->allowChangeRecipientAccount;
}


void AB_TransactionLimits_SetAllowChangeRecipientAccount(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->allowChangeRecipientAccount=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetAllowChangeRecipientName(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->allowChangeRecipientName;
}


void AB_TransactionLimits_SetAllowChangeRecipientName(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->allowChangeRecipientName=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetAllowChangeValue(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->allowChangeValue;
}


void AB_TransactionLimits_SetAllowChangeValue(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->allowChangeValue=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetAllowChangeTextKey(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->allowChangeTextKey;
}


void AB_TransactionLimits_SetAllowChangeTextKey(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->allowChangeTextKey=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetAllowChangePurpose(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->allowChangePurpose;
}


void AB_TransactionLimits_SetAllowChangePurpose(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->allowChangePurpose=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetAllowChangeFirstExecutionDate(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->allowChangeFirstExecutionDate;
}


void AB_TransactionLimits_SetAllowChangeFirstExecutionDate(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->allowChangeFirstExecutionDate=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetAllowChangeLastExecutionDate(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->allowChangeLastExecutionDate;
}


void AB_TransactionLimits_SetAllowChangeLastExecutionDate(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->allowChangeLastExecutionDate=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetAllowChangeCycle(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->allowChangeCycle;
}


void AB_TransactionLimits_SetAllowChangeCycle(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->allowChangeCycle=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetAllowChangePeriod(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->allowChangePeriod;
}


void AB_TransactionLimits_SetAllowChangePeriod(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->allowChangePeriod=d;
  st->_modified=1;
}




int AB_TransactionLimits_GetAllowChangeExecutionDay(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->allowChangeExecutionDay;
}


void AB_TransactionLimits_SetAllowChangeExecutionDay(AB_TRANSACTION_LIMITS *st, int d) {
  assert(st);
  st->allowChangeExecutionDay=d;
  st->_modified=1;
}




int AB_TransactionLimits_IsModified(const AB_TRANSACTION_LIMITS *st) {
  assert(st);
  return st->_modified;
}


void AB_TransactionLimits_SetModified(AB_TRANSACTION_LIMITS *st, int i) {
  assert(st);
  st->_modified=i;
}


void AB_TransactionLimits_Attach(AB_TRANSACTION_LIMITS *st) {
  assert(st);
  st->_usage++;
}
AB_TRANSACTION_LIMITS *AB_TransactionLimits_List2__freeAll_cb(AB_TRANSACTION_LIMITS *st, void *user_data) {
  AB_TransactionLimits_free(st);
return 0;
}


void AB_TransactionLimits_List2_freeAll(AB_TRANSACTION_LIMITS_LIST2 *stl) {
  if (stl) {
    AB_TransactionLimits_List2_ForEach(stl, AB_TransactionLimits_List2__freeAll_cb, 0);
    AB_TransactionLimits_List2_free(stl); 
  }
}


AB_TRANSACTION_LIMITS_LIST *AB_TransactionLimits_List_dup(const AB_TRANSACTION_LIMITS_LIST *stl) {
  if (stl) {
    AB_TRANSACTION_LIMITS_LIST *nl;
    AB_TRANSACTION_LIMITS *e;

    nl=AB_TransactionLimits_List_new();
    e=AB_TransactionLimits_List_First(stl);
    while(e) {
      AB_TRANSACTION_LIMITS *ne;

      ne=AB_TransactionLimits_dup(e);
      assert(ne);
      AB_TransactionLimits_List_Add(ne, nl);
      e=AB_TransactionLimits_List_Next(e);
    } /* while (e) */
    return nl;
  }
  else
    return 0;
}




