示例#1
0
        private DBC cursor(DB_TXN txn, uint flags, ref int err)
        {
            global::System.IntPtr cPtr = libdb_csharpPINVOKE.DB_cursor(swigCPtr, DB_TXN.getCPtr(txn), flags, ref err);
            DBC ret = (cPtr == global::System.IntPtr.Zero) ? null : new DBC(cPtr, false);

            return(ret);
        }
示例#2
0
        private DB_TXN txn_begin(DB_TXN parent, uint flags, ref int err)
        {
            IntPtr cPtr = libdb_csharpPINVOKE.DB_ENV_txn_begin(swigCPtr, DB_TXN.getCPtr(parent), flags, ref err);
            DB_TXN ret  = (cPtr == IntPtr.Zero) ? null : new DB_TXN(cPtr, false);

            return(ret);
        }
示例#3
0
        internal int get(DB_TXN txn, uint delta, ref Int64 retp, uint flags)
        {
            int ret;

            ret = libdb_csharpPINVOKE.DB_SEQUENCE_get(swigCPtr, DB_TXN.getCPtr(txn), delta, ref retp, flags);
            DatabaseException.ThrowException(ret);
            return(ret);
        }
示例#4
0
        internal int truncate(DB_TXN txn, ref uint countp, uint flags)
        {
            int ret;

            ret = libdb_csharpPINVOKE.DB_truncate(swigCPtr, DB_TXN.getCPtr(txn), ref countp, flags);
            DatabaseException.ThrowException(ret);
            return(ret);
        }
示例#5
0
        internal int associate(DB_TXN txn, DB sec, BDB_AssociateDelegate callback, uint flags)
        {
            int ret;

            ret = libdb_csharpPINVOKE.DB_associate(swigCPtr, DB_TXN.getCPtr(txn), DB.getCPtr(sec), callback, flags);
            DatabaseException.ThrowException(ret);
            return(ret);
        }
示例#6
0
        internal int log_printf(DB_TXN txn, string str)
        {
            int ret;

            ret = libdb_csharpPINVOKE.DB_ENV_log_printf(swigCPtr, DB_TXN.getCPtr(txn), str);
            DatabaseException.ThrowException(ret);
            return(ret);
        }
示例#7
0
        internal int dbrename(DB_TXN txn, string file, string database, string newname, uint flags)
        {
            int ret;

            ret = libdb_csharpPINVOKE.DB_ENV_dbrename(swigCPtr, DB_TXN.getCPtr(txn), file, database, newname, flags);
            DatabaseException.ThrowException(ret);
            return(ret);
        }
示例#8
0
 internal int key_range(DB_TXN txn, DatabaseEntry key, DB_KEY_RANGE range, uint flags)
 {
     try {
         int ret;
         ret = libdb_csharpPINVOKE.DB_key_range(swigCPtr, DB_TXN.getCPtr(txn), DBT.getCPtr(DatabaseEntry.getDBT(key)), DB_KEY_RANGE.getCPtr(range), flags);
         DatabaseException.ThrowException(ret);
         return(ret);
     } finally {
         GC.KeepAlive(key);
     }
 }
示例#9
0
 internal int exists(DB_TXN txn, DatabaseEntry key, uint flags)
 {
     try {
         int ret;
         ret = libdb_csharpPINVOKE.DB_exists(swigCPtr, DB_TXN.getCPtr(txn), DBT.getCPtr(DatabaseEntry.getDBT(key)), flags);
         DatabaseException.ThrowException(ret);
         return(ret);
     } finally {
         GC.KeepAlive(key);
     }
 }
示例#10
0
        internal int open(DB_TXN txn, string file, string database, DBTYPE type, uint flags, int mode)
        {
            int ret;

            ret = libdb_csharpPINVOKE.DB_open(swigCPtr, DB_TXN.getCPtr(txn), file, database, (int)type, flags, mode);
            if (ret != 0)
            {
                close(0);
            }
            DatabaseException.ThrowException(ret);
            return(ret);
        }
示例#11
0
 internal int compact(DB_TXN txn, DatabaseEntry start, DatabaseEntry stop, DB_COMPACT cdata, uint flags, DatabaseEntry end)
 {
     try {
         int ret;
         ret = libdb_csharpPINVOKE.DB_compact(swigCPtr, DB_TXN.getCPtr(txn), DBT.getCPtr(DatabaseEntry.getDBT(start)), DBT.getCPtr(DatabaseEntry.getDBT(stop)), DB_COMPACT.getCPtr(cdata), flags, DBT.getCPtr(DatabaseEntry.getDBT(end)));
         DatabaseException.ThrowException(ret);
         return(ret);
     } finally {
         GC.KeepAlive(start);
         GC.KeepAlive(stop);
         GC.KeepAlive(end);
     }
 }
示例#12
0
        internal int remove(DB_TXN txn, uint flags)
        {
            int ret;

            ret = libdb_csharpPINVOKE.DB_SEQUENCE_remove(swigCPtr, DB_TXN.getCPtr(txn), flags);

            /*
             * remove is a handle destructor, regardless of whether the remove
             * succeeds.  Reflect that in the wrapper class.
             */
            swigCPtr = new HandleRef(null, IntPtr.Zero);
            DatabaseException.ThrowException(ret);
            return(ret);
        }
示例#13
0
 internal int open(DB_TXN txn, DatabaseEntry key, uint flags)
 {
     try {
         int ret;
         ret = libdb_csharpPINVOKE.DB_SEQUENCE_open(swigCPtr, DB_TXN.getCPtr(txn), DBT.getCPtr(DatabaseEntry.getDBT(key)), flags);
         if (ret != 0)
         {
             close(0);
         }
         DatabaseException.ThrowException(ret);
         return(ret);
     } finally {
         GC.KeepAlive(key);
     }
 }
示例#14
0
 private IntPtr stat(DB_TXN txnid, uint flags, ref int err)
 {
     return(libdb_csharpPINVOKE.DB_stat(swigCPtr, DB_TXN.getCPtr(txnid), flags, ref err));
 }