ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/BDB/BDB.xs
(Generate patch)

Comparing BDB/BDB.xs (file contents):
Revision 1.63 by root, Tue Oct 21 02:21:25 2008 UTC vs.
Revision 1.74 by root, Wed Mar 31 00:44:51 2010 UTC

6 6
7#include "EXTERN.h" 7#include "EXTERN.h"
8#include "perl.h" 8#include "perl.h"
9#include "XSUB.h" 9#include "XSUB.h"
10 10
11#include "schmorp.h"
12
11// perl stupidly defines these as macros, breaking 13// perl stupidly defines these as argument-less macros, breaking
12// lots and lots of code. 14// lots and lots of code.
13#undef open 15#undef open
14#undef close 16#undef close
15#undef abort 17#undef abort
16#undef malloc 18#undef malloc
56#endif 58#endif
57 59
58typedef char *bdb_filename; 60typedef char *bdb_filename;
59 61
60static SV *prepare_cb; 62static SV *prepare_cb;
63
64static HV
65 *bdb_stash,
66 *bdb_env_stash,
67 *bdb_txn_stash,
68 *bdb_cursor_stash,
69 *bdb_db_stash,
70 *bdb_sequence_stash;
61 71
62#if DB_VERSION_MINOR >= 6 72#if DB_VERSION_MINOR >= 6
63# define c_close close 73# define c_close close
64# define c_count count 74# define c_count count
65# define c_del del 75# define c_del del
150enum { 160enum {
151 REQ_QUIT, 161 REQ_QUIT,
152 REQ_ENV_OPEN, REQ_ENV_CLOSE, REQ_ENV_TXN_CHECKPOINT, REQ_ENV_LOCK_DETECT, 162 REQ_ENV_OPEN, REQ_ENV_CLOSE, REQ_ENV_TXN_CHECKPOINT, REQ_ENV_LOCK_DETECT,
153 REQ_ENV_MEMP_SYNC, REQ_ENV_MEMP_TRICKLE, REQ_ENV_DBREMOVE, REQ_ENV_DBRENAME, 163 REQ_ENV_MEMP_SYNC, REQ_ENV_MEMP_TRICKLE, REQ_ENV_DBREMOVE, REQ_ENV_DBRENAME,
154 REQ_ENV_LOG_ARCHIVE, 164 REQ_ENV_LOG_ARCHIVE,
155 REQ_DB_OPEN, REQ_DB_CLOSE, REQ_DB_COMPACT, REQ_DB_SYNC, REQ_DB_UPGRADE, 165 REQ_DB_OPEN, REQ_DB_CLOSE, REQ_DB_COMPACT, REQ_DB_SYNC, REQ_DB_VERIFY, REQ_DB_UPGRADE,
156 REQ_DB_PUT, REQ_DB_EXISTS, REQ_DB_GET, REQ_DB_PGET, REQ_DB_DEL, REQ_DB_KEY_RANGE, 166 REQ_DB_PUT, REQ_DB_EXISTS, REQ_DB_GET, REQ_DB_PGET, REQ_DB_DEL, REQ_DB_KEY_RANGE,
157 REQ_TXN_COMMIT, REQ_TXN_ABORT, REQ_TXN_FINISH, 167 REQ_TXN_COMMIT, REQ_TXN_ABORT, REQ_TXN_FINISH,
158 REQ_C_CLOSE, REQ_C_COUNT, REQ_C_PUT, REQ_C_GET, REQ_C_PGET, REQ_C_DEL, 168 REQ_C_CLOSE, REQ_C_COUNT, REQ_C_PUT, REQ_C_GET, REQ_C_PGET, REQ_C_DEL,
159 REQ_SEQ_OPEN, REQ_SEQ_CLOSE, REQ_SEQ_GET, REQ_SEQ_REMOVE, 169 REQ_SEQ_OPEN, REQ_SEQ_CLOSE, REQ_SEQ_GET, REQ_SEQ_REMOVE,
160}; 170};
214static int next_pri = DEFAULT_PRI + PRI_BIAS; 224static int next_pri = DEFAULT_PRI + PRI_BIAS;
215 225
216static unsigned int started, idle, wanted; 226static unsigned int started, idle, wanted;
217 227
218/* worker threads management */ 228/* worker threads management */
219static mutex_t wrklock = X_MUTEX_INIT; 229static xmutex_t wrklock = X_MUTEX_INIT;
220 230
221typedef struct worker { 231typedef struct worker {
222 /* locked by wrklock */ 232 /* locked by wrklock */
223 struct worker *prev, *next; 233 struct worker *prev, *next;
224 234
225 thread_t tid; 235 xthread_t tid;
226 236
227 /* locked by reslock, reqlock or wrklock */ 237 /* locked by reslock, reqlock or wrklock */
228 bdb_req req; /* currently processed request */ 238 bdb_req req; /* currently processed request */
229 void *dbuf; 239 void *dbuf;
230 DIR *dirp; 240 DIR *dirp;
245} 255}
246 256
247static volatile unsigned int nreqs, nready, npending; 257static volatile unsigned int nreqs, nready, npending;
248static volatile unsigned int max_idle = 4; 258static volatile unsigned int max_idle = 4;
249static volatile unsigned int max_outstanding = 0xffffffff; 259static volatile unsigned int max_outstanding = 0xffffffff;
250static int respipe_osf [2], respipe [2] = { -1, -1 }; 260static s_epipe respipe;
251 261
252static mutex_t reslock = X_MUTEX_INIT; 262static xmutex_t reslock = X_MUTEX_INIT;
253static mutex_t reqlock = X_MUTEX_INIT; 263static xmutex_t reqlock = X_MUTEX_INIT;
254static cond_t reqwait = X_COND_INIT; 264static xcond_t reqwait = X_COND_INIT;
255 265
256#if WORDACCESS_UNSAFE 266#if WORDACCESS_UNSAFE
257 267
258static unsigned int get_nready (void) 268static unsigned int get_nready (void)
259{ 269{
456 free (req->buf3); 466 free (req->buf3);
457 467
458 Safefree (req); 468 Safefree (req);
459} 469}
460 470
461#ifdef USE_SOCKETS_AS_HANDLES
462# define TO_SOCKET(x) (win32_get_osfhandle (x))
463#else
464# define TO_SOCKET(x) (x)
465#endif
466
467static void 471static void
468create_respipe (void) 472create_respipe (void)
469{ 473{
470#ifdef _WIN32
471 int arg; /* argg */
472#endif
473 int old_readfd = respipe [0];
474
475 if (respipe [1] >= 0)
476 respipe_close (TO_SOCKET (respipe [1]));
477
478#ifdef _WIN32
479 if (PerlSock_socketpair (AF_UNIX, SOCK_STREAM, 0, respipe))
480#else
481 if (pipe (respipe)) 474 if (s_epipe_renew (&respipe))
482#endif 475 croak ("BDB: unable to create event pipe");
483 croak ("unable to initialize result pipe");
484
485 if (old_readfd >= 0)
486 {
487 if (dup2 (TO_SOCKET (respipe [0]), TO_SOCKET (old_readfd)) < 0)
488 croak ("unable to initialize result pipe(2)");
489
490 respipe_close (respipe [0]);
491 respipe [0] = old_readfd;
492 }
493
494#ifdef _WIN32
495 arg = 1;
496 if (ioctlsocket (TO_SOCKET (respipe [0]), FIONBIO, &arg)
497 || ioctlsocket (TO_SOCKET (respipe [1]), FIONBIO, &arg))
498#else
499 if (fcntl (respipe [0], F_SETFL, O_NONBLOCK)
500 || fcntl (respipe [1], F_SETFL, O_NONBLOCK))
501#endif
502 croak ("unable to initialize result pipe(3)");
503
504 respipe_osf [0] = TO_SOCKET (respipe [0]);
505 respipe_osf [1] = TO_SOCKET (respipe [1]);
506} 476}
507 477
508static void bdb_request (bdb_req req); 478static void bdb_request (bdb_req req);
509X_THREAD_PROC (bdb_proc); 479X_THREAD_PROC (bdb_proc);
510 480
646 end_thread (); 616 end_thread ();
647} 617}
648 618
649static void poll_wait (void) 619static void poll_wait (void)
650{ 620{
651 fd_set rfd;
652
653 while (nreqs) 621 while (nreqs)
654 { 622 {
655 int size; 623 int size;
656 if (WORDACCESS_UNSAFE) X_LOCK (reslock); 624 if (WORDACCESS_UNSAFE) X_LOCK (reslock);
657 size = res_queue.size; 625 size = res_queue.size;
660 if (size) 628 if (size)
661 return; 629 return;
662 630
663 maybe_start_thread (); 631 maybe_start_thread ();
664 632
665 FD_ZERO (&rfd); 633 s_epipe_wait (&respipe);
666 FD_SET (respipe [0], &rfd);
667
668 PerlSock_select (respipe [0] + 1, &rfd, 0, 0, 0);
669 } 634 }
670} 635}
671 636
672static int poll_cb (void) 637static int poll_cb (void)
673{ 638{
693 if (req) 658 if (req)
694 { 659 {
695 --npending; 660 --npending;
696 661
697 if (!res_queue.size) 662 if (!res_queue.size)
698 {
699 /* read any signals sent by the worker threads */ 663 /* read any signals sent by the worker threads */
700 char buf [4]; 664 s_epipe_drain (&respipe);
701 while (respipe_read (respipe [0], buf, 4) == 4)
702 ;
703 }
704 } 665 }
705 666
706 X_UNLOCK (reslock); 667 X_UNLOCK (reslock);
707 668
708 if (!req) 669 if (!req)
796 break; 757 break;
797#endif 758#endif
798 759
799 case REQ_DB_SYNC: 760 case REQ_DB_SYNC:
800 req->result = req->db->sync (req->db, req->uint1); 761 req->result = req->db->sync (req->db, req->uint1);
762 break;
763
764 case REQ_DB_VERIFY:
765 req->result = req->db->verify (req->db, req->buf1, req->buf2, 0, req->uint1);
801 break; 766 break;
802 767
803 case REQ_DB_UPGRADE: 768 case REQ_DB_UPGRADE:
804 req->result = req->db->upgrade (req->db, req->buf1, req->uint1); 769 req->result = req->db->upgrade (req->db, req->buf1, req->uint1);
805 break; 770 break;
920 /* try to distribute timeouts somewhat evenly */ 885 /* try to distribute timeouts somewhat evenly */
921 ts.tv_nsec = ((unsigned long)self & 1023UL) * (1000000000UL / 1024UL); 886 ts.tv_nsec = ((unsigned long)self & 1023UL) * (1000000000UL / 1024UL);
922 887
923 for (;;) 888 for (;;)
924 { 889 {
925 ts.tv_sec = time (0) + IDLE_TIMEOUT; 890 ts.tv_sec = time (0) + IDLE_TIMEOUT;
926 891
927 X_LOCK (reqlock); 892 X_LOCK (reqlock);
928 893
929 for (;;) 894 for (;;)
930 { 895 {
975 X_LOCK (reslock); 940 X_LOCK (reslock);
976 941
977 ++npending; 942 ++npending;
978 943
979 if (!reqq_push (&res_queue, req)) 944 if (!reqq_push (&res_queue, req))
980 /* write a dummy byte to the pipe so fh becomes ready */ 945 s_epipe_signal (&respipe);
981 respipe_write (respipe_osf [1], (const void *)&respipe_osf, 1);
982 946
983 self->req = 0; 947 self->req = 0;
984 worker_clear (self); 948 worker_clear (self);
985 949
986 X_UNLOCK (reslock); 950 X_UNLOCK (reslock);
1062 (void)0; 1026 (void)0;
1063 1027
1064#define REQ_SEND \ 1028#define REQ_SEND \
1065 req_send (req) 1029 req_send (req)
1066 1030
1067#define SvPTR(var, arg, type, class, nullok) \ 1031#define SvPTR(var, arg, type, stash, class, nullok) \
1068 if (!SvOK (arg)) \ 1032 if (!SvOK (arg)) \
1069 { \ 1033 { \
1070 if (nullok != 1) \ 1034 if (nullok != 1) \
1071 croak (# var " must be a " # class " object, not undef"); \ 1035 croak (# var " must be a " # class " object, not undef"); \
1072 \ 1036 \
1073 (var) = 0; \ 1037 (var) = 0; \
1074 } \ 1038 } \
1075 else if (sv_derived_from ((arg), # class)) \ 1039 else if (SvSTASH (SvRV (arg)) == stash || sv_derived_from ((arg), # class)) \
1076 { \ 1040 { \
1077 IV tmp = SvIV ((SV*) SvRV (arg)); \ 1041 IV tmp = SvIV ((SV*) SvRV (arg)); \
1078 (var) = INT2PTR (type, tmp); \ 1042 (var) = INT2PTR (type, tmp); \
1079 if (!var && nullok != 2) \ 1043 if (!var && nullok != 2) \
1080 croak (# var " is not a valid " # class " object anymore"); \ 1044 croak (# var " is not a valid " # class " object anymore"); \
1083 croak (# var " is not of type " # class); 1047 croak (# var " is not of type " # class);
1084 1048
1085#define ARG_MUTABLE(name) \ 1049#define ARG_MUTABLE(name) \
1086 if (SvREADONLY (name)) \ 1050 if (SvREADONLY (name)) \
1087 croak ("argument " #name " is read-only/constant, but the request requires it to be mutable"); 1051 croak ("argument " #name " is read-only/constant, but the request requires it to be mutable");
1052
1053static SV *
1054newSVptr (void *ptr, HV *stash)
1055{
1056 SV *rv = NEWSV (0, 0);
1057 sv_upgrade (rv, SVt_PVMG);
1058 sv_setiv (rv, PTR2IV (ptr));
1059
1060 return sv_bless (newRV_noinc (rv), stash);
1061}
1088 1062
1089static void 1063static void
1090ptr_nuke (SV *sv) 1064ptr_nuke (SV *sv)
1091{ 1065{
1092 assert (SvROK (sv)); 1066 assert (SvROK (sv));
1163 } 1137 }
1164 1138
1165 return 0; 1139 return 0;
1166} 1140}
1167 1141
1142/*****************************************************************************/
1143
1144#if 0
1145static int
1146bt_pfxc_compare (DB *db, const DBT *dbt1, const DBT *dbt2)
1147{
1148 ssize_t size1 = dbt1->size;
1149 ssize_t size2 = dbt2->size;
1150 int res = memcmp ((void *)dbt1->data, (void *)dbt2->data,
1151 size1 <= size2 ? size1 : size2);
1152
1153 if (res)
1154 return res;
1155 else if (size1 - size2)
1156 return size1 - size2;
1157 else
1158 return 0;
1159}
1160
1161static size_t
1162bt_pfxc_prefix_x (DB *db, const DBT *dbt1, const DBT *dbt2)
1163{
1164 ssize_t size1 = dbt1->size;
1165 ssize_t size2 = dbt2->size;
1166 u_int8_t *p1 = (u_int8_t *)dbt1->data;
1167 u_int8_t *p2 = (u_int8_t *)dbt2->data;
1168 u_int8_t *pe = p1 + (size1 <= size2 ? size1 : size2);
1169
1170 while (p1 < pe)
1171 if (*p1++ != *p2++)
1172 return p1 - (u_int8_t *)dbt1->data - 1;
1173
1174 if (size1 < size2) return size1 + 1;
1175 if (size1 > size2) return size2 + 1;
1176
1177 return size1;
1178}
1179#endif
1180
1181/*****************************************************************************/
1182
1168/* stupid windows defines CALLBACK as well */ 1183/* stupid windows defines CALLBACK as well */
1169#undef CALLBACK 1184#undef CALLBACK
1170#define CALLBACK SV *cb = pop_callback (&items, ST (items - 1)); 1185#define CALLBACK SV *cb = pop_callback (&items, ST (items - 1));
1171 1186
1172MODULE = BDB PACKAGE = BDB 1187MODULE = BDB PACKAGE = BDB
1173 1188
1174PROTOTYPES: ENABLE 1189PROTOTYPES: ENABLE
1175 1190
1176BOOT: 1191BOOT:
1177{ 1192{
1178 HV *stash = gv_stashpv ("BDB", 1);
1179
1180 static const struct { 1193 static const struct {
1181 const char *name; 1194 const char *name;
1182 IV iv; 1195 IV iv;
1183 } *civ, const_iv[] = { 1196 } *civ, const_iv[] = {
1184#define const_iv(name) { # name, (IV)DB_ ## name }, 1197#define const_iv(name) { # name, (IV)DB_ ## name },
1213 const_iv (TXN_NOT_DURABLE) 1226 const_iv (TXN_NOT_DURABLE)
1214 const_iv (TXN_WRITE_NOSYNC) 1227 const_iv (TXN_WRITE_NOSYNC)
1215 const_iv (WRITECURSOR) 1228 const_iv (WRITECURSOR)
1216 const_iv (YIELDCPU) 1229 const_iv (YIELDCPU)
1217 const_iv (ENCRYPT_AES) 1230 const_iv (ENCRYPT_AES)
1231#if DB_VERSION_MINOR < 8
1218 const_iv (XA_CREATE) 1232 const_iv (XA_CREATE)
1233#endif
1219 const_iv (BTREE) 1234 const_iv (BTREE)
1220 const_iv (HASH) 1235 const_iv (HASH)
1221 const_iv (QUEUE) 1236 const_iv (QUEUE)
1222 const_iv (RECNO) 1237 const_iv (RECNO)
1223 const_iv (UNKNOWN) 1238 const_iv (UNKNOWN)
1287 const_iv (LOCK_OLDEST) 1302 const_iv (LOCK_OLDEST)
1288 const_iv (LOCK_RANDOM) 1303 const_iv (LOCK_RANDOM)
1289 const_iv (LOCK_YOUNGEST) 1304 const_iv (LOCK_YOUNGEST)
1290 1305
1291 const_iv (DONOTINDEX) 1306 const_iv (DONOTINDEX)
1292 const_iv (KEYEMPTY ) 1307 const_iv (KEYEMPTY)
1293 const_iv (KEYEXIST ) 1308 const_iv (KEYEXIST)
1294 const_iv (LOCK_DEADLOCK) 1309 const_iv (LOCK_DEADLOCK)
1295 const_iv (LOCK_NOTGRANTED) 1310 const_iv (LOCK_NOTGRANTED)
1296 const_iv (NOSERVER) 1311 const_iv (NOSERVER)
1297 const_iv (NOSERVER_HOME) 1312 const_iv (NOSERVER_HOME)
1298 const_iv (NOSERVER_ID) 1313 const_iv (NOSERVER_ID)
1308 const_iv (REP_UNAVAIL) 1323 const_iv (REP_UNAVAIL)
1309 const_iv (RUNRECOVERY) 1324 const_iv (RUNRECOVERY)
1310 const_iv (SECONDARY_BAD) 1325 const_iv (SECONDARY_BAD)
1311 const_iv (VERIFY_BAD) 1326 const_iv (VERIFY_BAD)
1312 1327
1328 const_iv (SALVAGE)
1329 const_iv (AGGRESSIVE)
1330 const_iv (PRINTABLE)
1331 const_iv (NOORDERCHK)
1332 const_iv (ORDERCHKONLY)
1333
1313 const_iv (ARCH_ABS) 1334 const_iv (ARCH_ABS)
1314 const_iv (ARCH_DATA) 1335 const_iv (ARCH_DATA)
1315 const_iv (ARCH_LOG) 1336 const_iv (ARCH_LOG)
1316 const_iv (ARCH_REMOVE) 1337 const_iv (ARCH_REMOVE)
1317 1338
1321 const_iv (VERB_WAITSFOR) 1342 const_iv (VERB_WAITSFOR)
1322 1343
1323 const_iv (VERSION_MAJOR) 1344 const_iv (VERSION_MAJOR)
1324 const_iv (VERSION_MINOR) 1345 const_iv (VERSION_MINOR)
1325 const_iv (VERSION_PATCH) 1346 const_iv (VERSION_PATCH)
1347 const_iv (LOGVERSION)
1348 const_iv (LOGOLDVER)
1326#if DB_VERSION_MINOR >= 3 1349#if DB_VERSION_MINOR >= 3
1327 const_iv (INORDER) 1350 const_iv (INORDER)
1328 const_iv (LOCK_MAXWRITE) 1351 const_iv (LOCK_MAXWRITE)
1329 const_iv (SEQ_DEC) 1352 const_iv (SEQ_DEC)
1330 const_iv (SEQ_INC) 1353 const_iv (SEQ_INC)
1371 const_iv (LOG_AUTOREMOVE) 1394 const_iv (LOG_AUTOREMOVE)
1372# if DB_VERSION_MINOR >= 3 1395# if DB_VERSION_MINOR >= 3
1373 const_iv (DSYNC_LOG) 1396 const_iv (DSYNC_LOG)
1374 const_iv (LOG_INMEMORY) 1397 const_iv (LOG_INMEMORY)
1375# endif 1398# endif
1399#if DB_VERSION_MINOR >= 8
1400 const_iv (LOGVERSION_LATCHING)
1401#endif
1376#endif 1402#endif
1377 }; 1403 };
1378 1404
1405 bdb_stash = gv_stashpv ("BDB" , 1);
1406 bdb_env_stash = gv_stashpv ("BDB::Env" , 1);
1407 bdb_txn_stash = gv_stashpv ("BDB::Txn" , 1);
1408 bdb_cursor_stash = gv_stashpv ("BDB::Cursor" , 1);
1409 bdb_db_stash = gv_stashpv ("BDB::Db" , 1);
1410 bdb_sequence_stash = gv_stashpv ("BDB::Sequence", 1);
1411
1379 for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) 1412 for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; )
1380 newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); 1413 newCONSTSUB (bdb_stash, (char *)civ->name, newSViv (civ->iv));
1381 1414
1382 prepare_cb = &PL_sv_undef; 1415 prepare_cb = &PL_sv_undef;
1383 1416
1384 { 1417 {
1385 /* we currently only allow version, minor-version and patchlevel to go up to 255 */ 1418 /* we currently only allow version, minor-version and patchlevel to go up to 255 */
1386 char vstring[3] = { DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH }; 1419 char vstring[3] = { DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH };
1387 1420
1388 newCONSTSUB (stash, "VERSION_v", newSVpvn (vstring, 3)); 1421 newCONSTSUB (bdb_stash, "VERSION_v", newSVpvn (vstring, 3));
1389 } 1422 }
1390 1423
1391 newCONSTSUB (stash, "VERSION_STRING", newSVpv (DB_VERSION_STRING, 0)); 1424 newCONSTSUB (bdb_stash, "VERSION_STRING", newSVpv (DB_VERSION_STRING, 0));
1392 1425
1393 create_respipe (); 1426 create_respipe ();
1394 1427
1395 X_THREAD_ATFORK (atfork_prepare, atfork_parent, atfork_child); 1428 X_THREAD_ATFORK (atfork_prepare, atfork_parent, atfork_child);
1396 patch_errno (); 1429 patch_errno ();
1474 1507
1475int 1508int
1476poll_fileno () 1509poll_fileno ()
1477 PROTOTYPE: 1510 PROTOTYPE:
1478 CODE: 1511 CODE:
1479 RETVAL = respipe [0]; 1512 RETVAL = s_epipe_fd (&respipe);
1480 OUTPUT: 1513 OUTPUT:
1481 RETVAL 1514 RETVAL
1482 1515
1483int 1516int
1484poll_cb (...) 1517poll_cb (...)
1762 req->uint1 = flags; 1795 req->uint1 = flags;
1763 REQ_SEND; 1796 REQ_SEND;
1764} 1797}
1765 1798
1766void 1799void
1800db_verify (DB *db, bdb_filename file, bdb_filename database = 0, SV *dummy = 0, U32 flags = 0, SV *callback = 0)
1801 PREINIT:
1802 CALLBACK
1803 CODE:
1804{
1805 dREQ (REQ_DB_VERIFY, 1);
1806 ptr_nuke (ST (0)); /* verify destroys the database handle, hopefully it is freed as well */
1807 req->db = db;
1808 req->buf1 = strdup (file);
1809 req->buf2 = strdup_ornull (database);
1810 req->uint1 = flags;
1811 REQ_SEND;
1812}
1813
1814void
1767db_upgrade (DB *db, bdb_filename file, U32 flags = 0, SV *callback = 0) 1815db_upgrade (DB *db, bdb_filename file, U32 flags = 0, SV *callback = 0)
1768 PREINIT: 1816 PREINIT:
1769 CALLBACK 1817 CALLBACK
1770 CODE: 1818 CODE:
1771{ 1819{
1772 dREQ (REQ_DB_SYNC, 1); 1820 dREQ (REQ_DB_UPGRADE, 1);
1773 req->db = db; 1821 req->db = db;
1774 req->buf1 = strdup (file); 1822 req->buf1 = strdup (file);
1775 req->uint1 = flags; 1823 req->uint1 = flags;
1776 REQ_SEND; 1824 REQ_SEND;
1777} 1825}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines