/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version: 1.3.19
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

using System;
public class DbEnv : IDisposable {
  private IntPtr swigCPtr;
  protected bool swigCMemOwn;

  internal DbEnv(IntPtr cPtr, bool cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  protected DbEnv() : this(IntPtr.Zero, false) {
  }

  public virtual void Dispose() {
    delete();
  }

  protected virtual void delete() {
    if(swigCPtr != IntPtr.Zero && swigCMemOwn) {
      dbxml_dotnetPINVOKE.delete_DbEnv(swigCPtr);
      swigCMemOwn = false;
    }
    swigCPtr = IntPtr.Zero;
  }

  internal static IntPtr getCPtr(DbEnv obj) {
    return (obj == null) ? IntPtr.Zero : obj.swigCPtr;
  }

  public DbEnv(uint flags) : this(dbxml_dotnetPINVOKE.new_DbEnv(flags), true) {
  }

  public virtual int close(uint arg0) {
    return dbxml_dotnetPINVOKE.DbEnv_close(swigCPtr, arg0);
  }

  public virtual int dbremove(DbTxn txn, string name, string subdb, uint flags) {
    return dbxml_dotnetPINVOKE.DbEnv_dbremove(swigCPtr, DbTxn.getCPtr(txn), name, subdb, flags);
  }

  public virtual int dbrename(DbTxn txn, string name, string subdb, string newname, uint flags) {
    return dbxml_dotnetPINVOKE.DbEnv_dbrename(swigCPtr, DbTxn.getCPtr(txn), name, subdb, newname, flags);
  }

  public virtual int open(string arg0, uint arg1, int arg2) {
    return dbxml_dotnetPINVOKE.DbEnv_open(swigCPtr, arg0, arg1, arg2);
  }

  public virtual int remove(string arg0, uint arg1) {
    return dbxml_dotnetPINVOKE.DbEnv_remove(swigCPtr, arg0, arg1);
  }

  public virtual int set_cachesize(uint arg0, uint arg1, int arg2) {
    return dbxml_dotnetPINVOKE.DbEnv_set_cachesize(swigCPtr, arg0, arg1, arg2);
  }

  public virtual int set_data_dir(string arg0) {
    return dbxml_dotnetPINVOKE.DbEnv_set_data_dir(swigCPtr, arg0);
  }

  public virtual int set_encrypt(string arg0, uint arg1) {
    return dbxml_dotnetPINVOKE.DbEnv_set_encrypt(swigCPtr, arg0, arg1);
  }

  public virtual void set_errpfx(string arg0) {
    dbxml_dotnetPINVOKE.DbEnv_set_errpfx(swigCPtr, arg0);
  }

  public virtual int set_flags(uint arg0, int arg1) {
    return dbxml_dotnetPINVOKE.DbEnv_set_flags(swigCPtr, arg0, arg1);
  }

  public virtual int set_lg_bsize(uint arg0) {
    return dbxml_dotnetPINVOKE.DbEnv_set_lg_bsize(swigCPtr, arg0);
  }

  public virtual int set_lg_dir(string arg0) {
    return dbxml_dotnetPINVOKE.DbEnv_set_lg_dir(swigCPtr, arg0);
  }

  public virtual int set_lg_max(uint arg0) {
    return dbxml_dotnetPINVOKE.DbEnv_set_lg_max(swigCPtr, arg0);
  }

  public virtual int set_lg_regionmax(uint arg0) {
    return dbxml_dotnetPINVOKE.DbEnv_set_lg_regionmax(swigCPtr, arg0);
  }

  public virtual int set_lk_detect(uint arg0) {
    return dbxml_dotnetPINVOKE.DbEnv_set_lk_detect(swigCPtr, arg0);
  }

  public virtual int set_lk_max_lockers(uint arg0) {
    return dbxml_dotnetPINVOKE.DbEnv_set_lk_max_lockers(swigCPtr, arg0);
  }

  public virtual int set_lk_max_locks(uint arg0) {
    return dbxml_dotnetPINVOKE.DbEnv_set_lk_max_locks(swigCPtr, arg0);
  }

  public virtual int set_lk_max_objects(uint arg0) {
    return dbxml_dotnetPINVOKE.DbEnv_set_lk_max_objects(swigCPtr, arg0);
  }

  public virtual int set_mp_mmapsize(int arg0) {
    return dbxml_dotnetPINVOKE.DbEnv_set_mp_mmapsize(swigCPtr, arg0);
  }

  public virtual int set_shm_key(int arg0) {
    return dbxml_dotnetPINVOKE.DbEnv_set_shm_key(swigCPtr, arg0);
  }

  public virtual int set_timeout(long arg0, uint arg1) {
    return dbxml_dotnetPINVOKE.DbEnv_set_timeout(swigCPtr, arg0, arg1);
  }

  public virtual int set_tmp_dir(string arg0) {
    return dbxml_dotnetPINVOKE.DbEnv_set_tmp_dir(swigCPtr, arg0);
  }

  public virtual int set_tas_spins(uint arg0) {
    return dbxml_dotnetPINVOKE.DbEnv_set_tas_spins(swigCPtr, arg0);
  }

  public virtual int set_tx_max(uint arg0) {
    return dbxml_dotnetPINVOKE.DbEnv_set_tx_max(swigCPtr, arg0);
  }

  public virtual int set_verbose(uint which, int arg1) {
    return dbxml_dotnetPINVOKE.DbEnv_set_verbose(swigCPtr, which, arg1);
  }

  public static string version(ref int major, ref int minor, ref int patch) {
    return dbxml_dotnetPINVOKE.DbEnv_version(ref major, ref minor, ref patch);
  }

  public static string strerror(int arg0) {
    return dbxml_dotnetPINVOKE.DbEnv_strerror(arg0);
  }

  public DbTxn txn_begin(DbTxn pid, uint flags) {
    IntPtr cPtr = dbxml_dotnetPINVOKE.DbEnv_txn_begin(swigCPtr, DbTxn.getCPtr(pid), flags);
    return (cPtr == IntPtr.Zero) ? null : new DbTxn(cPtr, false);
  }

  public virtual int txn_checkpoint(uint kbyte, uint min, uint flags) {
    return dbxml_dotnetPINVOKE.DbEnv_txn_checkpoint(swigCPtr, kbyte, min, flags);
  }

}
