1 //------------------------------------------------------------------------------
2 // <auto-generated />
3 //
4 // This file was automatically generated by SWIG (http://www.swig.org).
5 // Version 3.0.12
6 //
7 // Do not make changes to this file unless you know what you are doing--modify
8 // the SWIG interface file instead.
9 //------------------------------------------------------------------------------
10 
11 namespace BerkeleyDB.Internal {
12 
13 using global::System;
14 using global::System.Runtime.InteropServices;
15 
16 internal class DB : global::System.IDisposable {
17   private global::System.Runtime.InteropServices.HandleRef swigCPtr;
18   protected bool swigCMemOwn;
19 
DB(global::System.IntPtr cPtr, bool cMemoryOwn)20   internal DB(global::System.IntPtr cPtr, bool cMemoryOwn) {
21     swigCMemOwn = cMemoryOwn;
22     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
23   }
24 
getCPtr(DB obj)25   internal static global::System.Runtime.InteropServices.HandleRef getCPtr(DB obj) {
26     return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
27   }
28 
Dispose()29   public virtual void Dispose()  {
30     lock(this) {
31       if(swigCPtr.Handle != IntPtr.Zero && swigCMemOwn) {
32         swigCMemOwn = false;
33       }
34       swigCPtr = new HandleRef(null, IntPtr.Zero);
35       GC.SuppressFinalize(this);
36     }
37 }
38 
get_partition_keys()39 	internal DatabaseEntry[] get_partition_keys() {
40 		uint count = 0;
41 		int err = 0;
42 		uint size = 0;
43 		DatabaseEntry[] ret = get_partition_keys(ref count, ref size, ref err);
44 		DatabaseException.ThrowException(err);
45 		return ret;
46 	}
cursor(DB_TXN txn, uint flags)47 	internal DBC cursor(DB_TXN txn, uint flags) {
48 		int err = 0;
49 		DBC ret = cursor(txn, flags, ref err);
50 		DatabaseException.ThrowException(err);
51 		return ret;
52 	}
53 
join(IntPtr[] curslist, uint flags)54 	internal DBC join(IntPtr[] curslist, uint flags) {
55 		int err = 0;
56 		DBC ret = join(curslist, flags, ref err);
57 		DatabaseException.ThrowException(err);
58 		return ret;
59 	}
60 
stat_bt(DB_TXN txn, uint flags)61 	internal BTreeStatStruct stat_bt(DB_TXN txn, uint flags) {
62 		int err = 0;
63 		IntPtr ptr = stat(txn, flags, ref err);
64 		DatabaseException.ThrowException(err);
65 		BTreeStatStruct ret = (BTreeStatStruct)Marshal.PtrToStructure(ptr, typeof(BTreeStatStruct));
66 		libdb_csharp.__os_ufree(null, ptr);
67 		return ret;
68 	}
stat_hash(DB_TXN txn, uint flags)69 	internal HashStatStruct stat_hash(DB_TXN txn, uint flags) {
70 		int err = 0;
71 		IntPtr ptr = stat(txn, flags, ref err);
72 		DatabaseException.ThrowException(err);
73 		HashStatStruct ret = (HashStatStruct)Marshal.PtrToStructure(ptr, typeof(HashStatStruct));
74 		libdb_csharp.__os_ufree(null, ptr);
75 		return ret;
76 	}
stat_heap(DB_TXN txn, uint flags)77 	internal HeapStatStruct stat_heap(DB_TXN txn, uint flags) {
78 		int err = 0;
79 		IntPtr ptr = stat(txn, flags, ref err);
80 		DatabaseException.ThrowException(err);
81 		HeapStatStruct ret = (HeapStatStruct)Marshal.PtrToStructure(ptr, typeof(HeapStatStruct));
82 		libdb_csharp.__os_ufree(null, ptr);
83 		return ret;
84 	}
stat_qam(DB_TXN txn, uint flags)85 	internal QueueStatStruct stat_qam(DB_TXN txn, uint flags) {
86 		int err = 0;
87 		IntPtr ptr = stat(txn, flags, ref err);
88 		DatabaseException.ThrowException(err);
89 		QueueStatStruct ret = (QueueStatStruct)Marshal.PtrToStructure(ptr, typeof(QueueStatStruct));
90 		libdb_csharp.__os_ufree(null, ptr);
91 		return ret;
92 	}
93 
get_blob_sub_dir(out string dir)94 	internal int get_blob_sub_dir(out string dir) {
95 		int ret;
96 		IntPtr dirp;
97 		ret = get_blob_sub_dir(out dirp);
98 		dir = Marshal.PtrToStringAnsi(dirp);
99 		return ret;
100 	}
101 
get_dbname(out string filenamep, out string dbnamep)102 	internal int get_dbname(out string filenamep, out string dbnamep) {
103 		int ret;
104 		IntPtr fp, dp;
105 		filenamep = dbnamep = null;
106 		ret = get_dbname(out fp, out dp);
107 		filenamep = Marshal.PtrToStringAnsi(fp);
108 		dbnamep = Marshal.PtrToStringAnsi(dp);
109 		return ret;
110 	}
111 
get_ext_file_dir(out string dir)112 	internal int get_ext_file_dir(out string dir) {
113 		int ret;
114 		IntPtr dirp;
115 		ret = get_ext_file_dir(out dirp);
116 		dir = Marshal.PtrToStringAnsi(dirp);
117 		return ret;
118 	}
119 
get_re_source(out string source)120 	internal int get_re_source(out string source) {
121 		int ret;
122 		IntPtr sp;
123 		ret = get_re_source(out sp);
124 		source = Marshal.PtrToStringAnsi(sp);
125 		return ret;
126 	}
127 
128   internal BaseDatabase api_internal {
129     set {
130       libdb_csharpPINVOKE.DB_api_internal_set(swigCPtr, value);
131     }
132 		get { return libdb_csharpPINVOKE.DB_api_internal_get(swigCPtr); }
133 
134   }
135 
set_usercopy(DBTCopyDelegate dbt_usercopy)136   internal int set_usercopy(DBTCopyDelegate dbt_usercopy) {
137 		int ret;
138 		ret = libdb_csharpPINVOKE.DB_set_usercopy(swigCPtr, dbt_usercopy);
139 		DatabaseException.ThrowException(ret);
140 		return ret;
141 }
142 
DB(DB_ENV env, uint flags)143   internal DB(DB_ENV env, uint flags) : this(libdb_csharpPINVOKE.new_DB(DB_ENV.getCPtr(env), flags), true) {
144   }
145 
associate(DB_TXN txn, DB sec, BDB_AssociateDelegate callback, uint flags)146   internal int associate(DB_TXN txn, DB sec, BDB_AssociateDelegate callback, uint flags) {
147 		int ret;
148 		ret = libdb_csharpPINVOKE.DB_associate(swigCPtr, DB_TXN.getCPtr(txn), DB.getCPtr(sec), callback, flags);
149 		DatabaseException.ThrowException(ret);
150 		return ret;
151 }
152 
associate_foreign(DB dbp, BDB_AssociateForeignDelegate callback, uint flags)153   internal int associate_foreign(DB dbp, BDB_AssociateForeignDelegate callback, uint flags) {
154 		int ret;
155 		ret = libdb_csharpPINVOKE.DB_associate_foreign(swigCPtr, DB.getCPtr(dbp), callback, flags);
156 		DatabaseException.ThrowException(ret);
157 		return ret;
158 }
159 
close(uint flags)160   internal int close(uint flags) {
161 		int ret = libdb_csharpPINVOKE.DB_close(swigCPtr, flags);
162 		if (ret == 0)
163 			/* Close is a db handle destructor.  Reflect that in the wrapper class. */
164 			swigCPtr = new HandleRef(null, IntPtr.Zero);
165 		else
166 			DatabaseException.ThrowException(ret);
167 		return ret;
168 }
169 
compact(DB_TXN txn, DatabaseEntry start, DatabaseEntry stop, DB_COMPACT cdata, uint flags, DatabaseEntry end)170   internal int compact(DB_TXN txn, DatabaseEntry start, DatabaseEntry stop, DB_COMPACT cdata, uint flags, DatabaseEntry end) {
171     try {
172 		int ret;
173 		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)));
174 		DatabaseException.ThrowException(ret);
175 		return ret;
176 } finally {
177       GC.KeepAlive(start);
178       GC.KeepAlive(stop);
179       GC.KeepAlive(end);
180     }
181   }
182 
convert(string file, int lorder)183   internal int convert(string file, int lorder) {
184 		int ret;
185 		ret = libdb_csharpPINVOKE.DB_convert(swigCPtr, file, lorder);
186 		DatabaseException.ThrowException(ret);
187 		return ret;
188 }
189 
cursor(DB_TXN txn, uint flags, ref int err)190   private DBC cursor(DB_TXN txn, uint flags, ref int err) {
191     global::System.IntPtr cPtr = libdb_csharpPINVOKE.DB_cursor(swigCPtr, DB_TXN.getCPtr(txn), flags, ref err);
192     DBC ret = (cPtr == global::System.IntPtr.Zero) ? null : new DBC(cPtr, false);
193     return ret;
194   }
195 
del(DB_TXN txn, DatabaseEntry key, uint flags)196   internal int del(DB_TXN txn, DatabaseEntry key, uint flags) {
197     try {
198 		int ret;
199 		ret = libdb_csharpPINVOKE.DB_del(swigCPtr, DB_TXN.getCPtr(txn), DBT.getCPtr(DatabaseEntry.getDBT(key)), flags);
200 		DatabaseException.ThrowException(ret);
201 		return ret;
202 } finally {
203       GC.KeepAlive(key);
204     }
205   }
206 
env()207   internal DB_ENV env() {
208     global::System.IntPtr cPtr = libdb_csharpPINVOKE.DB_env(swigCPtr);
209     DB_ENV ret = (cPtr == global::System.IntPtr.Zero) ? null : new DB_ENV(cPtr, false);
210     return ret;
211   }
212 
exists(DB_TXN txn, DatabaseEntry key, uint flags)213   internal int exists(DB_TXN txn, DatabaseEntry key, uint flags) {
214     try {
215 		int ret;
216 		ret = libdb_csharpPINVOKE.DB_exists(swigCPtr, DB_TXN.getCPtr(txn), DBT.getCPtr(DatabaseEntry.getDBT(key)), flags);
217 		DatabaseException.ThrowException(ret);
218 		return ret;
219 } finally {
220       GC.KeepAlive(key);
221     }
222   }
223 
get(DB_TXN txn, DatabaseEntry key, DatabaseEntry data, uint flags)224   internal int get(DB_TXN txn, DatabaseEntry key, DatabaseEntry data, uint flags) {
225     try {
226 		int ret;
227 		ret = libdb_csharpPINVOKE.DB_get(swigCPtr, DB_TXN.getCPtr(txn), DBT.getCPtr(DatabaseEntry.getDBT(key)), DBT.getCPtr(DatabaseEntry.getDBT(data)), flags);
228 		DatabaseException.ThrowException(ret);
229 		return ret;
230 } finally {
231       GC.KeepAlive(key);
232       GC.KeepAlive(data);
233     }
234   }
235 
get_byteswapped(ref int isswapped)236   internal int get_byteswapped(ref int isswapped) {
237 		int ret;
238 		ret = libdb_csharpPINVOKE.DB_get_byteswapped(swigCPtr, ref isswapped);
239 		DatabaseException.ThrowException(ret);
240 		return ret;
241 }
242 
get_dbname(out IntPtr filenamep, out IntPtr dbnamep)243   internal int get_dbname(out IntPtr filenamep, out IntPtr dbnamep) {
244 		int ret;
245 		ret = libdb_csharpPINVOKE.DB_get_dbname(swigCPtr, out filenamep, out dbnamep);
246 		DatabaseException.ThrowException(ret);
247 		return ret;
248 }
249 
get_multiple()250   internal int get_multiple() {
251 		return libdb_csharpPINVOKE.DB_get_multiple(swigCPtr);
252 }
253 
get_open_flags(ref uint flags)254   internal int get_open_flags(ref uint flags) {
255 		int ret;
256 		ret = libdb_csharpPINVOKE.DB_get_open_flags(swigCPtr, ref flags);
257 		DatabaseException.ThrowException(ret);
258 		return ret;
259 }
260 
get_transactional()261   internal int get_transactional() {
262 		return libdb_csharpPINVOKE.DB_get_transactional(swigCPtr);
263 }
264 
get_type(ref DBTYPE type)265   internal int get_type(ref DBTYPE type) {
266 		int ret;
267 		ret = libdb_csharpPINVOKE.DB_get_type(swigCPtr, ref type);
268 		DatabaseException.ThrowException(ret);
269 		return ret;
270 }
271 
join(IntPtr[] curslist, uint flags, ref int err)272   private DBC join(IntPtr[] curslist, uint flags, ref int err) {
273     global::System.IntPtr cPtr = libdb_csharpPINVOKE.DB_join(swigCPtr, curslist, flags, ref err);
274     DBC ret = (cPtr == global::System.IntPtr.Zero) ? null : new DBC(cPtr, false);
275     return ret;
276   }
277 
key_range(DB_TXN txn, DatabaseEntry key, DB_KEY_RANGE range, uint flags)278   internal int key_range(DB_TXN txn, DatabaseEntry key, DB_KEY_RANGE range, uint flags) {
279     try {
280 		int ret;
281 		ret = libdb_csharpPINVOKE.DB_key_range(swigCPtr, DB_TXN.getCPtr(txn), DBT.getCPtr(DatabaseEntry.getDBT(key)), DB_KEY_RANGE.getCPtr(range), flags);
282 		DatabaseException.ThrowException(ret);
283 		return ret;
284 } finally {
285       GC.KeepAlive(key);
286     }
287   }
288 
open(DB_TXN txn, string file, string database, DBTYPE type, uint flags, int mode)289   internal int open(DB_TXN txn, string file, string database, DBTYPE type, uint flags, int mode) {
290 	int ret;
291 	ret = libdb_csharpPINVOKE.DB_open(swigCPtr, DB_TXN.getCPtr(txn), file, database, (int)type, flags, mode);
292 	if (ret != 0)
293 		close(0);
294 	DatabaseException.ThrowException(ret);
295 	return ret;
296 }
297 
pget(DB_TXN txn, DatabaseEntry key, DatabaseEntry pkey, DatabaseEntry data, uint flags)298   internal int pget(DB_TXN txn, DatabaseEntry key, DatabaseEntry pkey, DatabaseEntry data, uint flags) {
299     try {
300 		int ret;
301 		ret = libdb_csharpPINVOKE.DB_pget(swigCPtr, DB_TXN.getCPtr(txn), DBT.getCPtr(DatabaseEntry.getDBT(key)), DBT.getCPtr(DatabaseEntry.getDBT(pkey)), DBT.getCPtr(DatabaseEntry.getDBT(data)), flags);
302 		DatabaseException.ThrowException(ret);
303 		return ret;
304 } finally {
305       GC.KeepAlive(key);
306       GC.KeepAlive(pkey);
307       GC.KeepAlive(data);
308     }
309   }
310 
put(DB_TXN txn, DatabaseEntry key, DatabaseEntry data, uint flags)311   internal int put(DB_TXN txn, DatabaseEntry key, DatabaseEntry data, uint flags) {
312     try {
313 		int ret;
314 		ret = libdb_csharpPINVOKE.DB_put(swigCPtr, DB_TXN.getCPtr(txn), DBT.getCPtr(DatabaseEntry.getDBT(key)), DBT.getCPtr(DatabaseEntry.getDBT(data)), flags);
315 		DatabaseException.ThrowException(ret);
316 		return ret;
317 } finally {
318       GC.KeepAlive(key);
319       GC.KeepAlive(data);
320     }
321   }
322 
remove(string file, string database, uint flags)323   internal int remove(string file, string database, uint flags) {
324 	int ret;
325 	ret = libdb_csharpPINVOKE.DB_remove(swigCPtr, file, database, flags);
326 	/*
327 	 * remove is a handle destructor, regardless of whether the remove
328 	 * succeeds.  Reflect that in the wrapper class.
329 	 */
330 	swigCPtr = new HandleRef(null, IntPtr.Zero);
331 	DatabaseException.ThrowException(ret);
332 	return ret;
333 }
334 
rename(string file, string database, string newname, uint flags)335   internal int rename(string file, string database, string newname, uint flags) {
336 	int ret;
337 	ret = libdb_csharpPINVOKE.DB_rename(swigCPtr, file, database, newname, flags);
338 	/*
339 	 * rename is a handle destructor, regardless of whether the rename
340 	 * succeeds.  Reflect that in the wrapper class.
341 	 */
342 	swigCPtr = new HandleRef(null, IntPtr.Zero);
343 	DatabaseException.ThrowException(ret);
344 	return ret;
345 }
346 
set_append_recno(BDB_AppendRecnoDelegate callback)347   internal int set_append_recno(BDB_AppendRecnoDelegate callback) {
348 		int ret;
349 		ret = libdb_csharpPINVOKE.DB_set_append_recno(swigCPtr, callback);
350 		DatabaseException.ThrowException(ret);
351 		return ret;
352 }
353 
get_blob_sub_dir(out IntPtr dir)354   internal int get_blob_sub_dir(out IntPtr dir) {
355 		int ret;
356 		ret = libdb_csharpPINVOKE.DB_get_blob_sub_dir(swigCPtr, out dir);
357 		DatabaseException.ThrowException(ret);
358 		return ret;
359 }
360 
set_bt_compare(BDB_CompareDelegate callback)361   internal int set_bt_compare(BDB_CompareDelegate callback) {
362 		int ret;
363 		ret = libdb_csharpPINVOKE.DB_set_bt_compare(swigCPtr, callback);
364 		DatabaseException.ThrowException(ret);
365 		return ret;
366 }
367 
set_bt_compress(BDB_CompressDelegate compress, BDB_DecompressDelegate decompress)368   internal int set_bt_compress(BDB_CompressDelegate compress, BDB_DecompressDelegate decompress) {
369 		int ret;
370 		ret = libdb_csharpPINVOKE.DB_set_bt_compress(swigCPtr, compress, decompress);
371 		DatabaseException.ThrowException(ret);
372 		return ret;
373 }
374 
get_bt_minkey(ref uint bt_minkey)375   internal int get_bt_minkey(ref uint bt_minkey) {
376 		int ret;
377 		ret = libdb_csharpPINVOKE.DB_get_bt_minkey(swigCPtr, ref bt_minkey);
378 		DatabaseException.ThrowException(ret);
379 		return ret;
380 }
381 
set_bt_minkey(uint bt_minkey)382   internal int set_bt_minkey(uint bt_minkey) {
383 		int ret;
384 		ret = libdb_csharpPINVOKE.DB_set_bt_minkey(swigCPtr, bt_minkey);
385 		DatabaseException.ThrowException(ret);
386 		return ret;
387 }
388 
set_bt_prefix(BDB_PrefixCompareDelegate callback)389   internal int set_bt_prefix(BDB_PrefixCompareDelegate callback) {
390 		int ret;
391 		ret = libdb_csharpPINVOKE.DB_set_bt_prefix(swigCPtr, callback);
392 		DatabaseException.ThrowException(ret);
393 		return ret;
394 }
395 
get_cachesize(ref uint gbytes, ref uint bytes, ref int ncache)396   internal int get_cachesize(ref uint gbytes, ref uint bytes, ref int ncache) {
397 		int ret;
398 		ret = libdb_csharpPINVOKE.DB_get_cachesize(swigCPtr, ref gbytes, ref bytes, ref ncache);
399 		DatabaseException.ThrowException(ret);
400 		return ret;
401 }
402 
set_cachesize(uint gbytes, uint bytes, int ncache)403   internal int set_cachesize(uint gbytes, uint bytes, int ncache) {
404 		int ret;
405 		ret = libdb_csharpPINVOKE.DB_set_cachesize(swigCPtr, gbytes, bytes, ncache);
406 		DatabaseException.ThrowException(ret);
407 		return ret;
408 }
409 
set_dup_compare(BDB_CompareDelegate callback)410   internal int set_dup_compare(BDB_CompareDelegate callback) {
411 		int ret;
412 		ret = libdb_csharpPINVOKE.DB_set_dup_compare(swigCPtr, callback);
413 		DatabaseException.ThrowException(ret);
414 		return ret;
415 }
416 
get_encrypt_flags(ref uint flags)417   internal int get_encrypt_flags(ref uint flags) {
418 		int ret;
419 		ret = libdb_csharpPINVOKE.DB_get_encrypt_flags(swigCPtr, ref flags);
420 		DatabaseException.ThrowException(ret);
421 		return ret;
422 }
423 
set_encrypt(string pwd, uint flags)424   internal int set_encrypt(string pwd, uint flags) {
425 		int ret;
426 		ret = libdb_csharpPINVOKE.DB_set_encrypt(swigCPtr, pwd, flags);
427 		DatabaseException.ThrowException(ret);
428 		return ret;
429 }
430 
set_errcall(BDB_ErrcallDelegate db_errcall_fcn)431   internal void set_errcall(BDB_ErrcallDelegate db_errcall_fcn) {
432     libdb_csharpPINVOKE.DB_set_errcall(swigCPtr, db_errcall_fcn);
433   }
434 
get_ext_file_dir(out IntPtr dir)435   internal int get_ext_file_dir(out IntPtr dir) {
436 		int ret;
437 		ret = libdb_csharpPINVOKE.DB_get_ext_file_dir(swigCPtr, out dir);
438 		DatabaseException.ThrowException(ret);
439 		return ret;
440 }
441 
set_ext_file_dir(string dir)442   internal int set_ext_file_dir(string dir) {
443 		int ret;
444 		ret = libdb_csharpPINVOKE.DB_set_ext_file_dir(swigCPtr, dir);
445 		DatabaseException.ThrowException(ret);
446 		return ret;
447 }
448 
get_ext_file_threshold(ref uint bytes)449   internal int get_ext_file_threshold(ref uint bytes) {
450 		int ret;
451 		ret = libdb_csharpPINVOKE.DB_get_ext_file_threshold(swigCPtr, ref bytes);
452 		DatabaseException.ThrowException(ret);
453 		return ret;
454 }
455 
set_ext_file_threshold(uint bytes, uint flags)456   internal int set_ext_file_threshold(uint bytes, uint flags) {
457 		int ret;
458 		ret = libdb_csharpPINVOKE.DB_set_ext_file_threshold(swigCPtr, bytes, flags);
459 		DatabaseException.ThrowException(ret);
460 		return ret;
461 }
462 
set_feedback(BDB_DbFeedbackDelegate callback)463   internal int set_feedback(BDB_DbFeedbackDelegate callback) {
464 		int ret;
465 		ret = libdb_csharpPINVOKE.DB_set_feedback(swigCPtr, callback);
466 		DatabaseException.ThrowException(ret);
467 		return ret;
468 }
469 
get_flags(ref uint flags)470   internal int get_flags(ref uint flags) {
471 		int ret;
472 		ret = libdb_csharpPINVOKE.DB_get_flags(swigCPtr, ref flags);
473 		DatabaseException.ThrowException(ret);
474 		return ret;
475 }
476 
set_flags(uint flags)477   internal int set_flags(uint flags) {
478 		int ret;
479 		ret = libdb_csharpPINVOKE.DB_set_flags(swigCPtr, flags);
480 		DatabaseException.ThrowException(ret);
481 		return ret;
482 }
483 
get_heapsize(ref uint gbytes, ref uint bytes)484   internal int get_heapsize(ref uint gbytes, ref uint bytes) {
485 		int ret;
486 		ret = libdb_csharpPINVOKE.DB_get_heapsize(swigCPtr, ref gbytes, ref bytes);
487 		DatabaseException.ThrowException(ret);
488 		return ret;
489 }
490 
set_heapsize(uint gbytes, uint bytes)491   internal int set_heapsize(uint gbytes, uint bytes) {
492 		int ret;
493 		ret = libdb_csharpPINVOKE.DB_set_heapsize(swigCPtr, gbytes, bytes);
494 		DatabaseException.ThrowException(ret);
495 		return ret;
496 }
497 
get_heap_regionsize(ref uint npages)498   internal int get_heap_regionsize(ref uint npages) {
499 		int ret;
500 		ret = libdb_csharpPINVOKE.DB_get_heap_regionsize(swigCPtr, ref npages);
501 		DatabaseException.ThrowException(ret);
502 		return ret;
503 }
504 
set_heap_regionsize(uint npages)505   internal int set_heap_regionsize(uint npages) {
506 		int ret;
507 		ret = libdb_csharpPINVOKE.DB_set_heap_regionsize(swigCPtr, npages);
508 		DatabaseException.ThrowException(ret);
509 		return ret;
510 }
511 
set_h_compare(BDB_CompareDelegate callback)512   internal int set_h_compare(BDB_CompareDelegate callback) {
513 		int ret;
514 		ret = libdb_csharpPINVOKE.DB_set_h_compare(swigCPtr, callback);
515 		DatabaseException.ThrowException(ret);
516 		return ret;
517 }
518 
get_h_ffactor(ref uint ffactor)519   internal int get_h_ffactor(ref uint ffactor) {
520 		int ret;
521 		ret = libdb_csharpPINVOKE.DB_get_h_ffactor(swigCPtr, ref ffactor);
522 		DatabaseException.ThrowException(ret);
523 		return ret;
524 }
525 
set_h_ffactor(uint ffactor)526   internal int set_h_ffactor(uint ffactor) {
527 		int ret;
528 		ret = libdb_csharpPINVOKE.DB_set_h_ffactor(swigCPtr, ffactor);
529 		DatabaseException.ThrowException(ret);
530 		return ret;
531 }
532 
set_h_hash(BDB_HashDelegate callback)533   internal int set_h_hash(BDB_HashDelegate callback) {
534 		int ret;
535 		ret = libdb_csharpPINVOKE.DB_set_h_hash(swigCPtr, callback);
536 		DatabaseException.ThrowException(ret);
537 		return ret;
538 }
539 
get_h_nelem(ref uint nelem)540   internal int get_h_nelem(ref uint nelem) {
541 		int ret;
542 		ret = libdb_csharpPINVOKE.DB_get_h_nelem(swigCPtr, ref nelem);
543 		DatabaseException.ThrowException(ret);
544 		return ret;
545 }
546 
set_h_nelem(uint nelem)547   internal int set_h_nelem(uint nelem) {
548 		int ret;
549 		ret = libdb_csharpPINVOKE.DB_set_h_nelem(swigCPtr, nelem);
550 		DatabaseException.ThrowException(ret);
551 		return ret;
552 }
553 
get_lk_exclusive(ref int onoff, ref int nowait)554   internal int get_lk_exclusive(ref int onoff, ref int nowait) {
555 		int ret;
556 		ret = libdb_csharpPINVOKE.DB_get_lk_exclusive(swigCPtr, ref onoff, ref nowait);
557 		DatabaseException.ThrowException(ret);
558 		return ret;
559 }
560 
set_lk_exclusive(int nowait)561   internal int set_lk_exclusive(int nowait) {
562 		int ret;
563 		ret = libdb_csharpPINVOKE.DB_set_lk_exclusive(swigCPtr, nowait);
564 		DatabaseException.ThrowException(ret);
565 		return ret;
566 }
567 
get_lorder(ref int lorder)568   internal int get_lorder(ref int lorder) {
569 		int ret;
570 		ret = libdb_csharpPINVOKE.DB_get_lorder(swigCPtr, ref lorder);
571 		DatabaseException.ThrowException(ret);
572 		return ret;
573 }
574 
set_lorder(int lorder)575   internal int set_lorder(int lorder) {
576 		int ret;
577 		ret = libdb_csharpPINVOKE.DB_set_lorder(swigCPtr, lorder);
578 		DatabaseException.ThrowException(ret);
579 		return ret;
580 }
581 
get_pagesize(ref uint pgsz)582   internal int get_pagesize(ref uint pgsz) {
583 		int ret;
584 		ret = libdb_csharpPINVOKE.DB_get_pagesize(swigCPtr, ref pgsz);
585 		DatabaseException.ThrowException(ret);
586 		return ret;
587 }
588 
set_pagesize(uint pgsz)589   internal int set_pagesize(uint pgsz) {
590 		int ret;
591 		ret = libdb_csharpPINVOKE.DB_set_pagesize(swigCPtr, pgsz);
592 		DatabaseException.ThrowException(ret);
593 		return ret;
594 }
595 
set_msgcall(BDB_MsgcallDelegate db_msgcall_fcn)596   internal void set_msgcall(BDB_MsgcallDelegate db_msgcall_fcn) {
597     libdb_csharpPINVOKE.DB_set_msgcall(swigCPtr, db_msgcall_fcn);
598   }
599 
set_msgfile(string msgfile)600   internal int set_msgfile(string msgfile) {
601 		int ret;
602 		ret = libdb_csharpPINVOKE.DB_set_msgfile(swigCPtr, msgfile);
603 		DatabaseException.ThrowException(ret);
604 		return ret;
605 }
606 
get_partition_keys(ref uint countp, ref uint sizep, ref int err)607   private DatabaseEntry[] get_partition_keys(ref uint countp, ref uint sizep, ref int err) {
608 	IntPtr cPtr = libdb_csharpPINVOKE.DB_get_partition_keys(swigCPtr, ref countp, ref sizep, ref err);
609 	if (cPtr == IntPtr.Zero)
610 		return null;
611 
612 	DatabaseEntry[] ret = new DatabaseEntry[countp - 1];
613 	IntPtr val;
614 	for (int i = 0; i < (countp - 1); i++) {
615 		val = new IntPtr((IntPtr.Size == 4 ? cPtr.ToInt32() : cPtr.ToInt64()) + i * sizep);
616 		ret[i] = DatabaseEntry.fromDBT(new DBT(val, false));
617 	}
618 	return ret;
619 }
620 
get_partition_parts(ref uint parts)621   internal int get_partition_parts(ref uint parts) {
622 		int ret;
623 		ret = libdb_csharpPINVOKE.DB_get_partition_parts(swigCPtr, ref parts);
624 		DatabaseException.ThrowException(ret);
625 		return ret;
626 }
627 
set_partition(uint parts, IntPtr[] keys, BDB_PartitionDelegate partition)628   internal int set_partition(uint parts, IntPtr[] keys, BDB_PartitionDelegate partition) {
629 		int ret;
630 		ret = libdb_csharpPINVOKE.DB_set_partition(swigCPtr, parts, keys, partition);
631 		DatabaseException.ThrowException(ret);
632 		return ret;
633 }
634 
get_priority(ref uint flags)635   internal int get_priority(ref uint flags) {
636 		int ret;
637 		ret = libdb_csharpPINVOKE.DB_get_priority(swigCPtr, ref flags);
638 		DatabaseException.ThrowException(ret);
639 		return ret;
640 }
641 
set_priority(uint flags)642   internal int set_priority(uint flags) {
643 		int ret;
644 		ret = libdb_csharpPINVOKE.DB_set_priority(swigCPtr, flags);
645 		DatabaseException.ThrowException(ret);
646 		return ret;
647 }
648 
get_q_extentsize(ref uint extentsz)649   internal int get_q_extentsize(ref uint extentsz) {
650 		int ret;
651 		ret = libdb_csharpPINVOKE.DB_get_q_extentsize(swigCPtr, ref extentsz);
652 		DatabaseException.ThrowException(ret);
653 		return ret;
654 }
655 
set_q_extentsize(uint extentsz)656   internal int set_q_extentsize(uint extentsz) {
657 		int ret;
658 		ret = libdb_csharpPINVOKE.DB_set_q_extentsize(swigCPtr, extentsz);
659 		DatabaseException.ThrowException(ret);
660 		return ret;
661 }
662 
get_re_delim(ref int delim)663   internal int get_re_delim(ref int delim) {
664 		int ret;
665 		ret = libdb_csharpPINVOKE.DB_get_re_delim(swigCPtr, ref delim);
666 		DatabaseException.ThrowException(ret);
667 		return ret;
668 }
669 
set_re_delim(int delim)670   internal int set_re_delim(int delim) {
671 		int ret;
672 		ret = libdb_csharpPINVOKE.DB_set_re_delim(swigCPtr, delim);
673 		DatabaseException.ThrowException(ret);
674 		return ret;
675 }
676 
get_re_len(ref uint len)677   internal int get_re_len(ref uint len) {
678 		int ret;
679 		ret = libdb_csharpPINVOKE.DB_get_re_len(swigCPtr, ref len);
680 		DatabaseException.ThrowException(ret);
681 		return ret;
682 }
683 
set_re_len(uint len)684   internal int set_re_len(uint len) {
685 		int ret;
686 		ret = libdb_csharpPINVOKE.DB_set_re_len(swigCPtr, len);
687 		DatabaseException.ThrowException(ret);
688 		return ret;
689 }
690 
get_re_pad(ref int pad)691   internal int get_re_pad(ref int pad) {
692 		int ret;
693 		ret = libdb_csharpPINVOKE.DB_get_re_pad(swigCPtr, ref pad);
694 		DatabaseException.ThrowException(ret);
695 		return ret;
696 }
697 
set_re_pad(int pad)698   internal int set_re_pad(int pad) {
699 		int ret;
700 		ret = libdb_csharpPINVOKE.DB_set_re_pad(swigCPtr, pad);
701 		DatabaseException.ThrowException(ret);
702 		return ret;
703 }
704 
get_re_source(out IntPtr source)705   internal int get_re_source(out IntPtr source) {
706 		int ret;
707 		ret = libdb_csharpPINVOKE.DB_get_re_source(swigCPtr, out source);
708 		DatabaseException.ThrowException(ret);
709 		return ret;
710 }
711 
set_re_source(string source)712   internal int set_re_source(string source) {
713 		int ret;
714 		ret = libdb_csharpPINVOKE.DB_set_re_source(swigCPtr, source);
715 		DatabaseException.ThrowException(ret);
716 		return ret;
717 }
718 
stat(DB_TXN txnid, uint flags, ref int err)719   private IntPtr stat(DB_TXN txnid, uint flags, ref int err) {
720 	return libdb_csharpPINVOKE.DB_stat(swigCPtr, DB_TXN.getCPtr(txnid), flags, ref err);
721 }
722 
stat_print(uint flags)723   internal int stat_print(uint flags) {
724 		int ret;
725 		ret = libdb_csharpPINVOKE.DB_stat_print(swigCPtr, flags);
726 		DatabaseException.ThrowException(ret);
727 		return ret;
728 }
729 
sync(uint flags)730   internal int sync(uint flags) {
731 		int ret;
732 		ret = libdb_csharpPINVOKE.DB_sync(swigCPtr, flags);
733 		DatabaseException.ThrowException(ret);
734 		return ret;
735 }
736 
truncate(DB_TXN txn, ref uint countp, uint flags)737   internal int truncate(DB_TXN txn, ref uint countp, uint flags) {
738 		int ret;
739 		ret = libdb_csharpPINVOKE.DB_truncate(swigCPtr, DB_TXN.getCPtr(txn), ref countp, flags);
740 		DatabaseException.ThrowException(ret);
741 		return ret;
742 }
743 
upgrade(string file, uint flags)744   internal int upgrade(string file, uint flags) {
745 		int ret;
746 		ret = libdb_csharpPINVOKE.DB_upgrade(swigCPtr, file, flags);
747 		DatabaseException.ThrowException(ret);
748 		return ret;
749 }
750 
verify(string file, string database, System.IO.TextWriter handle, BDB_FileWriteDelegate callback, uint flags)751   internal int verify(string file, string database, System.IO.TextWriter handle, BDB_FileWriteDelegate callback, uint flags) {
752 		int ret;
753 		ret = libdb_csharpPINVOKE.DB_verify(swigCPtr, file, database, handle, callback, flags);
754 		/* Verify is a db handle destructor.  Reflect that in the wrapper class. */
755 		swigCMemOwn = false;
756 		swigCPtr = new HandleRef(null, IntPtr.Zero);
757 		DatabaseException.ThrowException(ret);
758 		return ret;
759 }
760 
761 }
762 
763 }
764