1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
|
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 2.0.4
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
namespace BerkeleyDB.Internal {
using System;
using System.Runtime.InteropServices;
using System.Collections.Generic;
internal class DB_ENV : IDisposable {
private HandleRef swigCPtr;
protected bool swigCMemOwn;
internal DB_ENV(IntPtr cPtr, bool cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = new HandleRef(this, cPtr);
}
internal static HandleRef getCPtr(DB_ENV obj) {
return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
}
public virtual void Dispose() {
lock(this) {
if(swigCPtr.Handle != IntPtr.Zero && swigCMemOwn) {
swigCMemOwn = false;
}
swigCPtr = new HandleRef(null, IntPtr.Zero);
GC.SuppressFinalize(this);
}
}
internal DB_TXN cdsgroup_begin() {
int err = 0;
DB_TXN ret = cdsgroup_begin(ref err);
DatabaseException.ThrowException(err);
return ret;
}
internal List<string> get_data_dirs() {
int err = 0;
int cnt = 0;
List<string> ret = get_data_dirs(ref err, ref cnt);
DatabaseException.ThrowException(err);
return ret;
}
internal DB_LOCK lock_get(uint locker, uint flags, DatabaseEntry arg2, db_lockmode_t mode) {
int err = 0;
DB_LOCK ret = lock_get(locker, flags, arg2, mode, ref err);
DatabaseException.ThrowException(err);
return ret;
}
internal LockStatStruct lock_stat(uint flags) {
int err = 0;
IntPtr ptr = lock_stat(flags, ref err);
DatabaseException.ThrowException(err);
LockStatStruct ret = (LockStatStruct)Marshal.PtrToStructure(ptr, typeof(LockStatStruct));
libdb_csharp.__os_ufree(null, ptr);
return ret;
}
internal List<string> log_archive(uint flags) {
int err = 0;
int cnt = 0;
List<string> ret = log_archive(flags, ref err, ref cnt);
DatabaseException.ThrowException(err);
return ret;
}
internal string log_file(DB_LSN dblsn) {
int err = 0;
int len = 100;
IntPtr namep;
while (true) {
namep = Marshal.AllocHGlobal(len);
err = log_file(dblsn, namep, (uint)len);
if (err != DbConstants.DB_BUFFER_SMALL)
break;
Marshal.FreeHGlobal(namep);
len *= 2;
}
DatabaseException.ThrowException(err);
string ret = Marshal.PtrToStringAnsi(namep);
Marshal.FreeHGlobal(namep);
return ret;
}
internal LogStatStruct log_stat(uint flags) {
int err = 0;
IntPtr ptr = log_stat(flags, ref err);
DatabaseException.ThrowException(err);
LogStatStruct ret = (LogStatStruct)Marshal.PtrToStructure(ptr, typeof(LogStatStruct));
libdb_csharp.__os_ufree(null, ptr);
return ret;
}
internal MempStatStruct memp_stat(uint flags) {
int err = 0;
int cnt = 0;
IntPtr mpf = new IntPtr();
IntPtr ptr = memp_stat(ref mpf, flags, ref err, ref cnt);
DatabaseException.ThrowException(err);
IntPtr[] files = new IntPtr[cnt];
if (cnt > 0)
Marshal.Copy(mpf, files, 0, cnt);
MempStatStruct ret = new MempStatStruct();
ret.st = (MPoolStatStruct)Marshal.PtrToStructure(ptr, typeof(MPoolStatStruct));
ret.files = new MPoolFileStatStruct[cnt];
for (int i = 0; i < cnt; i++)
ret.files[i] = (MPoolFileStatStruct)Marshal.PtrToStructure(files[i], typeof(MPoolFileStatStruct));
libdb_csharp.__os_ufree(null, ptr);
libdb_csharp.__os_ufree(null, mpf);
return ret;
}
internal MutexStatStruct mutex_stat(uint flags) {
int err = 0;
IntPtr ptr = mutex_stat(flags, ref err);
DatabaseException.ThrowException(err);
MutexStatStruct ret = (MutexStatStruct)Marshal.PtrToStructure(ptr, typeof(MutexStatStruct));
libdb_csharp.__os_ufree(null, ptr);
return ret;
}
internal DB_CHANNEL repmgr_channel(int eid, uint flags) {
int err = 0;
DB_CHANNEL ret = repmgr_channel(eid, flags, ref err);
DatabaseException.ThrowException(err);
return ret;
}
internal DB_SITE repmgr_local_site() {
int err = 0;
DB_SITE ret = repmgr_local_site(ref err);
DatabaseException.ThrowException(err);
return ret;
}
internal DB_SITE repmgr_site(string host, uint port) {
int err = 0;
DB_SITE ret = repmgr_site(host, port, ref err);
DatabaseException.ThrowException(err);
return ret;
}
internal DB_SITE repmgr_site_by_eid(int eid) {
int err = 0;
DB_SITE ret = repmgr_site_by_eid(eid, ref err);
DatabaseException.ThrowException(err);
return ret;
}
internal RepMgrSite[] repmgr_site_list() {
uint count = 0;
int err = 0;
uint size = 0;
RepMgrSite[] ret = repmgr_site_list(ref count, ref size, ref err);
DatabaseException.ThrowException(err);
return ret;
}
internal RepMgrStatStruct repmgr_stat(uint flags) {
int err = 0;
IntPtr ptr = repmgr_stat(flags, ref err);
DatabaseException.ThrowException(err);
RepMgrStatStruct ret = (RepMgrStatStruct)Marshal.PtrToStructure(ptr, typeof(RepMgrStatStruct));
libdb_csharp.__os_ufree(null, ptr);
return ret;
}
internal ReplicationStatStruct rep_stat(uint flags) {
int err = 0;
IntPtr ptr = rep_stat(flags, ref err);
DatabaseException.ThrowException(err);
ReplicationStatStruct ret = (ReplicationStatStruct)Marshal.PtrToStructure(ptr, typeof(ReplicationStatStruct));
libdb_csharp.__os_ufree(null, ptr);
return ret;
}
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;
}
internal PreparedTransaction[] txn_recover(int count, uint flags) {
int err = 0;
IntPtr prepp = Marshal.AllocHGlobal((int)(count * (IntPtr.Size + DbConstants.DB_GID_SIZE)));
long sz = 0;
err = txn_recover(prepp, count, ref sz, flags);
DatabaseException.ThrowException(err);
PreparedTransaction[] ret = new PreparedTransaction[sz];
for (long i = 0; i < sz; i++) {
IntPtr cPtr = new IntPtr((IntPtr.Size == 4 ? prepp.ToInt32() : prepp.ToInt64()) + i * (IntPtr.Size + DbConstants.DB_GID_SIZE));
DB_PREPLIST prep = new DB_PREPLIST(cPtr, false);
ret[i] = new PreparedTransaction(prep);
}
Marshal.FreeHGlobal(prepp);
return ret;
}
internal TxnStatStruct txn_stat(uint flags) {
int err = 0;
uint size = 0;
int offset = Marshal.SizeOf(typeof(DB_TXN_ACTIVE));
IntPtr ptr = txn_stat(flags, ref size, ref err);
DatabaseException.ThrowException(err);
TxnStatStruct ret = new TxnStatStruct();
ret.st = (TransactionStatStruct)Marshal.PtrToStructure(ptr, typeof(TransactionStatStruct));
ret.st_txnarray = new DB_TXN_ACTIVE[ret.st.st_nactive];
ret.st_txngids = new byte[ret.st.st_nactive][];
ret.st_txnnames = new string[ret.st.st_nactive];
for (int i = 0; i < ret.st.st_nactive; i++) {
IntPtr activep = new IntPtr((IntPtr.Size == 4 ? ret.st.st_txnarray.ToInt32() : ret.st.st_txnarray.ToInt64()) + i * size);
ret.st_txnarray[i] = (DB_TXN_ACTIVE)Marshal.PtrToStructure(activep, typeof(DB_TXN_ACTIVE));
ret.st_txngids[i] = new byte[DbConstants.DB_GID_SIZE];
IntPtr gidp = new IntPtr((IntPtr.Size == 4 ? activep.ToInt32() : activep.ToInt64()) + offset);
Marshal.Copy(gidp, ret.st_txngids[i], 0, (int)DbConstants.DB_GID_SIZE);
IntPtr namep = new IntPtr((IntPtr.Size == 4 ? gidp.ToInt32() : gidp.ToInt64()) + DbConstants.DB_GID_SIZE);
ret.st_txnnames[i] = Marshal.PtrToStringAnsi(namep);
}
libdb_csharp.__os_ufree(null, ptr);
return ret;
}
internal int get_home(out string file) {
int ret;
IntPtr fp;
ret = get_home(out fp);
file = Marshal.PtrToStringAnsi(fp);
return ret;
}
internal int get_intermediate_dir_mode(out string mode) {
int ret;
IntPtr mp;
ret = get_intermediate_dir_mode(out mp);
mode = Marshal.PtrToStringAnsi(mp);
return ret;
}
internal int get_lg_dir(out string dir) {
int ret;
IntPtr dirp;
ret = get_lg_dir(out dirp);
dir = Marshal.PtrToStringAnsi(dirp);
return ret;
}
internal int get_metadata_dir(out string dir) {
int ret;
IntPtr dirp;
ret = get_metadata_dir(out dirp);
dir = Marshal.PtrToStringAnsi(dirp);
return ret;
}
internal int get_tmp_dir(out string dir) {
int ret;
IntPtr dirp;
ret = get_tmp_dir(out dirp);
dir = Marshal.PtrToStringAnsi(dirp);
return ret;
}
internal DatabaseEnvironment api2_internal {
set {
libdb_csharpPINVOKE.DB_ENV_api2_internal_set(swigCPtr, value);
}
get { return libdb_csharpPINVOKE.DB_ENV_api2_internal_get(swigCPtr); }
}
internal int set_usercopy(DBTCopyDelegate dbt_usercopy) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_set_usercopy(swigCPtr, dbt_usercopy);
DatabaseException.ThrowException(ret);
return ret;
}
internal DB_ENV(uint flags) : this(libdb_csharpPINVOKE.new_DB_ENV(flags), true) {
}
internal int backup(string target, uint flags) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_backup(swigCPtr, target, flags);
DatabaseException.ThrowException(ret);
return ret;
}
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;
}
internal int close(uint flags) {
int ret = libdb_csharpPINVOKE.DB_ENV_close(swigCPtr, flags);
if (ret == 0)
/* Close is a db handle destructor. Reflect that in the wrapper class. */
swigCPtr = new HandleRef(null, IntPtr.Zero);
else
DatabaseException.ThrowException(ret);
return ret;
}
internal int dbbackup(string dbfile, string target, uint flags) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_dbbackup(swigCPtr, dbfile, target, flags);
DatabaseException.ThrowException(ret);
return ret;
}
internal int dbremove(DB_TXN txn, string file, string database, uint flags) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_dbremove(swigCPtr, DB_TXN.getCPtr(txn), file, database, flags);
DatabaseException.ThrowException(ret);
return ret;
}
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;
}
internal int failchk(uint flags) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_failchk(swigCPtr, flags);
DatabaseException.ThrowException(ret);
return ret;
}
internal int fileid_reset(string file, uint flags) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_fileid_reset(swigCPtr, file, flags);
DatabaseException.ThrowException(ret);
return ret;
}
internal int get_home(out IntPtr file) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_get_home(swigCPtr, out file);
DatabaseException.ThrowException(ret);
return ret;
}
internal int is_transaction_applied(DB_TXN_TOKEN token, uint timeout, uint flags) {
return libdb_csharpPINVOKE.DB_ENV_is_transaction_applied(swigCPtr, DB_TXN_TOKEN.getCPtr(token), timeout, flags);
}
internal int lock_detect(uint flags, uint atype, ref uint rejected) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_lock_detect(swigCPtr, flags, atype, ref rejected);
DatabaseException.ThrowException(ret);
return ret;
}
private DB_LOCK lock_get(uint locker, uint flags, DatabaseEntry arg2, db_lockmode_t mode, ref int err) {
try {
DB_LOCK ret = new DB_LOCK(libdb_csharpPINVOKE.DB_ENV_lock_get(swigCPtr, locker, flags, DBT.getCPtr(DatabaseEntry.getDBT(arg2)), (int)mode, ref err), true);
return ret;
} finally {
GC.KeepAlive(arg2);
}
}
internal int lock_id(ref uint id) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_lock_id(swigCPtr, ref id);
DatabaseException.ThrowException(ret);
return ret;
}
internal int lock_id_free(uint id) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_lock_id_free(swigCPtr, id);
DatabaseException.ThrowException(ret);
return ret;
}
internal int lock_put(DB_LOCK lck) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_lock_put(swigCPtr, DB_LOCK.getCPtr(lck));
DatabaseException.ThrowException(ret);
return ret;
}
private IntPtr lock_stat(uint flags, ref int err) {
return libdb_csharpPINVOKE.DB_ENV_lock_stat(swigCPtr, flags, ref err);
}
internal int lock_stat_print(uint flags) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_lock_stat_print(swigCPtr, flags);
DatabaseException.ThrowException(ret);
return ret;
}
internal int lock_vec(uint locker, uint flags, IntPtr[] list, int nlist, DB_LOCKREQ elistp) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_lock_vec(swigCPtr, locker, flags, list, nlist, DB_LOCKREQ.getCPtr(elistp));
DatabaseException.ThrowException(ret);
return ret;
}
internal List<string> log_archive(uint flags, ref int err, ref int cntp) {
IntPtr cPtr = libdb_csharpPINVOKE.DB_ENV_log_archive(swigCPtr, flags, ref err, ref cntp);
List<string> ret = new List<string>();
if (cPtr == IntPtr.Zero)
return ret;
IntPtr[] strs = new IntPtr[cntp];
Marshal.Copy(cPtr, strs, 0, cntp);
for (int i =0; i < cntp; i++)
ret.Add(Marshal.PtrToStringAnsi(strs[i]));
libdb_csharp.__os_ufree(this, cPtr);
return ret;
}
private int log_file(DB_LSN lsn, IntPtr namep, uint len) {
return libdb_csharpPINVOKE.DB_ENV_log_file(swigCPtr, DB_LSN.getCPtr(lsn), namep, len);
}
internal int log_flush(DB_LSN lsn) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_log_flush(swigCPtr, DB_LSN.getCPtr(lsn));
DatabaseException.ThrowException(ret);
return ret;
}
internal int log_put(DB_LSN lsn, DatabaseEntry data, uint flags) {
try {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_log_put(swigCPtr, DB_LSN.getCPtr(lsn), DBT.getCPtr(DatabaseEntry.getDBT(data)), flags);
DatabaseException.ThrowException(ret);
return ret;
} finally {
GC.KeepAlive(data);
}
}
internal int log_get_config(uint which, ref int onoff) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_log_get_config(swigCPtr, which, ref onoff);
DatabaseException.ThrowException(ret);
return ret;
}
internal int log_set_config(uint which, int onoff) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_log_set_config(swigCPtr, which, onoff);
DatabaseException.ThrowException(ret);
return ret;
}
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;
}
private IntPtr log_stat(uint flags, ref int err) {
return libdb_csharpPINVOKE.DB_ENV_log_stat(swigCPtr, flags, ref err);
}
internal int log_stat_print(uint flags) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_log_stat_print(swigCPtr, flags);
DatabaseException.ThrowException(ret);
return ret;
}
internal int lsn_reset(string file, uint flags) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_lsn_reset(swigCPtr, file, flags);
DatabaseException.ThrowException(ret);
return ret;
}
private IntPtr memp_stat(ref IntPtr fstatp, uint flags, ref int err, ref int cntp) {
return libdb_csharpPINVOKE.DB_ENV_memp_stat(swigCPtr, ref fstatp, flags, ref err, ref cntp);
}
internal int memp_stat_print(uint flags) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_memp_stat_print(swigCPtr, flags);
DatabaseException.ThrowException(ret);
return ret;
}
internal int memp_sync(DB_LSN lsn) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_memp_sync(swigCPtr, DB_LSN.getCPtr(lsn));
DatabaseException.ThrowException(ret);
return ret;
}
internal int memp_trickle(int percent, ref int nwrotep) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_memp_trickle(swigCPtr, percent, ref nwrotep);
DatabaseException.ThrowException(ret);
return ret;
}
internal int mutex_alloc(uint flags, ref uint mutexp) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_mutex_alloc(swigCPtr, flags, ref mutexp);
DatabaseException.ThrowException(ret);
return ret;
}
internal int mutex_free(uint mutex) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_mutex_free(swigCPtr, mutex);
DatabaseException.ThrowException(ret);
return ret;
}
internal int mutex_lock(uint mutex) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_mutex_lock(swigCPtr, mutex);
DatabaseException.ThrowException(ret);
return ret;
}
private IntPtr mutex_stat(uint flags, ref int err) {
return libdb_csharpPINVOKE.DB_ENV_mutex_stat(swigCPtr, flags, ref err);
}
internal int mutex_stat_print(uint flags) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_mutex_stat_print(swigCPtr, flags);
DatabaseException.ThrowException(ret);
return ret;
}
internal int mutex_unlock(uint mutex) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_mutex_unlock(swigCPtr, mutex);
DatabaseException.ThrowException(ret);
return ret;
}
internal int mutex_get_align(ref uint align) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_mutex_get_align(swigCPtr, ref align);
DatabaseException.ThrowException(ret);
return ret;
}
internal int mutex_set_align(uint align) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_mutex_set_align(swigCPtr, align);
DatabaseException.ThrowException(ret);
return ret;
}
internal int mutex_get_increment(ref uint increment) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_mutex_get_increment(swigCPtr, ref increment);
DatabaseException.ThrowException(ret);
return ret;
}
internal int mutex_set_increment(uint increment) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_mutex_set_increment(swigCPtr, increment);
DatabaseException.ThrowException(ret);
return ret;
}
internal int mutex_get_init(ref uint init) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_mutex_get_init(swigCPtr, ref init);
DatabaseException.ThrowException(ret);
return ret;
}
internal int mutex_set_init(uint init) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_mutex_set_init(swigCPtr, init);
DatabaseException.ThrowException(ret);
return ret;
}
internal int mutex_get_max(ref uint max) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_mutex_get_max(swigCPtr, ref max);
DatabaseException.ThrowException(ret);
return ret;
}
internal int mutex_set_max(uint max) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_mutex_set_max(swigCPtr, max);
DatabaseException.ThrowException(ret);
return ret;
}
internal int mutex_get_tas_spins(ref uint tas_spins) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_mutex_get_tas_spins(swigCPtr, ref tas_spins);
DatabaseException.ThrowException(ret);
return ret;
}
internal int mutex_set_tas_spins(uint tas_spins) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_mutex_set_tas_spins(swigCPtr, tas_spins);
DatabaseException.ThrowException(ret);
return ret;
}
internal int open(string home, uint flags, int mode) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_open(swigCPtr, home, flags, mode);
if (ret != 0)
close(0);
DatabaseException.ThrowException(ret);
return ret;
}
internal int get_open_flags(ref uint flags) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_get_open_flags(swigCPtr, ref flags);
DatabaseException.ThrowException(ret);
return ret;
}
internal int remove(string db_home, uint flags) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_remove(swigCPtr, db_home, 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;
}
internal int repmgr_set_ack_policy(int ack_policy) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_repmgr_set_ack_policy(swigCPtr, ack_policy);
DatabaseException.ThrowException(ret);
return ret;
}
internal int repmgr_get_ack_policy(ref int ack_policy) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_repmgr_get_ack_policy(swigCPtr, ref ack_policy);
DatabaseException.ThrowException(ret);
return ret;
}
internal DB_CHANNEL repmgr_channel(int eid, uint flags, ref int err) {
IntPtr cPtr = libdb_csharpPINVOKE.DB_ENV_repmgr_channel(swigCPtr, eid, flags, ref err);
DB_CHANNEL ret = (cPtr == IntPtr.Zero) ? null : new DB_CHANNEL(cPtr, false);
return ret;
}
internal DB_SITE repmgr_local_site(ref int err) {
IntPtr cPtr = libdb_csharpPINVOKE.DB_ENV_repmgr_local_site(swigCPtr, ref err);
DB_SITE ret = (cPtr == IntPtr.Zero) ? null : new DB_SITE(cPtr, false);
return ret;
}
internal int repmgr_msg_dispatch(BDB_MessageDispatchDelegate dispatch, uint flags) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_repmgr_msg_dispatch(swigCPtr, dispatch, flags);
DatabaseException.ThrowException(ret);
return ret;
}
internal DB_SITE repmgr_site(string host, uint port, ref int err) {
IntPtr cPtr = libdb_csharpPINVOKE.DB_ENV_repmgr_site(swigCPtr, host, port, ref err);
DB_SITE ret = (cPtr == IntPtr.Zero) ? null : new DB_SITE(cPtr, false);
return ret;
}
internal DB_SITE repmgr_site_by_eid(int eid, ref int err) {
IntPtr cPtr = libdb_csharpPINVOKE.DB_ENV_repmgr_site_by_eid(swigCPtr, eid, ref err);
DB_SITE ret = (cPtr == IntPtr.Zero) ? null : new DB_SITE(cPtr, false);
return ret;
}
private RepMgrSite[] repmgr_site_list(ref uint countp, ref uint sizep, ref int err) {
IntPtr cPtr = libdb_csharpPINVOKE.DB_ENV_repmgr_site_list(swigCPtr, ref countp, ref sizep, ref err);
if (cPtr == IntPtr.Zero)
return null;
/*
* This is a big kludgy, but we need to free the memory that
* repmgr_site_list mallocs. The RepMgrSite constructors will copy all
* the data out of that malloc'd area and we can free it right away.
* This is easier than trying to construct a SWIG generated object that
* will copy everything in it's constructor, because SWIG generated
* classes come with a lot of baggage.
*/
RepMgrSite[] ret = new RepMgrSite[countp];
for (int i = 0; i < countp; i++) {
/*
* We're copying data out of an array of countp DB_REPMGR_SITE
* structures, whose size varies between 32- and 64-bit
* platforms.
*/
IntPtr val = new IntPtr((IntPtr.Size == 4 ? cPtr.ToInt32() : cPtr.ToInt64()) + i * sizep);
ret[i] = new RepMgrSite(new DB_REPMGR_SITE(val, false));
}
libdb_csharp.__os_ufree(this, cPtr);
return ret;
}
internal int repmgr_start(int nthreads, uint flags) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_repmgr_start(swigCPtr, nthreads, flags);
DatabaseException.ThrowException(ret);
return ret;
}
private IntPtr repmgr_stat(uint flags, ref int err) {
return libdb_csharpPINVOKE.DB_ENV_repmgr_stat(swigCPtr, flags, ref err);
}
internal int repmgr_stat_print(uint flags) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_repmgr_stat_print(swigCPtr, flags);
DatabaseException.ThrowException(ret);
return ret;
}
internal int rep_elect(uint nsites, uint nvotes, uint flags) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_rep_elect(swigCPtr, nsites, nvotes, flags);
DatabaseException.ThrowException(ret);
return ret;
}
internal int rep_process_message(DatabaseEntry control, DatabaseEntry rec, int envid, DB_LSN ret_lsnp) {
try {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_rep_process_message(swigCPtr, DBT.getCPtr(DatabaseEntry.getDBT(control)), DBT.getCPtr(DatabaseEntry.getDBT(rec)), envid, DB_LSN.getCPtr(ret_lsnp));
DatabaseException.ThrowException(ret);
return ret;
} finally {
GC.KeepAlive(control);
GC.KeepAlive(rec);
}
}
internal int rep_start(DatabaseEntry cdata, uint flags) {
try {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_rep_start(swigCPtr, DBT.getCPtr(DatabaseEntry.getDBT(cdata)), flags);
DatabaseException.ThrowException(ret);
return ret;
} finally {
GC.KeepAlive(cdata);
}
}
private IntPtr rep_stat(uint flags, ref int err) {
return libdb_csharpPINVOKE.DB_ENV_rep_stat(swigCPtr, flags, ref err);
}
internal int rep_stat_print(uint flags) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_rep_stat_print(swigCPtr, flags);
DatabaseException.ThrowException(ret);
return ret;
}
internal int rep_sync(uint flags) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_rep_sync(swigCPtr, flags);
DatabaseException.ThrowException(ret);
return ret;
}
internal int rep_set_config(uint which, int onoff) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_rep_set_config(swigCPtr, which, onoff);
DatabaseException.ThrowException(ret);
return ret;
}
internal int rep_get_config(uint which, ref int onoffp) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_rep_get_config(swigCPtr, which, ref onoffp);
DatabaseException.ThrowException(ret);
return ret;
}
internal int rep_set_clockskew(uint fast_clock, uint slow_clock) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_rep_set_clockskew(swigCPtr, fast_clock, slow_clock);
DatabaseException.ThrowException(ret);
return ret;
}
internal int rep_get_clockskew(ref uint fast_clockp, ref uint slow_clockp) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_rep_get_clockskew(swigCPtr, ref fast_clockp, ref slow_clockp);
DatabaseException.ThrowException(ret);
return ret;
}
internal int rep_set_limit(uint gbytes, uint bytes) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_rep_set_limit(swigCPtr, gbytes, bytes);
DatabaseException.ThrowException(ret);
return ret;
}
internal int rep_get_limit(ref uint gbytesp, ref uint bytesp) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_rep_get_limit(swigCPtr, ref gbytesp, ref bytesp);
DatabaseException.ThrowException(ret);
return ret;
}
internal int rep_set_nsites(uint nsites) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_rep_set_nsites(swigCPtr, nsites);
DatabaseException.ThrowException(ret);
return ret;
}
internal int rep_get_nsites(ref uint nsitesp) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_rep_get_nsites(swigCPtr, ref nsitesp);
DatabaseException.ThrowException(ret);
return ret;
}
internal int rep_set_priority(uint priority) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_rep_set_priority(swigCPtr, priority);
DatabaseException.ThrowException(ret);
return ret;
}
internal int rep_get_priority(ref uint priorityp) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_rep_get_priority(swigCPtr, ref priorityp);
DatabaseException.ThrowException(ret);
return ret;
}
internal int rep_set_request(uint min, uint max) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_rep_set_request(swigCPtr, min, max);
DatabaseException.ThrowException(ret);
return ret;
}
internal int rep_get_request(ref uint minp, ref uint maxp) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_rep_get_request(swigCPtr, ref minp, ref maxp);
DatabaseException.ThrowException(ret);
return ret;
}
internal int rep_set_timeout(int which, uint timeout) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_rep_set_timeout(swigCPtr, which, timeout);
DatabaseException.ThrowException(ret);
return ret;
}
internal int rep_get_timeout(int which, ref uint timeoutp) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_rep_get_timeout(swigCPtr, which, ref timeoutp);
DatabaseException.ThrowException(ret);
return ret;
}
internal int rep_set_transport(int envid, BDB_RepTransportDelegate send) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_rep_set_transport(swigCPtr, envid, send);
DatabaseException.ThrowException(ret);
return ret;
}
internal int set_backup_callbacks(BDB_BackupOpenDelegate open_func, BDB_BackupWriteDelegate write_func, BDB_BackupCloseDelegate close_func) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_set_backup_callbacks(swigCPtr, open_func, write_func, close_func);
DatabaseException.ThrowException(ret);
return ret;
}
internal int get_backup_config(uint cfg, ref uint value) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_get_backup_config(swigCPtr, cfg, ref value);
DatabaseException.ThrowException(ret);
return ret;
}
internal int set_backup_config(uint cfg, uint value) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_set_backup_config(swigCPtr, cfg, value);
DatabaseException.ThrowException(ret);
return ret;
}
internal int get_cachesize(ref uint gbytes, ref uint bytes, ref int ncache) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_get_cachesize(swigCPtr, ref gbytes, ref bytes, ref ncache);
DatabaseException.ThrowException(ret);
return ret;
}
internal int set_cachesize(uint gbytes, uint bytes, int ncache) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_set_cachesize(swigCPtr, gbytes, bytes, ncache);
DatabaseException.ThrowException(ret);
return ret;
}
internal int get_cache_max(ref uint gbytes, ref uint bytes) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_get_cache_max(swigCPtr, ref gbytes, ref bytes);
DatabaseException.ThrowException(ret);
return ret;
}
internal int set_cache_max(uint gbytes, uint bytes) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_set_cache_max(swigCPtr, gbytes, bytes);
DatabaseException.ThrowException(ret);
return ret;
}
private List<string> get_data_dirs(ref int err, ref int cntp) {
IntPtr cPtr = libdb_csharpPINVOKE.DB_ENV_get_data_dirs(swigCPtr, ref err, ref cntp);
List<string> ret = new List<string>();
if (cPtr == IntPtr.Zero)
return ret;
IntPtr[] strs = new IntPtr[cntp];
Marshal.Copy(cPtr, strs, 0, cntp);
for (int i =0; i < cntp; i++)
ret.Add(Marshal.PtrToStringAnsi(strs[i]));
return ret;
}
internal int add_data_dir(string dir) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_add_data_dir(swigCPtr, dir);
DatabaseException.ThrowException(ret);
return ret;
}
internal int set_create_dir(string dir) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_set_create_dir(swigCPtr, dir);
DatabaseException.ThrowException(ret);
return ret;
}
internal int get_encrypt_flags(ref uint flags) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_get_encrypt_flags(swigCPtr, ref flags);
DatabaseException.ThrowException(ret);
return ret;
}
internal int set_encrypt(string passwd, uint flags) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_set_encrypt(swigCPtr, passwd, flags);
DatabaseException.ThrowException(ret);
return ret;
}
internal void set_errcall(BDB_ErrcallDelegate db_errcall_fcn) {
libdb_csharpPINVOKE.DB_ENV_set_errcall(swigCPtr, db_errcall_fcn);
}
internal int set_event_notify(BDB_EventNotifyDelegate callback) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_set_event_notify(swigCPtr, callback);
DatabaseException.ThrowException(ret);
return ret;
}
internal int set_feedback(BDB_EnvFeedbackDelegate callback) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_set_feedback(swigCPtr, callback);
DatabaseException.ThrowException(ret);
return ret;
}
internal int get_flags(ref uint flags) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_get_flags(swigCPtr, ref flags);
DatabaseException.ThrowException(ret);
return ret;
}
internal int set_flags(uint flags, int onoff) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_set_flags(swigCPtr, flags, onoff);
DatabaseException.ThrowException(ret);
return ret;
}
internal int get_intermediate_dir_mode(out IntPtr mode) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_get_intermediate_dir_mode(swigCPtr, out mode);
DatabaseException.ThrowException(ret);
return ret;
}
internal int set_intermediate_dir_mode(string mode) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_set_intermediate_dir_mode(swigCPtr, mode);
DatabaseException.ThrowException(ret);
return ret;
}
internal int set_isalive(BDB_IsAliveDelegate callback) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_set_isalive(swigCPtr, callback);
DatabaseException.ThrowException(ret);
return ret;
}
internal int get_lg_bsize(ref uint bsize) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_get_lg_bsize(swigCPtr, ref bsize);
DatabaseException.ThrowException(ret);
return ret;
}
internal int set_lg_bsize(uint bsize) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_set_lg_bsize(swigCPtr, bsize);
DatabaseException.ThrowException(ret);
return ret;
}
internal int get_lg_dir(out IntPtr dir) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_get_lg_dir(swigCPtr, out dir);
DatabaseException.ThrowException(ret);
return ret;
}
internal int set_lg_dir(string dir) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_set_lg_dir(swigCPtr, dir);
DatabaseException.ThrowException(ret);
return ret;
}
internal int get_lg_filemode(ref int mode) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_get_lg_filemode(swigCPtr, ref mode);
DatabaseException.ThrowException(ret);
return ret;
}
internal int set_lg_filemode(int mode) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_set_lg_filemode(swigCPtr, mode);
DatabaseException.ThrowException(ret);
return ret;
}
internal int get_lg_max(ref uint max) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_get_lg_max(swigCPtr, ref max);
DatabaseException.ThrowException(ret);
return ret;
}
internal int set_lg_max(uint max) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_set_lg_max(swigCPtr, max);
DatabaseException.ThrowException(ret);
return ret;
}
internal int get_lg_regionmax(ref uint max) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_get_lg_regionmax(swigCPtr, ref max);
DatabaseException.ThrowException(ret);
return ret;
}
internal int set_lg_regionmax(uint max) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_set_lg_regionmax(swigCPtr, max);
DatabaseException.ThrowException(ret);
return ret;
}
internal int log_verify(string envhome, uint cachesz, string dbfile, string dbname, long stime, long etime, uint stfile, uint stoffset, uint efile, uint eoffset, int caf, int verbose) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_log_verify(swigCPtr, envhome, cachesz, dbfile, dbname, stime, etime, stfile, stoffset, efile, eoffset, caf, verbose);
DatabaseException.ThrowException(ret);
return ret;
}
internal int get_lk_conflicts_nmodes(ref int nmodes) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_get_lk_conflicts_nmodes(swigCPtr, ref nmodes);
DatabaseException.ThrowException(ret);
return ret;
}
internal int get_lk_conflicts(byte[,] conflicts) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_get_lk_conflicts(swigCPtr, conflicts);
DatabaseException.ThrowException(ret);
return ret;
}
internal int set_lk_conflicts(byte[,] conflicts, int nmodes) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_set_lk_conflicts(swigCPtr, conflicts, nmodes);
DatabaseException.ThrowException(ret);
return ret;
}
internal int get_lk_detect(ref uint mode) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_get_lk_detect(swigCPtr, ref mode);
DatabaseException.ThrowException(ret);
return ret;
}
internal int set_lk_detect(uint mode) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_set_lk_detect(swigCPtr, mode);
DatabaseException.ThrowException(ret);
return ret;
}
internal int get_lk_max_locks(ref uint max) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_get_lk_max_locks(swigCPtr, ref max);
DatabaseException.ThrowException(ret);
return ret;
}
internal int set_lk_max_locks(uint max) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_set_lk_max_locks(swigCPtr, max);
DatabaseException.ThrowException(ret);
return ret;
}
internal int get_lk_max_lockers(ref uint max) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_get_lk_max_lockers(swigCPtr, ref max);
DatabaseException.ThrowException(ret);
return ret;
}
internal int set_lk_max_lockers(uint max) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_set_lk_max_lockers(swigCPtr, max);
DatabaseException.ThrowException(ret);
return ret;
}
internal int get_lk_max_objects(ref uint max) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_get_lk_max_objects(swigCPtr, ref max);
DatabaseException.ThrowException(ret);
return ret;
}
internal int set_lk_max_objects(uint max) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_set_lk_max_objects(swigCPtr, max);
DatabaseException.ThrowException(ret);
return ret;
}
internal int get_lk_partitions(ref uint max) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_get_lk_partitions(swigCPtr, ref max);
DatabaseException.ThrowException(ret);
return ret;
}
internal int set_lk_partitions(uint max) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_set_lk_partitions(swigCPtr, max);
DatabaseException.ThrowException(ret);
return ret;
}
internal int get_lk_tablesize(ref uint tablesize) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_get_lk_tablesize(swigCPtr, ref tablesize);
DatabaseException.ThrowException(ret);
return ret;
}
internal int set_lk_tablesize(uint tablesize) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_set_lk_tablesize(swigCPtr, tablesize);
DatabaseException.ThrowException(ret);
return ret;
}
internal int get_memory_init(uint type, ref uint count) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_get_memory_init(swigCPtr, type, ref count);
DatabaseException.ThrowException(ret);
return ret;
}
internal int set_memory_init(uint type, uint count) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_set_memory_init(swigCPtr, type, count);
DatabaseException.ThrowException(ret);
return ret;
}
internal int get_memory_max(ref uint gbytes, ref uint bytes) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_get_memory_max(swigCPtr, ref gbytes, ref bytes);
DatabaseException.ThrowException(ret);
return ret;
}
internal int set_memory_max(uint gbytes, uint bytes) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_set_memory_max(swigCPtr, gbytes, bytes);
DatabaseException.ThrowException(ret);
return ret;
}
internal int get_metadata_dir(out IntPtr dir) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_get_metadata_dir(swigCPtr, out dir);
DatabaseException.ThrowException(ret);
return ret;
}
internal int set_metadata_dir(string dir) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_set_metadata_dir(swigCPtr, dir);
DatabaseException.ThrowException(ret);
return ret;
}
internal int get_mp_max_openfd(ref int maxopenfd) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_get_mp_max_openfd(swigCPtr, ref maxopenfd);
DatabaseException.ThrowException(ret);
return ret;
}
internal int set_mp_max_openfd(int maxopenfd) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_set_mp_max_openfd(swigCPtr, maxopenfd);
DatabaseException.ThrowException(ret);
return ret;
}
internal int get_mp_max_write(ref int maxwrite, ref uint maxwrite_sleep) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_get_mp_max_write(swigCPtr, ref maxwrite, ref maxwrite_sleep);
DatabaseException.ThrowException(ret);
return ret;
}
internal int set_mp_max_write(int maxwrite, uint maxwrite_sleep) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_set_mp_max_write(swigCPtr, maxwrite, maxwrite_sleep);
DatabaseException.ThrowException(ret);
return ret;
}
internal int get_mp_mmapsize(ref uint mp_mmapsize) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_get_mp_mmapsize(swigCPtr, ref mp_mmapsize);
DatabaseException.ThrowException(ret);
return ret;
}
internal int set_mp_mmapsize(uint mp_mmapsize) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_set_mp_mmapsize(swigCPtr, mp_mmapsize);
DatabaseException.ThrowException(ret);
return ret;
}
internal int get_thread_count(ref uint count) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_get_thread_count(swigCPtr, ref count);
DatabaseException.ThrowException(ret);
return ret;
}
internal int set_thread_count(uint count) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_set_thread_count(swigCPtr, count);
DatabaseException.ThrowException(ret);
return ret;
}
internal int set_thread_id(BDB_ThreadIDDelegate callback) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_set_thread_id(swigCPtr, callback);
DatabaseException.ThrowException(ret);
return ret;
}
internal int set_thread_id_string(BDB_ThreadNameDelegate callback) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_set_thread_id_string(swigCPtr, callback);
DatabaseException.ThrowException(ret);
return ret;
}
internal int get_timeout(ref uint timeout, uint flags) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_get_timeout(swigCPtr, ref timeout, flags);
DatabaseException.ThrowException(ret);
return ret;
}
internal int set_timeout(uint timeout, uint flags) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_set_timeout(swigCPtr, timeout, flags);
DatabaseException.ThrowException(ret);
return ret;
}
internal int get_tmp_dir(out IntPtr dir) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_get_tmp_dir(swigCPtr, out dir);
DatabaseException.ThrowException(ret);
return ret;
}
internal int set_tmp_dir(string dir) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_set_tmp_dir(swigCPtr, dir);
DatabaseException.ThrowException(ret);
return ret;
}
internal int get_tx_max(ref uint max) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_get_tx_max(swigCPtr, ref max);
DatabaseException.ThrowException(ret);
return ret;
}
internal int set_tx_max(uint max) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_set_tx_max(swigCPtr, max);
DatabaseException.ThrowException(ret);
return ret;
}
internal int get_tx_timestamp(ref long timestamp) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_get_tx_timestamp(swigCPtr, ref timestamp);
DatabaseException.ThrowException(ret);
return ret;
}
internal int set_tx_timestamp(ref long timestamp) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_set_tx_timestamp(swigCPtr, ref timestamp);
DatabaseException.ThrowException(ret);
return ret;
}
internal int get_verbose(ref uint msgs) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_get_verbose(swigCPtr, ref msgs);
DatabaseException.ThrowException(ret);
return ret;
}
internal int set_verbose(uint which, int onoff) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_set_verbose(swigCPtr, which, onoff);
DatabaseException.ThrowException(ret);
return ret;
}
internal int stat_print(uint flags) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_stat_print(swigCPtr, flags);
DatabaseException.ThrowException(ret);
return ret;
}
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;
}
internal int txn_checkpoint(uint kbyte, uint min, uint flags) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_txn_checkpoint(swigCPtr, kbyte, min, flags);
DatabaseException.ThrowException(ret);
return ret;
}
private int txn_recover(IntPtr preplist, int count, ref long retp, uint flags) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_txn_recover(swigCPtr, preplist, count, ref retp, flags);
DatabaseException.ThrowException(ret);
return ret;
}
private IntPtr txn_stat(uint flags, ref uint size, ref int err) {
return libdb_csharpPINVOKE.DB_ENV_txn_stat(swigCPtr, flags, ref size, ref err);
}
internal int txn_stat_print(uint flags) {
int ret;
ret = libdb_csharpPINVOKE.DB_ENV_txn_stat_print(swigCPtr, flags);
DatabaseException.ThrowException(ret);
return ret;
}
}
}
|