diff options
author | Malcolm Beattie <mbeattie@sable.ox.ac.uk> | 1997-10-08 10:19:27 +0000 |
---|---|---|
committer | Malcolm Beattie <mbeattie@sable.ox.ac.uk> | 1997-10-08 10:19:27 +0000 |
commit | 93af7a870f71dbbb13443b4087703de0221add17 (patch) | |
tree | e767c53d4d4f1783640e5410f94655e45b58b3d0 /ext/DB_File | |
parent | c116a00cf797ec2e6795338ee18b88d975e760c5 (diff) | |
parent | 2269e8ecc334a5a77bdb915666547431c0171402 (diff) | |
download | perl-93af7a870f71dbbb13443b4087703de0221add17.tar.gz |
Merge maint-5.004 branch (5.004_03) with mainline.
MANIFEST is out of sync.
p4raw-id: //depot/perl@114
Diffstat (limited to 'ext/DB_File')
-rw-r--r-- | ext/DB_File/DB_File.pm | 38 | ||||
-rw-r--r-- | ext/DB_File/DB_File.xs | 17 | ||||
-rw-r--r-- | ext/DB_File/typemap | 2 |
3 files changed, 37 insertions, 20 deletions
diff --git a/ext/DB_File/DB_File.pm b/ext/DB_File/DB_File.pm index e097046718..9ed5185c6d 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 (pmarquess@bfsec.bt.co.uk) -# last modified 31st May 1997 -# version 1.15 +# last modified 8th Oct 1997 +# version 1.16 # # Copyright (c) 1995, 1996, 1997 Paul Marquess. All rights reserved. # This program is free software; you can redistribute it and/or @@ -98,7 +98,6 @@ sub NotHere croak ref($self) . " does not define the method ${method}" ; } -sub DESTROY { undef %{$_[0]} } sub FIRSTKEY { my $self = shift ; $self->NotHere("FIRSTKEY") } sub NEXTKEY { my $self = shift ; $self->NotHere("NEXTKEY") } sub CLEAR { my $self = shift ; $self->NotHere("CLEAR") } @@ -212,17 +211,13 @@ sub AUTOLOAD { } -# import borrowed from IO::File -# exports Fcntl constants if available. -sub import { - my $pkg = shift; - my $callpkg = caller; - Exporter::export $pkg, $callpkg, @_; - eval { - require Fcntl; - Exporter::export 'Fcntl', $callpkg, '/^O_/'; - }; -} +eval { + # Make all Fcntl O_XXX constants available for importing + require Fcntl; + my @O = grep /^O_/, @Fcntl::EXPORT; + Fcntl->import(@O); # first we import what we want to export + push(@EXPORT, @O); +}; bootstrap DB_File $VERSION; @@ -1668,6 +1663,21 @@ ordinary array to a HASH or BTREE database. =item 1.15 +Patch from Gisle Aas <gisle@aas.no> to suppress "use of undefined +value" warning with db_get and db_seq. + +Patch from Gisle Aas <gisle@aas.no> to make DB_File export only the O_* +constants from Fcntl. + +Removed the DESTROY method from the DB_File::HASHINFO module. + +Previously DB_File hard-wired the class name of any object that it +created to "DB_File". This makes sub-classing difficult. Now DB_File +creats objects in the namespace of the package it has been inherited +into. + +=item 1.16 + Minor changes to DB_File.xs to support multithreaded perl. =back diff --git a/ext/DB_File/DB_File.xs b/ext/DB_File/DB_File.xs index cc70b5d7b9..bd0c933329 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 (pmarquess@bfsec.bt.co.uk) - last modified 31st May 1997 - version 1.15 + last modified 8th Oct 1997 + version 1.16 All comments/suggestions/problems are welcome @@ -42,7 +42,9 @@ 1.13 - Tidied up a few casts. 1.14 - Made it illegal to tie an associative array to a RECNO database and an ordinary array to a HASH or BTREE database. - 1.15 - Minor additions to DB_File.xs to support multithreaded perl. + 1.15 - Patch from Gisle Aas <gisle@aas.no> to suppress "use of + undefined value" warning with db_get and db_seq. + 1.16 - Minor additions to DB_File.xs to support multithreaded perl. */ @@ -51,6 +53,9 @@ #include "XSUB.h" #include <db.h> +/* #ifdef DB_VERSION_MAJOR */ +/* #include <db_185.h> */ +/* #endif */ #include <fcntl.h> @@ -88,7 +93,7 @@ typedef DB_File_type * DB_File ; typedef DBT DBTKEY ; -/* #define TRACE */ +/* #define TRACE */ #define db_DESTROY(db) ((db->dbp)->close)(db->dbp) #define db_DELETE(db, key, flags) ((db->dbp)->del)(db->dbp, &key, flags) @@ -1066,7 +1071,7 @@ int db_get(db, key, value, flags=0) DB_File db DBTKEY key - DBT value + DBT value = NO_INIT u_int flags INIT: CurrentDB = db ; @@ -1102,7 +1107,7 @@ int db_seq(db, key, value, flags) DB_File db DBTKEY key - DBT value + DBT value = NO_INIT u_int flags INIT: CurrentDB = db ; diff --git a/ext/DB_File/typemap b/ext/DB_File/typemap index 5ca9c54f72..a6212243de 100644 --- a/ext/DB_File/typemap +++ b/ext/DB_File/typemap @@ -34,3 +34,5 @@ T_dbtkeydatum OutputKey($arg, $var) T_dbtdatum OutputValue($arg, $var) +T_PTROBJ + sv_setref_pv($arg, dbtype, (void*)$var); |