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

Comparing BDB/BDB.xs (file contents):
Revision 1.26 by root, Mon Dec 10 21:19:07 2007 UTC vs.
Revision 1.27 by root, Mon Dec 17 06:31:43 2007 UTC

479 SPAGAIN; 479 SPAGAIN;
480 480
481 if (count != 2) 481 if (count != 2)
482 croak ("prepare callback must return exactly two values\n"); 482 croak ("prepare callback must return exactly two values\n");
483 483
484 wait_callback = SvREFCNT_inc (POPs); 484 wait_callback = POPs;
485 SvREFCNT_dec (req->callback); 485 SvREFCNT_dec (req->callback);
486 req->callback = SvREFCNT_inc (POPs); 486 req->callback = SvREFCNT_inc (POPs);
487 } 487 }
488 488
489 ++nreqs; 489 ++nreqs;
500 { 500 {
501 dSP; 501 dSP;
502 PUSHMARK (SP); 502 PUSHMARK (SP);
503 PUTBACK; 503 PUTBACK;
504 call_sv (wait_callback, G_DISCARD); 504 call_sv (wait_callback, G_DISCARD);
505 SvREFCNT_dec (wait_callback);
506 } 505 }
507} 506}
508 507
509static void end_thread (void) 508static void end_thread (void)
510{ 509{
1028 const_iv (GET_BOTH_RANGE) 1027 const_iv (GET_BOTH_RANGE)
1029 //const_iv (SET_RECNO) 1028 //const_iv (SET_RECNO)
1030 //const_iv (MULTIPLE) 1029 //const_iv (MULTIPLE)
1031 const_iv (SNAPSHOT) 1030 const_iv (SNAPSHOT)
1032 const_iv (JOIN_ITEM) 1031 const_iv (JOIN_ITEM)
1032 const_iv (JOIN_NOSORT)
1033 const_iv (RMW) 1033 const_iv (RMW)
1034 1034
1035 const_iv (NOTFOUND) 1035 const_iv (NOTFOUND)
1036 const_iv (KEYEMPTY) 1036 const_iv (KEYEMPTY)
1037 const_iv (LOCK_DEADLOCK) 1037 const_iv (LOCK_DEADLOCK)
1053 const_iv (TXN_SYNC) 1053 const_iv (TXN_SYNC)
1054 1054
1055 const_iv (SET_LOCK_TIMEOUT) 1055 const_iv (SET_LOCK_TIMEOUT)
1056 const_iv (SET_TXN_TIMEOUT) 1056 const_iv (SET_TXN_TIMEOUT)
1057 1057
1058 const_iv (JOIN_ITEM)
1059 const_iv (FIRST) 1058 const_iv (FIRST)
1060 const_iv (NEXT) 1059 const_iv (NEXT)
1061 const_iv (NEXT_DUP) 1060 const_iv (NEXT_DUP)
1062 const_iv (NEXT_NODUP) 1061 const_iv (NEXT_NODUP)
1063 const_iv (PREV) 1062 const_iv (PREV)
1129 const_iv (MULTIVERSION) 1128 const_iv (MULTIVERSION)
1130 const_iv (TXN_SNAPSHOT) 1129 const_iv (TXN_SNAPSHOT)
1131#endif 1130#endif
1132#if DB_VERSION_MINOR >= 6 1131#if DB_VERSION_MINOR >= 6
1133 const_iv (PREV_DUP) 1132 const_iv (PREV_DUP)
1134# if 0
1135 const_iv (PRIORITY_UNCHANGED) 1133 const_iv (PRIORITY_UNCHANGED)
1136 const_iv (PRIORITY_VERY_LOW) 1134 const_iv (PRIORITY_VERY_LOW)
1137 const_iv (PRIORITY_LOW) 1135 const_iv (PRIORITY_LOW)
1138 const_iv (PRIORITY_DEFAULT) 1136 const_iv (PRIORITY_DEFAULT)
1139 const_iv (PRIORITY_HIGH) 1137 const_iv (PRIORITY_HIGH)
1140 const_iv (PRIORITY_VERY_HIGH) 1138 const_iv (PRIORITY_VERY_HIGH)
1141# endif
1142#endif 1139#endif
1143 }; 1140 };
1144 1141
1145 for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) 1142 for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; )
1146 newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); 1143 newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv));
1496 1493
1497void 1494void
1498db_get (DB *db, DB_TXN_ornull *txn, SV *key, SV *data, U32 flags = 0, SV *callback = &PL_sv_undef) 1495db_get (DB *db, DB_TXN_ornull *txn, SV *key, SV *data, U32 flags = 0, SV *callback = &PL_sv_undef)
1499 CODE: 1496 CODE:
1500{ 1497{
1498 if (SvREADONLY (data))
1499 croak ("can't modify read-only data scalar in db_get");
1500
1501 dREQ (REQ_DB_GET); 1501 dREQ (REQ_DB_GET);
1502 req->db = db; 1502 req->db = db;
1503 req->txn = txn; 1503 req->txn = txn;
1504 req->uint1 = flags; 1504 req->uint1 = flags;
1505 sv_to_dbt (&req->dbt1, key); 1505 sv_to_dbt (&req->dbt1, key);
1510 1510
1511void 1511void
1512db_pget (DB *db, DB_TXN_ornull *txn, SV *key, SV *pkey, SV *data, U32 flags = 0, SV *callback = &PL_sv_undef) 1512db_pget (DB *db, DB_TXN_ornull *txn, SV *key, SV *pkey, SV *data, U32 flags = 0, SV *callback = &PL_sv_undef)
1513 CODE: 1513 CODE:
1514{ 1514{
1515 if (SvREADONLY (data))
1516 croak ("can't modify read-only data scalar in db_pget");
1517
1515 dREQ (REQ_DB_PGET); 1518 dREQ (REQ_DB_PGET);
1516 req->db = db; 1519 req->db = db;
1517 req->txn = txn; 1520 req->txn = txn;
1518 req->uint1 = flags; 1521 req->uint1 = flags;
1519 sv_to_dbt (&req->dbt1, key); 1522 sv_to_dbt (&req->dbt1, key);
2000DESTROY (DBC_ornull *dbc) 2003DESTROY (DBC_ornull *dbc)
2001 CODE: 2004 CODE:
2002 if (dbc) 2005 if (dbc)
2003 dbc->c_close (dbc); 2006 dbc->c_close (dbc);
2004 2007
2008#if DB_VERSION_MINOR >= 6
2009
2010int set_priority (DBC *dbc, int priority)
2011 CODE:
2012 dbc->set_priority (dbc, priority);
2013
2014#endif
2015
2005MODULE = BDB PACKAGE = BDB::Sequence 2016MODULE = BDB PACKAGE = BDB::Sequence
2006 2017
2007void 2018void
2008DESTROY (DB_SEQUENCE_ornull *seq) 2019DESTROY (DB_SEQUENCE_ornull *seq)
2009 CODE: 2020 CODE:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines