summaryrefslogtreecommitdiff
path: root/ext/DB_File/DB_File.xs
diff options
context:
space:
mode:
authorPaul Marquess <paul.marquess@btinternet.com>2000-12-17 19:11:44 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2000-12-19 17:49:50 +0000
commit73969f8fab365da08c6e9add280e110329b576aa (patch)
tree23b7853df679147f9130e27ab3093d7b49d9fe35 /ext/DB_File/DB_File.xs
parent7731a3b965af3c0f91811bd4fbd5cda1e01d8fb0 (diff)
downloadperl-73969f8fab365da08c6e9add280e110329b576aa.tar.gz
DB_File-1.75 (was RE: [8104] DB_File)
Message-ID: <000801c0685d$3224e5a0$a20a140a@bfs.phone.com> p4raw-id: //depot/perl@8196
Diffstat (limited to 'ext/DB_File/DB_File.xs')
-rw-r--r--ext/DB_File/DB_File.xs61
1 files changed, 58 insertions, 3 deletions
diff --git a/ext/DB_File/DB_File.xs b/ext/DB_File/DB_File.xs
index 5ba18f395d..fa3bb336c2 100644
--- a/ext/DB_File/DB_File.xs
+++ b/ext/DB_File/DB_File.xs
@@ -3,8 +3,8 @@
DB_File.xs -- Perl 5 interface to Berkeley DB
written by Paul Marquess <Paul.Marquess@btinternet.com>
- last modified 10 December 2000
- version 1.74
+ last modified 17 December 2000
+ version 1.75
All comments/suggestions/problems are welcome
@@ -86,6 +86,10 @@
1.74 - A call to open needed parenthesised to stop it clashing
with a win32 macro.
Added Perl core patches 7703 & 7801.
+ 1.75 - Fixed Perl core patch 7703.
+ Added suppport to allow DB_File to be built with
+ Berkeley DB 3.2 -- btree_compare, btree_prefix and hash_cb
+ needed to be changed.
*/
@@ -166,6 +170,10 @@ extern void __getBerkeleyDBInfo(void);
# define BERKELEY_DB_1_OR_2
#endif
+#if DB_VERSION_MAJOR > 3 || (DB_VERSION_MAJOR == 3 && DB_VERSION_MINOR >= 2)
+# define AT_LEAST_DB_3_2
+#endif
+
/* map version 2 features & constants onto their version 1 equivalent */
#ifdef DB_Prefix_t
@@ -251,6 +259,7 @@ typedef db_recno_t recno_t;
#else /* db version 1.x */
+#define BERKELEY_DB_1
#define BERKELEY_DB_1_OR_2
typedef union INFO {
@@ -480,6 +489,19 @@ u_int flags ;
static int
+#ifdef AT_LEAST_DB_3_2
+
+#ifdef CAN_PROTOTYPE
+btree_compare(DB * db, const DBT *key1, const DBT *key2)
+#else
+btree_compare(db, key1, key2)
+DB * db ;
+const DBT * key1 ;
+const DBT * key2 ;
+#endif /* CAN_PROTOTYPE */
+
+#else /* Berkeley DB < 3.2 */
+
#ifdef CAN_PROTOTYPE
btree_compare(const DBT *key1, const DBT *key2)
#else
@@ -487,6 +509,9 @@ btree_compare(key1, key2)
const DBT * key1 ;
const DBT * key2 ;
#endif
+
+#endif
+
{
#ifdef dTHX
dTHX;
@@ -536,6 +561,19 @@ const DBT * key2 ;
}
static DB_Prefix_t
+#ifdef AT_LEAST_DB_3_2
+
+#ifdef CAN_PROTOTYPE
+btree_prefix(DB * db, const DBT *key1, const DBT *key2)
+#else
+btree_prefix(db, key1, key2)
+Db * db ;
+const DBT * key1 ;
+const DBT * key2 ;
+#endif
+
+#else /* Berkeley DB < 3.2 */
+
#ifdef CAN_PROTOTYPE
btree_prefix(const DBT *key1, const DBT *key2)
#else
@@ -543,6 +581,8 @@ btree_prefix(key1, key2)
const DBT * key1 ;
const DBT * key2 ;
#endif
+
+#endif
{
#ifdef dTHX
dTHX;
@@ -592,13 +632,26 @@ const DBT * key2 ;
}
-#if defined(BERKELEY_DB_1_OR_2) && !(DB_VERSION_MINOR == 7 && DB_VERSION_PATCH >= 7)
+#ifdef BERKELEY_DB_1
# define HASH_CB_SIZE_TYPE size_t
#else
# define HASH_CB_SIZE_TYPE u_int32_t
#endif
static DB_Hash_t
+#ifdef AT_LEAST_DB_3_2
+
+#ifdef CAN_PROTOTYPE
+hash_cb(DB * db, const void *data, u_int32_t size)
+#else
+hash_cb(db, data, size)
+DB * db ;
+const void * data ;
+HASH_CB_SIZE_TYPE size ;
+#endif
+
+#else /* Berkeley DB < 3.2 */
+
#ifdef CAN_PROTOTYPE
hash_cb(const void *data, HASH_CB_SIZE_TYPE size)
#else
@@ -606,6 +659,8 @@ hash_cb(data, size)
const void * data ;
HASH_CB_SIZE_TYPE size ;
#endif
+
+#endif
{
#ifdef dTHX
dTHX;