本文整理汇总了C#中BerkeleyDB.Internal.DB_ENV类的典型用法代码示例。如果您正苦于以下问题:C# DB_ENV类的具体用法?C# DB_ENV怎么用?C# DB_ENV使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DB_ENV类属于BerkeleyDB.Internal命名空间,在下文中一共展示了DB_ENV类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: doRepTransport
private static int doRepTransport(IntPtr envp,
IntPtr controlp, IntPtr recp, IntPtr lsnp, int envid, uint flags) {
DB_ENV dbenv = new DB_ENV(envp, false);
DBT control = new DBT(controlp, false);
DBT rec = new DBT(recp, false);
DB_LSN tmplsn = new DB_LSN(lsnp, false);
LSN dblsn = new LSN(tmplsn.file, tmplsn.offset);
return dbenv.api2_internal.transportHandler(
DatabaseEntry.fromDBT(control),
DatabaseEntry.fromDBT(rec), dblsn, envid, flags);
}
示例2: doThreadID
private static void doThreadID(IntPtr env, IntPtr pid, IntPtr tid) {
DB_ENV dbenv = new DB_ENV(env, false);
DbThreadID id = dbenv.api2_internal.threadIDHandler();
/*
* Sometimes the library doesn't care about either pid or tid
* (usually tid) and will pass NULL instead of a valid pointer.
*/
if (pid != IntPtr.Zero)
Marshal.WriteInt32(pid, id.processID);
if (tid != IntPtr.Zero)
Marshal.WriteInt32(tid, (int)id.threadID);
}
示例3: doBackupWrite
private static int doBackupWrite(IntPtr env, uint off_gbytes, uint off_bytes, uint usize, IntPtr buf, IntPtr handle) {
int ret, size;
long offset = off_gbytes * GIGABYTE + off_bytes;
DB_ENV dbenv = new DB_ENV(env, false);
if (usize > Int32.MaxValue)
size = Int32.MaxValue;
else
size = (int)usize;
byte[] data = new byte[size];
Marshal.Copy(buf, data, 0, (int)size);
ret = dbenv.api2_internal.backupObj.Write(data, offset, (int)size);
if (ret == 0 && usize > Int32.MaxValue) {
size = (int)(usize - Int32.MaxValue);
/*
* There's no need to re-allocate data, it's already as large as
* we could possibly need it to be. Advance buf beyond what was
* just copied and write the remaining data.
*/
buf = new IntPtr(buf.ToInt64() + Int32.MaxValue);
Marshal.Copy(buf, data, 0, (int)size);
ret = dbenv.api2_internal.backupObj.Write(data, offset, (int)size);
}
return ret;
}
示例4: doThreadName
private static string doThreadName(IntPtr env,
int pid, uint tid, ref string buf)
{
DB_ENV dbenv = new DB_ENV(env, false);
DbThreadID id = new DbThreadID(pid, tid);
string ret =
dbenv.api2_internal.threadNameHandler(id);
try {
buf = ret;
} catch (NullReferenceException) {
/*
* The library may give us a NULL pointer in buf and there's no
* good way to test for that. Just ignore the exception if
* we're not able to set buf.
*/
}
return ret;
}
示例5: doRepView
private static int doRepView(IntPtr envp,
string name, ref int result, uint flags)
{
DB_ENV dbenv = new DB_ENV(envp, false);
return dbenv.api2_internal.replicationViewHandler(name,
ref result, flags);
}
示例6: doNotify
private static void doNotify(IntPtr env, uint eventcode, byte[] event_info)
{
DB_ENV dbenv = new DB_ENV(env, false);
dbenv.api2_internal.notifyHandler(
(NotificationEvent)eventcode, event_info);
}
示例7: doMsgFeedback
private static void doMsgFeedback(IntPtr env, string msg)
{
DB_ENV dbenv = new DB_ENV(env, false);
dbenv.api2_internal.msgFeedbackHandler(msg);
}
示例8: doMessageDispatch
private static void doMessageDispatch(IntPtr env, IntPtr channel,
IntPtr requestp, uint nrequest, uint cb_flags)
{
DB_ENV dbenv = new DB_ENV(env, false);
DbChannel dbchannel = new DbChannel(new DB_CHANNEL(channel, false));
bool need_response =
(cb_flags == DbConstants.DB_REPMGR_NEED_RESPONSE);
IntPtr[] reqp = new IntPtr[nrequest];
Marshal.Copy(requestp, reqp, 0, (int)nrequest);
DatabaseEntry[] requests = new DatabaseEntry[nrequest];
for (int i = 0; i < nrequest; i++) {
requests[i] = DatabaseEntry.fromDBT(new DBT(reqp[i], false));
}
dbenv.api2_internal.messageDispatchHandler(
dbchannel, ref requests, out nrequest, need_response);
}
示例9: getCPtr
internal static HandleRef getCPtr(DB_ENV obj)
{
return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
}
示例10: doErrFeedback
private static void doErrFeedback(IntPtr env, string pfx, string msg)
{
DB_ENV dbenv = new DB_ENV(env, false);
dbenv.api2_internal.errFeedbackHandler(
dbenv.api2_internal._pfx, msg);
}
示例11: doBackupOpen
private static int doBackupOpen(IntPtr env, string dbname, string target, IntPtr handle)
{
DB_ENV dbenv = new DB_ENV(env, false);
return dbenv.api2_internal.backupObj.Open(dbname, target);
}
示例12: doBackupClose
private static int doBackupClose(IntPtr env, string dbname, IntPtr handle)
{
DB_ENV dbenv = new DB_ENV(env, false);
return dbenv.api2_internal.backupObj.Close(dbname);
}
示例13: __os_umalloc
internal static IntPtr __os_umalloc(DB_ENV dbenv, uint size)
{
return libdb_csharpPINVOKE.__os_umalloc(DB_ENV.getCPtr(dbenv), size);
}
示例14: __os_ufree
internal static void __os_ufree(DB_ENV dbenv, IntPtr ptr)
{
libdb_csharpPINVOKE.__os_ufree(DB_ENV.getCPtr(dbenv), ptr);
}
示例15: alloc_dbt_arr
internal static uint alloc_dbt_arr(DB_ENV dbenv, int num_dbt, out IntPtr ptr)
{
uint ret = libdb_csharpPINVOKE.alloc_dbt_arr(DB_ENV.getCPtr(dbenv), num_dbt, out ptr);
return ret;
}