diff options
author | Paul Marquess <paul.marquess@btinternet.com> | 1999-08-03 23:55:00 +0100 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 1999-08-04 08:13:20 +0000 |
commit | a62982a846c50953d49f512fd1ec36e63b0a9e81 (patch) | |
tree | f056d265bbed760cefa0f914b6859a9ad86b1941 /ext/DB_File | |
parent | 423cee853811c26846bd1948939b85f9866dfb4a (diff) | |
download | perl-a62982a846c50953d49f512fd1ec36e63b0a9e81.tar.gz |
(Replaced by change #3921)
To: gsar@activestate.com
Cc: perl5-porters@perl.org
Subject: [PATCH 5.005_60] DB_File 1.69
Message-ID: <5104D4DBC598D211B5FE0000F8FE7EB29C6D04@mbtlipnt02.btlabs.bt.co.uk>
p4raw-link: @3921 (not found)
p4raw-id: //depot/cfgperl@3917
Diffstat (limited to 'ext/DB_File')
-rw-r--r-- | ext/DB_File/Changes | 7 | ||||
-rw-r--r-- | ext/DB_File/DB_File.pm | 6 | ||||
-rw-r--r-- | ext/DB_File/DB_File.xs | 27 |
3 files changed, 31 insertions, 9 deletions
diff --git a/ext/DB_File/Changes b/ext/DB_File/Changes index c5cf329080..462056a34b 100644 --- a/ext/DB_File/Changes +++ b/ext/DB_File/Changes @@ -255,3 +255,10 @@ 2 databases. * Added some of the examples in the POD into the test harness. + +1.69 3rd August 1999 + + * fixed a bug in push -- DB_APPEND wasn't working properly. + * Fixed the R_SETCURSOR bug introduced in 1.68 + * Added a new Perl variable $DB_File::db_ver + diff --git a/ext/DB_File/DB_File.pm b/ext/DB_File/DB_File.pm index 6c78098b6f..c2b7b09921 100644 --- a/ext/DB_File/DB_File.pm +++ b/ext/DB_File/DB_File.pm @@ -1,8 +1,8 @@ # DB_File.pm -- Perl 5 interface to Berkeley DB # # written by Paul Marquess (Paul.Marquess@btinternet.com) -# last modified 22nd July 1999 -# version 1.68 +# last modified 3rd August 1999 +# version 1.69 # # Copyright (c) 1995-1999 Paul Marquess. All rights reserved. # This program is free software; you can redistribute it and/or @@ -145,7 +145,7 @@ use vars qw($VERSION @ISA @EXPORT $AUTOLOAD $DB_BTREE $DB_HASH $DB_RECNO $db_ver use Carp; -$VERSION = "1.68" ; +$VERSION = "1.69" ; #typedef enum { DB_BTREE, DB_HASH, DB_RECNO } DBTYPE; $DB_BTREE = new DB_File::BTREEINFO ; diff --git a/ext/DB_File/DB_File.xs b/ext/DB_File/DB_File.xs index b8c820a48c..1223ad446e 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 22nd July 1999 - version 1.68 + last modified 3rd August 1999 + version 1.69 All comments/suggestions/problems are welcome @@ -71,6 +71,10 @@ Fixed a small memory leak in the filter code. 1.68 - fixed backward compatability bug with R_IAFTER & R_IBEFORE merged in the 5.005_58 changes + 1.69 - fixed a bug in push -- DB_APPEND wasn't working properly. + Fixed the R_SETCURSOR bug introduced in 1.68 + Added a new Perl variable $DB_File::db_ver + @@ -161,7 +165,11 @@ typedef db_recno_t recno_t; #define R_NEXT DB_NEXT #define R_NOOVERWRITE DB_NOOVERWRITE #define R_PREV DB_PREV -#define R_SETCURSOR (-1 ) +#if DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR < 5 +#define R_SETCURSOR 0x800000 +#else +#define R_SETCURSOR (-100) +#endif #define R_RECNOSYNC 0 #define R_FIXEDLEN DB_FIXEDLEN #define R_DUP DB_DUP @@ -271,7 +279,8 @@ typedef union INFO { #define db_get(db, key, value, flags) ((db->dbp)->get)(db->dbp, TXN &key, &value, flags) #ifdef DB_VERSION_MAJOR -#define db_DESTROY(db) ((db->dbp)->close)(db->dbp, 0) +#define db_DESTROY(db) ( db->cursor->c_close(db->cursor),\ + db->dbp->close(db->dbp, 0) ) #define db_close(db) ((db->dbp)->close)(db->dbp, 0) #define db_del(db, key, flags) (flagSet(flags, R_CURSOR) \ ? ((db->cursor)->c_del)(db->cursor, 0) \ @@ -432,7 +441,8 @@ u_int flags ; static void GetVersionInfo(pTHX) { - SV * ver_sv = perl_get_sv("DB_File::db_version", TRUE) ; + SV * version_sv = perl_get_sv("DB_File::db_version", TRUE) ; + SV * ver_sv = perl_get_sv("DB_File::db_ver", TRUE) ; #ifdef DB_VERSION_MAJOR int Major, Minor, Patch ; @@ -444,16 +454,20 @@ GetVersionInfo(pTHX) Major, Minor, Patch) ; #if PERL_VERSION > 3 - sv_setpvf(ver_sv, "%d.%d", Major, Minor) ; + sv_setpvf(version_sv, "%d.%d", Major, Minor) ; + sv_setpvf(ver_sv, "%d.%03d%03d", Major, Minor, Patch) ; #else { char buffer[40] ; sprintf(buffer, "%d.%d", Major, Minor) ; + sv_setpv(version_sv, buffer) ; + sprintf(buffer, "%d.%03d%03d", Major, Minor, Patch) ; sv_setpv(ver_sv, buffer) ; } #endif #else + sv_setiv(version_sv, 1) ; sv_setiv(ver_sv, 1) ; #endif @@ -1522,6 +1536,7 @@ push(db, ...) DBT_flags(value) ; CurrentDB = db ; #ifdef DB_VERSION_MAJOR + RETVAL = do_SEQ(db, key, value, DB_LAST) ; RETVAL = 0 ; key = empty ; for (i = 1 ; i < items ; ++i) |