Beispiel #1
0
Datei: DB.cs Projekt: mcandre/db
 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;
 }
Beispiel #2
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);
        }
Beispiel #3
0
        private DB_TXN cdsgroup_begin(ref int err)
        {
            IntPtr cPtr = libdb_csharpPINVOKE.DB_ENV_cdsgroup_begin(swigCPtr, ref err);
            DB_TXN ret  = (cPtr == IntPtr.Zero) ? null : new DB_TXN(cPtr, false);

            return(ret);
        }
Beispiel #4
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;
 }
Beispiel #5
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);
        }
Beispiel #6
0
	internal QueueStatStruct stat_qam(DB_TXN txn, uint flags) {
		int err = 0;
		IntPtr ptr = stat(txn, flags, ref err);
		DatabaseException.ThrowException(err);
		QueueStatStruct ret = (QueueStatStruct)Marshal.PtrToStructure(ptr, typeof(QueueStatStruct));
		libdb_csharp.__os_ufree(null, ptr);
		return ret;
	}
Beispiel #7
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);
        }
Beispiel #8
0
        internal DB_TXN cdsgroup_begin()
        {
            int    err = 0;
            DB_TXN ret = cdsgroup_begin(ref err);

            DatabaseException.ThrowException(err);
            return(ret);
        }
Beispiel #9
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);
        }
Beispiel #10
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);
        }
Beispiel #11
0
        internal DB_TXN txn_begin(DB_TXN parent, uint flags)
        {
            int    err = 0;
            DB_TXN ret = txn_begin(parent, flags, ref err);

            DatabaseException.ThrowException(err);
            return(ret);
        }
Beispiel #12
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);
        }
Beispiel #13
0
        internal DBC cursor(DB_TXN txn, uint flags)
        {
            int err = 0;
            DBC ret = cursor(txn, flags, ref err);

            DatabaseException.ThrowException(err);
            return(ret);
        }
Beispiel #14
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);
        }
Beispiel #15
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);
     }
 }
Beispiel #16
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);
     }
 }
Beispiel #17
0
        internal HeapStatStruct stat_heap(DB_TXN txn, uint flags)
        {
            int    err = 0;
            IntPtr ptr = stat(txn, flags, ref err);

            DatabaseException.ThrowException(err);
            HeapStatStruct ret = (HeapStatStruct)Marshal.PtrToStructure(ptr, typeof(HeapStatStruct));

            libdb_csharp.__os_ufree(null, ptr);
            return(ret);
        }
Beispiel #18
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);
        }
Beispiel #19
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);
     }
 }
Beispiel #20
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);
        }
Beispiel #21
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);
     }
 }
Beispiel #22
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(DB_TXN obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }
Beispiel #23
0
Datei: DB.cs Projekt: mcandre/db
 private IntPtr stat(DB_TXN txnid, uint flags, ref int err)
 {
     return libdb_csharpPINVOKE.DB_stat(swigCPtr, DB_TXN.getCPtr(txnid), flags, ref err);
 }
Beispiel #24
0
Datei: DB.cs Projekt: mcandre/db
 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);
     }
 }
Beispiel #25
0
Datei: DB.cs Projekt: mcandre/db
 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;
 }
Beispiel #26
0
Datei: DB.cs Projekt: mcandre/db
 private DBC cursor(DB_TXN txn, uint flags, ref int err)
 {
     IntPtr cPtr = libdb_csharpPINVOKE.DB_cursor(swigCPtr, DB_TXN.getCPtr(txn), flags, ref err);
     DBC ret = (cPtr == IntPtr.Zero) ? null : new DBC(cPtr, false);
     return ret;
 }
Beispiel #27
0
Datei: DB.cs Projekt: mcandre/db
 internal int put(DB_TXN txn, DatabaseEntry key, DatabaseEntry data, uint flags)
 {
     try {
     int ret;
     ret = libdb_csharpPINVOKE.DB_put(swigCPtr, DB_TXN.getCPtr(txn), DBT.getCPtr(DatabaseEntry.getDBT(key)), DBT.getCPtr(DatabaseEntry.getDBT(data)), flags);
     DatabaseException.ThrowException(ret);
     return ret;
     } finally {
       GC.KeepAlive(key);
       GC.KeepAlive(data);
     }
 }
 internal static HandleRef getCPtr(DB_TXN obj)
 {
     return((obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr);
 }
Beispiel #29
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;
 }
Beispiel #30
0
Datei: DB.cs Projekt: mcandre/db
 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;
 }
 internal static HandleRef getCPtr(DB_TXN obj)
 {
     return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
 }
Beispiel #32
0
 internal DB_TXN txn_begin(DB_TXN parent, uint flags)
 {
     int err = 0;
     DB_TXN ret = txn_begin(parent, flags, ref err);
     DatabaseException.ThrowException(err);
     return ret;
 }
Beispiel #33
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);
     }
 }
Beispiel #34
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));
 }
Beispiel #35
0
 internal Transaction(DB_TXN txn)
 {
     dbtxn = txn;
     dbtoken = null;
 }
Beispiel #36
0
 internal Transaction(DB_TXN txn)
 {
     dbtxn = txn;
 }
Beispiel #37
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;
 }
Beispiel #38
0
Datei: DB.cs Projekt: mcandre/db
 internal DBC cursor(DB_TXN txn, uint flags)
 {
     int err = 0;
     DBC ret = cursor(txn, flags, ref err);
     DatabaseException.ThrowException(err);
     return ret;
 }
Beispiel #39
0
Datei: DB.cs Projekt: mcandre/db
 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);
     }
 }
Beispiel #40
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;
 }
Beispiel #41
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;
 }