… | |
… | |
45 | typedef SV SV8; /* byte-sv, used for argument-checking */ |
45 | typedef SV SV8; /* byte-sv, used for argument-checking */ |
46 | typedef char *octetstring; |
46 | typedef char *octetstring; |
47 | |
47 | |
48 | static SV *prepare_cb; |
48 | static SV *prepare_cb; |
49 | |
49 | |
|
|
50 | #if DB_VERSION_MINOR >= 6 |
|
|
51 | # define c_close close |
|
|
52 | # define c_count count |
|
|
53 | # define c_del del |
|
|
54 | # define c_dup dup |
|
|
55 | # define c_get get |
|
|
56 | # define c_pget pget |
|
|
57 | # define c_put put |
|
|
58 | #endif |
|
|
59 | |
|
|
60 | static void |
|
|
61 | debug_errcall (const DB_ENV *dbenv, const char *errpfx, const char *msg) |
|
|
62 | { |
|
|
63 | printf ("err[%s]\n", msg); |
|
|
64 | } |
|
|
65 | |
|
|
66 | static void |
|
|
67 | debug_msgcall (const DB_ENV *dbenv, const char *msg) |
|
|
68 | { |
|
|
69 | printf ("msg[%s]\n", msg); |
|
|
70 | } |
|
|
71 | |
50 | static char * |
72 | static char * |
51 | strdup_ornull (const char *s) |
73 | strdup_ornull (const char *s) |
52 | { |
74 | { |
53 | return s ? strdup (s) : 0; |
75 | return s ? strdup (s) : 0; |
54 | } |
76 | } |
… | |
… | |
82 | REQ_QUIT, |
104 | REQ_QUIT, |
83 | REQ_ENV_OPEN, REQ_ENV_CLOSE, REQ_ENV_TXN_CHECKPOINT, REQ_ENV_LOCK_DETECT, |
105 | REQ_ENV_OPEN, REQ_ENV_CLOSE, REQ_ENV_TXN_CHECKPOINT, REQ_ENV_LOCK_DETECT, |
84 | REQ_ENV_MEMP_SYNC, REQ_ENV_MEMP_TRICKLE, |
106 | REQ_ENV_MEMP_SYNC, REQ_ENV_MEMP_TRICKLE, |
85 | REQ_DB_OPEN, REQ_DB_CLOSE, REQ_DB_COMPACT, REQ_DB_SYNC, |
107 | REQ_DB_OPEN, REQ_DB_CLOSE, REQ_DB_COMPACT, REQ_DB_SYNC, |
86 | REQ_DB_PUT, REQ_DB_GET, REQ_DB_PGET, REQ_DB_DEL, REQ_DB_KEY_RANGE, |
108 | REQ_DB_PUT, REQ_DB_GET, REQ_DB_PGET, REQ_DB_DEL, REQ_DB_KEY_RANGE, |
87 | REQ_TXN_COMMIT, REQ_TXN_ABORT, |
109 | REQ_TXN_COMMIT, REQ_TXN_ABORT, REQ_TXN_FINISH, |
88 | REQ_C_CLOSE, REQ_C_COUNT, REQ_C_PUT, REQ_C_GET, REQ_C_PGET, REQ_C_DEL, |
110 | REQ_C_CLOSE, REQ_C_COUNT, REQ_C_PUT, REQ_C_GET, REQ_C_PGET, REQ_C_DEL, |
89 | REQ_SEQ_OPEN, REQ_SEQ_CLOSE, REQ_SEQ_GET, REQ_SEQ_REMOVE, |
111 | REQ_SEQ_OPEN, REQ_SEQ_CLOSE, REQ_SEQ_GET, REQ_SEQ_REMOVE, |
90 | }; |
112 | }; |
91 | |
113 | |
92 | typedef struct aio_cb |
114 | typedef struct aio_cb |
… | |
… | |
169 | } |
191 | } |
170 | |
192 | |
171 | static volatile unsigned int nreqs, nready, npending; |
193 | static volatile unsigned int nreqs, nready, npending; |
172 | static volatile unsigned int max_idle = 4; |
194 | static volatile unsigned int max_idle = 4; |
173 | static volatile unsigned int max_outstanding = 0xffffffff; |
195 | static volatile unsigned int max_outstanding = 0xffffffff; |
174 | static int respipe [2], respipe_osf [2]; |
196 | static int respipe_osf [2], respipe [2] = { -1, -1 }; |
175 | |
197 | |
176 | static mutex_t reslock = X_MUTEX_INIT; |
198 | static mutex_t reslock = X_MUTEX_INIT; |
177 | static mutex_t reqlock = X_MUTEX_INIT; |
199 | static mutex_t reqlock = X_MUTEX_INIT; |
178 | static cond_t reqwait = X_COND_INIT; |
200 | static cond_t reqwait = X_COND_INIT; |
179 | |
201 | |
… | |
… | |
357 | #else |
379 | #else |
358 | # define TO_SOCKET(x) (x) |
380 | # define TO_SOCKET(x) (x) |
359 | #endif |
381 | #endif |
360 | |
382 | |
361 | static void |
383 | static void |
362 | create_pipe (int fd[2]) |
384 | create_respipe () |
363 | { |
385 | { |
|
|
386 | int old_readfd = respipe [0]; |
|
|
387 | |
|
|
388 | if (respipe [1] >= 0) |
|
|
389 | respipe_close (TO_SOCKET (respipe [1])); |
|
|
390 | |
|
|
391 | #ifdef _WIN32 |
|
|
392 | if (PerlSock_socketpair (AF_UNIX, SOCK_STREAM, 0, respipe)) |
|
|
393 | #else |
|
|
394 | if (pipe (respipe)) |
|
|
395 | #endif |
|
|
396 | croak ("unable to initialize result pipe"); |
|
|
397 | |
|
|
398 | if (old_readfd >= 0) |
|
|
399 | { |
|
|
400 | if (dup2 (TO_SOCKET (respipe [0]), TO_SOCKET (old_readfd)) < 0) |
|
|
401 | croak ("unable to initialize result pipe(2)"); |
|
|
402 | |
|
|
403 | respipe_close (respipe [0]); |
|
|
404 | respipe [0] = old_readfd; |
|
|
405 | } |
|
|
406 | |
364 | #ifdef _WIN32 |
407 | #ifdef _WIN32 |
365 | int arg = 1; |
408 | int arg = 1; |
366 | if (PerlSock_socketpair (AF_UNIX, SOCK_STREAM, 0, fd) |
|
|
367 | || ioctlsocket (TO_SOCKET (fd [0]), FIONBIO, &arg) |
409 | if (ioctlsocket (TO_SOCKET (respipe [0]), FIONBIO, &arg) |
368 | || ioctlsocket (TO_SOCKET (fd [1]), FIONBIO, &arg)) |
410 | || ioctlsocket (TO_SOCKET (respipe [1]), FIONBIO, &arg)) |
369 | #else |
411 | #else |
370 | if (pipe (fd) |
|
|
371 | || fcntl (fd [0], F_SETFL, O_NONBLOCK) |
412 | if (fcntl (respipe [0], F_SETFL, O_NONBLOCK) |
372 | || fcntl (fd [1], F_SETFL, O_NONBLOCK)) |
413 | || fcntl (respipe [1], F_SETFL, O_NONBLOCK)) |
373 | #endif |
414 | #endif |
374 | croak ("unable to initialize result pipe"); |
415 | croak ("unable to initialize result pipe(3)"); |
375 | |
416 | |
376 | respipe_osf [0] = TO_SOCKET (respipe [0]); |
417 | respipe_osf [0] = TO_SOCKET (respipe [0]); |
377 | respipe_osf [1] = TO_SOCKET (respipe [1]); |
418 | respipe_osf [1] = TO_SOCKET (respipe [1]); |
378 | } |
419 | } |
379 | |
420 | |
… | |
… | |
646 | X_UNLOCK (reqlock); |
687 | X_UNLOCK (reqlock); |
647 | |
688 | |
648 | switch (req->type) |
689 | switch (req->type) |
649 | { |
690 | { |
650 | case REQ_QUIT: |
691 | case REQ_QUIT: |
|
|
692 | req->result = ENOSYS; |
651 | goto quit; |
693 | goto quit; |
652 | |
694 | |
653 | case REQ_ENV_OPEN: |
695 | case REQ_ENV_OPEN: |
654 | req->result = req->env->open (req->env, req->buf1, req->uint1, req->int1); |
696 | req->result = req->env->open (req->env, req->buf1, req->uint1, req->int1); |
655 | break; |
697 | break; |
… | |
… | |
714 | req->result = req->txn->commit (req->txn, req->uint1); |
756 | req->result = req->txn->commit (req->txn, req->uint1); |
715 | break; |
757 | break; |
716 | |
758 | |
717 | case REQ_TXN_ABORT: |
759 | case REQ_TXN_ABORT: |
718 | req->result = req->txn->abort (req->txn); |
760 | req->result = req->txn->abort (req->txn); |
|
|
761 | break; |
|
|
762 | |
|
|
763 | case REQ_TXN_FINISH: |
|
|
764 | if (req->txn->flags & TXN_DEADLOCK) |
|
|
765 | { |
|
|
766 | req->result = req->txn->abort (req->txn); |
|
|
767 | if (!req->result) |
|
|
768 | req->result = DB_LOCK_DEADLOCK; |
|
|
769 | } |
|
|
770 | else |
|
|
771 | req->result = req->txn->commit (req->txn, req->uint1); |
719 | break; |
772 | break; |
720 | |
773 | |
721 | case REQ_C_CLOSE: |
774 | case REQ_C_CLOSE: |
722 | req->result = req->dbc->c_close (req->dbc); |
775 | req->result = req->dbc->c_close (req->dbc); |
723 | break; |
776 | break; |
… | |
… | |
765 | default: |
818 | default: |
766 | req->result = ENOSYS; |
819 | req->result = ENOSYS; |
767 | break; |
820 | break; |
768 | } |
821 | } |
769 | |
822 | |
|
|
823 | if (req->txn && (req->result > 0 || req->result == DB_LOCK_NOTGRANTED)) |
|
|
824 | req->txn->flags |= TXN_DEADLOCK; |
|
|
825 | |
770 | X_LOCK (reslock); |
826 | X_LOCK (reslock); |
771 | |
827 | |
772 | ++npending; |
828 | ++npending; |
773 | |
829 | |
774 | if (!reqq_push (&res_queue, req)) |
830 | if (!reqq_push (&res_queue, req)) |
… | |
… | |
830 | idle = 0; |
886 | idle = 0; |
831 | nreqs = 0; |
887 | nreqs = 0; |
832 | nready = 0; |
888 | nready = 0; |
833 | npending = 0; |
889 | npending = 0; |
834 | |
890 | |
835 | respipe_close (respipe [0]); |
|
|
836 | respipe_close (respipe [1]); |
|
|
837 | |
|
|
838 | create_pipe (respipe); |
891 | create_respipe (); |
839 | |
892 | |
840 | atfork_parent (); |
893 | atfork_parent (); |
841 | } |
894 | } |
842 | |
895 | |
843 | #define dREQ(reqtype) \ |
896 | #define dREQ(reqtype) \ |
… | |
… | |
907 | const_iv (INIT_TXN) |
960 | const_iv (INIT_TXN) |
908 | const_iv (RECOVER) |
961 | const_iv (RECOVER) |
909 | const_iv (INIT_TXN) |
962 | const_iv (INIT_TXN) |
910 | const_iv (RECOVER_FATAL) |
963 | const_iv (RECOVER_FATAL) |
911 | const_iv (CREATE) |
964 | const_iv (CREATE) |
|
|
965 | const_iv (RDONLY) |
912 | const_iv (USE_ENVIRON) |
966 | const_iv (USE_ENVIRON) |
913 | const_iv (USE_ENVIRON_ROOT) |
967 | const_iv (USE_ENVIRON_ROOT) |
914 | const_iv (LOCKDOWN) |
968 | const_iv (LOCKDOWN) |
915 | const_iv (PRIVATE) |
969 | const_iv (PRIVATE) |
916 | const_iv (REGISTER) |
970 | const_iv (REGISTER) |
… | |
… | |
929 | const_iv (OVERWRITE) |
983 | const_iv (OVERWRITE) |
930 | const_iv (PANIC_ENVIRONMENT) |
984 | const_iv (PANIC_ENVIRONMENT) |
931 | const_iv (REGION_INIT) |
985 | const_iv (REGION_INIT) |
932 | const_iv (TIME_NOTGRANTED) |
986 | const_iv (TIME_NOTGRANTED) |
933 | const_iv (TXN_NOSYNC) |
987 | const_iv (TXN_NOSYNC) |
|
|
988 | const_iv (TXN_NOT_DURABLE) |
934 | const_iv (TXN_WRITE_NOSYNC) |
989 | const_iv (TXN_WRITE_NOSYNC) |
935 | const_iv (WRITECURSOR) |
990 | const_iv (WRITECURSOR) |
936 | const_iv (YIELDCPU) |
991 | const_iv (YIELDCPU) |
937 | const_iv (ENCRYPT_AES) |
992 | const_iv (ENCRYPT_AES) |
938 | const_iv (XA_CREATE) |
993 | const_iv (XA_CREATE) |
… | |
… | |
946 | const_iv (READ_UNCOMMITTED) |
1001 | const_iv (READ_UNCOMMITTED) |
947 | const_iv (TRUNCATE) |
1002 | const_iv (TRUNCATE) |
948 | const_iv (NOSYNC) |
1003 | const_iv (NOSYNC) |
949 | const_iv (CHKSUM) |
1004 | const_iv (CHKSUM) |
950 | const_iv (ENCRYPT) |
1005 | const_iv (ENCRYPT) |
951 | const_iv (TXN_NOT_DURABLE) |
|
|
952 | const_iv (DUP) |
1006 | const_iv (DUP) |
953 | const_iv (DUPSORT) |
1007 | const_iv (DUPSORT) |
954 | const_iv (RECNUM) |
1008 | const_iv (RECNUM) |
955 | const_iv (RENUMBER) |
1009 | const_iv (RENUMBER) |
956 | const_iv (REVSPLITOFF) |
1010 | const_iv (REVSPLITOFF) |
… | |
… | |
1018 | const_iv (LOCK_YOUNGEST) |
1072 | const_iv (LOCK_YOUNGEST) |
1019 | |
1073 | |
1020 | const_iv (SEQ_DEC) |
1074 | const_iv (SEQ_DEC) |
1021 | const_iv (SEQ_INC) |
1075 | const_iv (SEQ_INC) |
1022 | const_iv (SEQ_WRAP) |
1076 | const_iv (SEQ_WRAP) |
|
|
1077 | |
|
|
1078 | const_iv (BUFFER_SMALL) |
|
|
1079 | const_iv (DONOTINDEX) |
|
|
1080 | const_iv (KEYEMPTY ) |
|
|
1081 | const_iv (KEYEXIST ) |
|
|
1082 | const_iv (LOCK_DEADLOCK) |
|
|
1083 | const_iv (LOCK_NOTGRANTED) |
|
|
1084 | const_iv (LOG_BUFFER_FULL) |
|
|
1085 | const_iv (NOSERVER) |
|
|
1086 | const_iv (NOSERVER_HOME) |
|
|
1087 | const_iv (NOSERVER_ID) |
|
|
1088 | const_iv (NOTFOUND) |
|
|
1089 | const_iv (OLD_VERSION) |
|
|
1090 | const_iv (PAGE_NOTFOUND) |
|
|
1091 | const_iv (REP_DUPMASTER) |
|
|
1092 | const_iv (REP_HANDLE_DEAD) |
|
|
1093 | const_iv (REP_HOLDELECTION) |
|
|
1094 | const_iv (REP_IGNORE) |
|
|
1095 | const_iv (REP_ISPERM) |
|
|
1096 | const_iv (REP_JOIN_FAILURE) |
|
|
1097 | const_iv (REP_LOCKOUT) |
|
|
1098 | const_iv (REP_NEWMASTER) |
|
|
1099 | const_iv (REP_NEWSITE) |
|
|
1100 | const_iv (REP_NOTPERM) |
|
|
1101 | const_iv (REP_UNAVAIL) |
|
|
1102 | const_iv (RUNRECOVERY) |
|
|
1103 | const_iv (SECONDARY_BAD) |
|
|
1104 | const_iv (VERIFY_BAD) |
|
|
1105 | const_iv (VERSION_MISMATCH) |
|
|
1106 | |
|
|
1107 | const_iv (VERB_DEADLOCK) |
|
|
1108 | const_iv (VERB_RECOVERY) |
|
|
1109 | const_iv (VERB_REGISTER) |
|
|
1110 | const_iv (VERB_REPLICATION) |
|
|
1111 | const_iv (VERB_WAITSFOR) |
|
|
1112 | |
|
|
1113 | const_iv (VERSION_MAJOR) |
|
|
1114 | const_iv (VERSION_MINOR) |
|
|
1115 | const_iv (VERSION_PATCH) |
1023 | #if DB_VERSION_MINOR >= 5 |
1116 | #if DB_VERSION_MINOR >= 5 |
1024 | const_iv (MULTIVERSION) |
1117 | const_iv (MULTIVERSION) |
1025 | const_iv (TXN_SNAPSHOT) |
1118 | const_iv (TXN_SNAPSHOT) |
1026 | #endif |
1119 | #endif |
|
|
1120 | #if DB_VERSION_MINOR >= 6 |
|
|
1121 | const_iv (PREV_DUP) |
|
|
1122 | # if 0 |
|
|
1123 | const_iv (PRIORITY_UNCHANGED) |
|
|
1124 | const_iv (PRIORITY_VERY_LOW) |
|
|
1125 | const_iv (PRIORITY_LOW) |
|
|
1126 | const_iv (PRIORITY_DEFAULT) |
|
|
1127 | const_iv (PRIORITY_HIGH) |
|
|
1128 | const_iv (PRIORITY_VERY_HIGH) |
|
|
1129 | # endif |
|
|
1130 | #endif |
1027 | }; |
1131 | }; |
1028 | |
1132 | |
1029 | for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) |
1133 | for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) |
1030 | newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); |
1134 | newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); |
1031 | |
1135 | |
|
|
1136 | newCONSTSUB (stash, "DB_VERSION", newSVnv (DB_VERSION_MAJOR + DB_VERSION_MINOR * .1)); |
|
|
1137 | newCONSTSUB (stash, "DB_VERSION_STRING", newSVpv (DB_VERSION_STRING, 0)); |
|
|
1138 | |
1032 | create_pipe (respipe); |
1139 | create_respipe (); |
1033 | |
1140 | |
1034 | X_THREAD_ATFORK (atfork_prepare, atfork_parent, atfork_child); |
1141 | X_THREAD_ATFORK (atfork_prepare, atfork_parent, atfork_child); |
1035 | #ifdef _WIN32 |
1142 | #ifdef _WIN32 |
1036 | X_MUTEX_CHECK (wrklock); |
1143 | X_MUTEX_CHECK (wrklock); |
1037 | X_MUTEX_CHECK (reslock); |
1144 | X_MUTEX_CHECK (reslock); |
… | |
… | |
1178 | PROTOTYPE: & |
1285 | PROTOTYPE: & |
1179 | CODE: |
1286 | CODE: |
1180 | SvREFCNT_dec (prepare_cb); |
1287 | SvREFCNT_dec (prepare_cb); |
1181 | prepare_cb = newSVsv (cb); |
1288 | prepare_cb = newSVsv (cb); |
1182 | |
1289 | |
|
|
1290 | char * |
|
|
1291 | strerror (int errorno = errno) |
|
|
1292 | PROTOTYPE: ;$ |
|
|
1293 | CODE: |
|
|
1294 | RETVAL = db_strerror (errorno); |
|
|
1295 | OUTPUT: |
|
|
1296 | RETVAL |
1183 | |
1297 | |
1184 | DB_ENV * |
1298 | DB_ENV * |
1185 | db_env_create (U32 env_flags = 0) |
1299 | db_env_create (U32 env_flags = 0) |
1186 | CODE: |
1300 | CODE: |
1187 | { |
1301 | { |
1188 | errno = db_env_create (&RETVAL, env_flags); |
1302 | errno = db_env_create (&RETVAL, env_flags); |
1189 | if (errno) |
1303 | if (errno) |
1190 | croak ("db_env_create: %s", db_strerror (errno)); |
1304 | croak ("db_env_create: %s", db_strerror (errno)); |
|
|
1305 | |
|
|
1306 | if (0) |
|
|
1307 | { |
|
|
1308 | RETVAL->set_errcall (RETVAL, debug_errcall); |
|
|
1309 | RETVAL->set_msgcall (RETVAL, debug_msgcall); |
|
|
1310 | } |
1191 | } |
1311 | } |
1192 | OUTPUT: |
1312 | OUTPUT: |
1193 | RETVAL |
1313 | RETVAL |
1194 | |
1314 | |
1195 | void |
1315 | void |
1196 | db_env_open (DB_ENV *env, octetstring db_home, U32 open_flags, int mode, SV *callback = &PL_sv_undef) |
1316 | db_env_open (DB_ENV *env, octetstring db_home, U32 open_flags, int mode, SV *callback = &PL_sv_undef) |
1197 | CODE: |
1317 | CODE: |
1198 | { |
1318 | { |
1199 | dREQ (REQ_ENV_OPEN); |
1319 | dREQ (REQ_ENV_OPEN); |
1200 | |
1320 | |
1201 | env->set_thread_count (env, get_nthreads ()); |
1321 | env->set_thread_count (env, wanted + 2); |
1202 | |
1322 | |
1203 | req->env = env; |
1323 | req->env = env; |
1204 | req->uint1 = open_flags | DB_THREAD; |
1324 | req->uint1 = open_flags | DB_THREAD; |
1205 | req->int1 = mode; |
1325 | req->int1 = mode; |
1206 | req->buf1 = strdup_ornull (db_home); |
1326 | req->buf1 = strdup_ornull (db_home); |
… | |
… | |
1412 | REQ_SEND; |
1532 | REQ_SEND; |
1413 | ptr_nuke (ST (0)); |
1533 | ptr_nuke (ST (0)); |
1414 | } |
1534 | } |
1415 | |
1535 | |
1416 | void |
1536 | void |
|
|
1537 | db_txn_finish (DB_TXN *txn, U32 flags = 0, SV *callback = &PL_sv_undef) |
|
|
1538 | CODE: |
|
|
1539 | { |
|
|
1540 | dREQ (REQ_TXN_FINISH); |
|
|
1541 | req->txn = txn; |
|
|
1542 | req->uint1 = flags; |
|
|
1543 | REQ_SEND; |
|
|
1544 | ptr_nuke (ST (0)); |
|
|
1545 | } |
|
|
1546 | |
|
|
1547 | void |
1417 | db_c_close (DBC *dbc, SV *callback = &PL_sv_undef) |
1548 | db_c_close (DBC *dbc, SV *callback = &PL_sv_undef) |
1418 | CODE: |
1549 | CODE: |
1419 | { |
1550 | { |
1420 | dREQ (REQ_C_CLOSE); |
1551 | dREQ (REQ_C_CLOSE); |
1421 | req->dbc = dbc; |
1552 | req->dbc = dbc; |
… | |
… | |
1599 | CODE: |
1730 | CODE: |
1600 | RETVAL = env->set_flags (env, flags, onoff); |
1731 | RETVAL = env->set_flags (env, flags, onoff); |
1601 | OUTPUT: |
1732 | OUTPUT: |
1602 | RETVAL |
1733 | RETVAL |
1603 | |
1734 | |
|
|
1735 | void set_errfile (DB_ENV *env, FILE *errfile = 0) |
|
|
1736 | CODE: |
|
|
1737 | env->set_errfile (env, errfile); |
|
|
1738 | |
|
|
1739 | void set_msgfile (DB_ENV *env, FILE *msgfile = 0) |
|
|
1740 | CODE: |
|
|
1741 | env->set_msgfile (env, msgfile); |
|
|
1742 | |
|
|
1743 | int set_verbose (DB_ENV *env, U32 which, int onoff = 1) |
|
|
1744 | CODE: |
|
|
1745 | RETVAL = env->set_verbose (env, which, onoff); |
|
|
1746 | OUTPUT: |
|
|
1747 | RETVAL |
|
|
1748 | |
1604 | int set_encrypt (DB_ENV *env, const char *password, U32 flags = 0) |
1749 | int set_encrypt (DB_ENV *env, const char *password, U32 flags = 0) |
1605 | CODE: |
1750 | CODE: |
1606 | RETVAL = env->set_encrypt (env, password, flags); |
1751 | RETVAL = env->set_encrypt (env, password, flags); |
1607 | OUTPUT: |
1752 | OUTPUT: |
1608 | RETVAL |
1753 | RETVAL |
1609 | |
1754 | |
1610 | int set_timeout (DB_ENV *env, NV timeout, U32 flags) |
1755 | int set_timeout (DB_ENV *env, NV timeout, U32 flags = DB_SET_TXN_TIMEOUT) |
1611 | CODE: |
1756 | CODE: |
1612 | RETVAL = env->set_timeout (env, timeout * 1000000, flags); |
1757 | RETVAL = env->set_timeout (env, timeout * 1000000, flags); |
1613 | OUTPUT: |
1758 | OUTPUT: |
1614 | RETVAL |
1759 | RETVAL |
1615 | |
1760 | |
… | |
… | |
1692 | CODE: |
1837 | CODE: |
1693 | RETVAL = db->set_cachesize (db, gbytes, bytes, ncache); |
1838 | RETVAL = db->set_cachesize (db, gbytes, bytes, ncache); |
1694 | OUTPUT: |
1839 | OUTPUT: |
1695 | RETVAL |
1840 | RETVAL |
1696 | |
1841 | |
1697 | int set_flags (DB *db, U32 flags); |
1842 | int set_flags (DB *db, U32 flags) |
1698 | CODE: |
1843 | CODE: |
1699 | RETVAL = db->set_flags (db, flags); |
1844 | RETVAL = db->set_flags (db, flags); |
1700 | OUTPUT: |
1845 | OUTPUT: |
1701 | RETVAL |
1846 | RETVAL |
1702 | |
1847 | |
… | |
… | |
1716 | CODE: |
1861 | CODE: |
1717 | RETVAL = db->set_bt_minkey (db, minkey); |
1862 | RETVAL = db->set_bt_minkey (db, minkey); |
1718 | OUTPUT: |
1863 | OUTPUT: |
1719 | RETVAL |
1864 | RETVAL |
1720 | |
1865 | |
1721 | int set_re_delim(DB *db, int delim); |
1866 | int set_re_delim (DB *db, int delim) |
1722 | CODE: |
1867 | CODE: |
1723 | RETVAL = db->set_re_delim (db, delim); |
1868 | RETVAL = db->set_re_delim (db, delim); |
1724 | OUTPUT: |
1869 | OUTPUT: |
1725 | RETVAL |
1870 | RETVAL |
1726 | |
1871 | |
… | |
… | |
1787 | DESTROY (DB_TXN_ornull *txn) |
1932 | DESTROY (DB_TXN_ornull *txn) |
1788 | CODE: |
1933 | CODE: |
1789 | if (txn) |
1934 | if (txn) |
1790 | txn->abort (txn); |
1935 | txn->abort (txn); |
1791 | |
1936 | |
1792 | int set_timeout (DB_TXN *txn, NV timeout, U32 flags) |
1937 | int set_timeout (DB_TXN *txn, NV timeout, U32 flags = DB_SET_TXN_TIMEOUT) |
1793 | CODE: |
1938 | CODE: |
1794 | RETVAL = txn->set_timeout (txn, timeout * 1000000, flags); |
1939 | RETVAL = txn->set_timeout (txn, timeout * 1000000, flags); |
|
|
1940 | OUTPUT: |
|
|
1941 | RETVAL |
|
|
1942 | |
|
|
1943 | int failed (DB_TXN *txn) |
|
|
1944 | CODE: |
|
|
1945 | RETVAL = !!(txn->flags & TXN_DEADLOCK); |
1795 | OUTPUT: |
1946 | OUTPUT: |
1796 | RETVAL |
1947 | RETVAL |
1797 | |
1948 | |
1798 | |
1949 | |
1799 | MODULE = BDB PACKAGE = BDB::Cursor |
1950 | MODULE = BDB PACKAGE = BDB::Cursor |