From 4fcbc3669aa997848e15198cc9fb856287a6788c Mon Sep 17 00:00:00 2001 From: markm Date: Wed, 9 Sep 1998 07:00:04 +0000 Subject: Initial import of Perl5. The king is dead; long live the king! --- contrib/perl5/ext/GDBM_File/GDBM_File.pm | 87 ++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 contrib/perl5/ext/GDBM_File/GDBM_File.pm (limited to 'contrib/perl5/ext/GDBM_File/GDBM_File.pm') diff --git a/contrib/perl5/ext/GDBM_File/GDBM_File.pm b/contrib/perl5/ext/GDBM_File/GDBM_File.pm new file mode 100644 index 0000000..09df437 --- /dev/null +++ b/contrib/perl5/ext/GDBM_File/GDBM_File.pm @@ -0,0 +1,87 @@ +# GDBM_File.pm -- Perl 5 interface to GNU gdbm library. + +=head1 NAME + +GDBM_File - Perl5 access to the gdbm library. + +=head1 SYNOPSIS + + use GDBM_File ; + tie %hash, 'GDBM_File', $filename, &GDBM_WRCREAT, 0640; + # Use the %hash array. + untie %hash ; + +=head1 DESCRIPTION + +B is a module which allows Perl programs to make use of the +facilities provided by the GNU gdbm library. If you intend to use this +module you should really have a copy of the gdbm manualpage at hand. + +Most of the libgdbm.a functions are available through the GDBM_File +interface. + +=head1 AVAILABILITY + +Gdbm is available from any GNU archive. The master site is +C, but your are strongly urged to use one of the many +mirrors. You can obtain a list of mirror sites by issuing the +command C. + +=head1 BUGS + +The available functions and the gdbm/perl interface need to be documented. + +=head1 SEE ALSO + +L, L. + +=cut + +package GDBM_File; + +use strict; +use vars qw($VERSION @ISA @EXPORT $AUTOLOAD); + +require Carp; +require Tie::Hash; +require Exporter; +use AutoLoader; +require DynaLoader; +@ISA = qw(Tie::Hash Exporter DynaLoader); +@EXPORT = qw( + GDBM_CACHESIZE + GDBM_FAST + GDBM_INSERT + GDBM_NEWDB + GDBM_READER + GDBM_REPLACE + GDBM_WRCREAT + GDBM_WRITER +); + +$VERSION = "1.00"; + +sub AUTOLOAD { + my($constname); + ($constname = $AUTOLOAD) =~ s/.*:://; + my $val = constant($constname, @_ ? $_[0] : 0); + if ($! != 0) { + if ($! =~ /Invalid/) { + $AutoLoader::AUTOLOAD = $AUTOLOAD; + goto &AutoLoader::AUTOLOAD; + } + else { + Carp::croak("Your vendor has not defined GDBM_File macro $constname, used"); + } + } + eval "sub $AUTOLOAD { $val }"; + goto &$AUTOLOAD; +} + +bootstrap GDBM_File $VERSION; + +# Preloaded methods go here. Autoload methods go after __END__, and are +# processed by the autosplit program. + +1; +__END__ -- cgit v1.1