diff options
Diffstat (limited to 'contrib/perl5/ext/NDBM_File')
-rw-r--r-- | contrib/perl5/ext/NDBM_File/Makefile.PL | 9 | ||||
-rw-r--r-- | contrib/perl5/ext/NDBM_File/NDBM_File.pm | 113 | ||||
-rw-r--r-- | contrib/perl5/ext/NDBM_File/NDBM_File.xs | 173 | ||||
-rw-r--r-- | contrib/perl5/ext/NDBM_File/hints/cygwin.pl | 2 | ||||
-rw-r--r-- | contrib/perl5/ext/NDBM_File/hints/dec_osf.pl | 2 | ||||
-rw-r--r-- | contrib/perl5/ext/NDBM_File/hints/dynixptx.pl | 3 | ||||
-rw-r--r-- | contrib/perl5/ext/NDBM_File/hints/sco.pl | 4 | ||||
-rw-r--r-- | contrib/perl5/ext/NDBM_File/hints/solaris.pl | 3 | ||||
-rw-r--r-- | contrib/perl5/ext/NDBM_File/hints/svr4.pl | 4 | ||||
-rw-r--r-- | contrib/perl5/ext/NDBM_File/typemap | 43 |
10 files changed, 0 insertions, 356 deletions
diff --git a/contrib/perl5/ext/NDBM_File/Makefile.PL b/contrib/perl5/ext/NDBM_File/Makefile.PL deleted file mode 100644 index 7b58601..0000000 --- a/contrib/perl5/ext/NDBM_File/Makefile.PL +++ /dev/null @@ -1,9 +0,0 @@ -use ExtUtils::MakeMaker; -WriteMakefile( - NAME => 'NDBM_File', - LIBS => ["-L/usr/local/lib -lndbm", "-ldbm -lucb"], - MAN3PODS => {}, # Pods will be built by installman. - XSPROTOARG => '-noprototypes', # XXX remove later? - VERSION_FROM => 'NDBM_File.pm', - INC => ($^O eq "MacOS" ? "-i ::::db:include" : "") -); diff --git a/contrib/perl5/ext/NDBM_File/NDBM_File.pm b/contrib/perl5/ext/NDBM_File/NDBM_File.pm deleted file mode 100644 index b280459..0000000 --- a/contrib/perl5/ext/NDBM_File/NDBM_File.pm +++ /dev/null @@ -1,113 +0,0 @@ -package NDBM_File; - -use strict; -use warnings; - -require Tie::Hash; -use XSLoader (); - -our @ISA = qw(Tie::Hash); -our $VERSION = "1.04"; - -XSLoader::load 'NDBM_File', $VERSION; - -1; - -__END__ - -=head1 NAME - -NDBM_File - Tied access to ndbm files - -=head1 SYNOPSIS - - use Fcntl; # For O_RDWR, O_CREAT, etc. - use NDBM_File; - - # Now read and change the hash - $h{newkey} = newvalue; - print $h{oldkey}; - ... - - untie %h; - -=head1 DESCRIPTION - -C<NDBM_File> establishes a connection between a Perl hash variable and -a file in NDBM_File format;. You can manipulate the data in the file -just as if it were in a Perl hash, but when your program exits, the -data will remain in the file, to be used the next time your program -runs. - -Use C<NDBM_File> with the Perl built-in C<tie> function to establish -the connection between the variable and the file. The arguments to -C<tie> should be: - -=over 4 - -=item 1. - -The hash variable you want to tie. - -=item 2. - -The string C<"NDBM_File">. (Ths tells Perl to use the C<NDBM_File> -package to perform the functions of the hash.) - -=item 3. - -The name of the file you want to tie to the hash. - -=item 4. - -Flags. Use one of: - -=over 2 - -=item C<O_RDONLY> - -Read-only access to the data in the file. - -=item C<O_WRONLY> - -Write-only access to the data in the file. - -=item C<O_RDWR> - -Both read and write access. - -=back - -If you want to create the file if it does not exist, add C<O_CREAT> to -any of these, as in the example. If you omit C<O_CREAT> and the file -does not already exist, the C<tie> call will fail. - -=item 5. - -The default permissions to use if a new file is created. The actual -permissions will be modified by the user's umask, so you should -probably use 0666 here. (See L<perlfunc/umask>.) - -=back - -=head1 DIAGNOSTICS - -On failure, the C<tie> call returns an undefined value and probably -sets C<$!> to contain the reason the file could not be tied. - -=head2 C<ndbm store returned -1, errno 22, key "..." at ...> - -This warning is emmitted when you try to store a key or a value that -is too long. It means that the change was not recorded in the -database. See BUGS AND WARNINGS below. - -=head1 BUGS AND WARNINGS - -There are a number of limits on the size of the data that you can -store in the NDBM file. The most important is that the length of a -key, plus the length of its associated value, may not exceed 1008 -bytes. - -See L<perlfunc/tie>, L<perldbmfilter>, L<Fcntl> - -=cut diff --git a/contrib/perl5/ext/NDBM_File/NDBM_File.xs b/contrib/perl5/ext/NDBM_File/NDBM_File.xs deleted file mode 100644 index c417eb6..0000000 --- a/contrib/perl5/ext/NDBM_File/NDBM_File.xs +++ /dev/null @@ -1,173 +0,0 @@ -#include "EXTERN.h" -#include "perl.h" -#include "XSUB.h" -/* If using the DB3 emulation, ENTER is defined both - * by DB3 and Perl. We drop the Perl definition now. - * See also INSTALL section on DB3. - * -- Stanislav Brabec <utx@penguin.cz> */ -#undef ENTER -#include <ndbm.h> - -typedef struct { - DBM * dbp ; - SV * filter_fetch_key ; - SV * filter_store_key ; - SV * filter_fetch_value ; - SV * filter_store_value ; - int filtering ; - } NDBM_File_type; - -typedef NDBM_File_type * NDBM_File ; -typedef datum datum_key ; -typedef datum datum_value ; - -#define ckFilter(arg,type,name) \ - if (db->type) { \ - SV * save_defsv ; \ - /* printf("filtering %s\n", name) ;*/ \ - if (db->filtering) \ - croak("recursion detected in %s", name) ; \ - db->filtering = TRUE ; \ - save_defsv = newSVsv(DEFSV) ; \ - sv_setsv(DEFSV, arg) ; \ - PUSHMARK(sp) ; \ - (void) perl_call_sv(db->type, G_DISCARD|G_NOARGS); \ - sv_setsv(arg, DEFSV) ; \ - sv_setsv(DEFSV, save_defsv) ; \ - SvREFCNT_dec(save_defsv) ; \ - db->filtering = FALSE ; \ - /*printf("end of filtering %s\n", name) ;*/ \ - } - - -MODULE = NDBM_File PACKAGE = NDBM_File PREFIX = ndbm_ - -NDBM_File -ndbm_TIEHASH(dbtype, filename, flags, mode) - char * dbtype - char * filename - int flags - int mode - CODE: - { - DBM * dbp ; - - RETVAL = NULL ; - if (dbp = dbm_open(filename, flags, mode)) { - RETVAL = (NDBM_File)safemalloc(sizeof(NDBM_File_type)) ; - Zero(RETVAL, 1, NDBM_File_type) ; - RETVAL->dbp = dbp ; - } - - } - OUTPUT: - RETVAL - -void -ndbm_DESTROY(db) - NDBM_File db - CODE: - dbm_close(db->dbp); - safefree(db); - -#define ndbm_FETCH(db,key) dbm_fetch(db->dbp,key) -datum_value -ndbm_FETCH(db, key) - NDBM_File db - datum_key key - -#define ndbm_STORE(db,key,value,flags) dbm_store(db->dbp,key,value,flags) -int -ndbm_STORE(db, key, value, flags = DBM_REPLACE) - NDBM_File db - datum_key key - datum_value value - int flags - CLEANUP: - if (RETVAL) { - if (RETVAL < 0 && errno == EPERM) - croak("No write permission to ndbm file"); - croak("ndbm store returned %d, errno %d, key \"%s\"", - RETVAL,errno,key.dptr); - dbm_clearerr(db->dbp); - } - -#define ndbm_DELETE(db,key) dbm_delete(db->dbp,key) -int -ndbm_DELETE(db, key) - NDBM_File db - datum_key key - -#define ndbm_FIRSTKEY(db) dbm_firstkey(db->dbp) -datum_key -ndbm_FIRSTKEY(db) - NDBM_File db - -#define ndbm_NEXTKEY(db,key) dbm_nextkey(db->dbp) -datum_key -ndbm_NEXTKEY(db, key) - NDBM_File db - datum_key key - -#define ndbm_error(db) dbm_error(db->dbp) -int -ndbm_error(db) - NDBM_File db - -#define ndbm_clearerr(db) dbm_clearerr(db->dbp) -void -ndbm_clearerr(db) - NDBM_File db - - -#define setFilter(type) \ - { \ - if (db->type) \ - RETVAL = sv_mortalcopy(db->type) ; \ - ST(0) = RETVAL ; \ - if (db->type && (code == &PL_sv_undef)) { \ - SvREFCNT_dec(db->type) ; \ - db->type = NULL ; \ - } \ - else if (code) { \ - if (db->type) \ - sv_setsv(db->type, code) ; \ - else \ - db->type = newSVsv(code) ; \ - } \ - } - - - -SV * -filter_fetch_key(db, code) - NDBM_File db - SV * code - SV * RETVAL = &PL_sv_undef ; - CODE: - setFilter(filter_fetch_key) ; - -SV * -filter_store_key(db, code) - NDBM_File db - SV * code - SV * RETVAL = &PL_sv_undef ; - CODE: - setFilter(filter_store_key) ; - -SV * -filter_fetch_value(db, code) - NDBM_File db - SV * code - SV * RETVAL = &PL_sv_undef ; - CODE: - setFilter(filter_fetch_value) ; - -SV * -filter_store_value(db, code) - NDBM_File db - SV * code - SV * RETVAL = &PL_sv_undef ; - CODE: - setFilter(filter_store_value) ; - diff --git a/contrib/perl5/ext/NDBM_File/hints/cygwin.pl b/contrib/perl5/ext/NDBM_File/hints/cygwin.pl deleted file mode 100644 index 0a4b762..0000000 --- a/contrib/perl5/ext/NDBM_File/hints/cygwin.pl +++ /dev/null @@ -1,2 +0,0 @@ -# uses GDBM ndbm compatibility feature -$self->{LIBS} = ['-lgdbm']; diff --git a/contrib/perl5/ext/NDBM_File/hints/dec_osf.pl b/contrib/perl5/ext/NDBM_File/hints/dec_osf.pl deleted file mode 100644 index e96d907..0000000 --- a/contrib/perl5/ext/NDBM_File/hints/dec_osf.pl +++ /dev/null @@ -1,2 +0,0 @@ -# Spider Boardman <spider@Orb.Nashua.NH.US> -$self->{LIBS} = ['']; diff --git a/contrib/perl5/ext/NDBM_File/hints/dynixptx.pl b/contrib/perl5/ext/NDBM_File/hints/dynixptx.pl deleted file mode 100644 index d402c17..0000000 --- a/contrib/perl5/ext/NDBM_File/hints/dynixptx.pl +++ /dev/null @@ -1,3 +0,0 @@ -# On DYNIX/ptx 4.0 (v4.1.3), ndbm is actually contained in the -# libc library, and must be explicitly linked against -lc when compiling. -$self->{LIBS} = ['-lc']; diff --git a/contrib/perl5/ext/NDBM_File/hints/sco.pl b/contrib/perl5/ext/NDBM_File/hints/sco.pl deleted file mode 100644 index f551578..0000000 --- a/contrib/perl5/ext/NDBM_File/hints/sco.pl +++ /dev/null @@ -1,4 +0,0 @@ -# SCO ODT 3.2v4.2 has a -ldbm library that is missing dbmclose. -# This system should have a complete library installed as -ldbm.nfs which -# should be used instead (Probably need the networking product add-on) -$self->{LIBS} = ['-lndbm',-e "/usr/lib/libdbm.nfs.a"?'-ldbm.nfs':'-ldbm']; diff --git a/contrib/perl5/ext/NDBM_File/hints/solaris.pl b/contrib/perl5/ext/NDBM_File/hints/solaris.pl deleted file mode 100644 index 11310a9..0000000 --- a/contrib/perl5/ext/NDBM_File/hints/solaris.pl +++ /dev/null @@ -1,3 +0,0 @@ -# -lucb has been reported to be fatal for perl5 on Solaris. -# Thus we deliberately don't include it here. -$self->{LIBS} = ["-lndbm", "-ldbm"]; diff --git a/contrib/perl5/ext/NDBM_File/hints/svr4.pl b/contrib/perl5/ext/NDBM_File/hints/svr4.pl deleted file mode 100644 index 3285d9a..0000000 --- a/contrib/perl5/ext/NDBM_File/hints/svr4.pl +++ /dev/null @@ -1,4 +0,0 @@ -# Some SVR4 systems may need to link against routines in -lucb for -# odbm. Some may also need to link against -lc to pick up things like -# ecvt. -$self->{LIBS} = ['-ldbm -lucb -lc']; diff --git a/contrib/perl5/ext/NDBM_File/typemap b/contrib/perl5/ext/NDBM_File/typemap deleted file mode 100644 index 40b95f2..0000000 --- a/contrib/perl5/ext/NDBM_File/typemap +++ /dev/null @@ -1,43 +0,0 @@ -# -#################################### DBM SECTION -# - -datum_key T_DATUM_K -datum_value T_DATUM_V -gdatum T_GDATUM -NDBM_File T_PTROBJ -GDBM_File T_PTROBJ -SDBM_File T_PTROBJ -ODBM_File T_PTROBJ -DB_File T_PTROBJ -DBZ_File T_PTROBJ -FATALFUNC T_OPAQUEPTR - -INPUT -T_DATUM_K - ckFilter($arg, filter_store_key, \"filter_store_key\"); - $var.dptr = SvPV($arg, PL_na); - $var.dsize = (int)PL_na; -T_DATUM_V - ckFilter($arg, filter_store_value, \"filter_store_value\"); - if (SvOK($arg)) { - $var.dptr = SvPV($arg, PL_na); - $var.dsize = (int)PL_na; - } - else { - $var.dptr = \"\"; - $var.dsize = 0; - } -T_GDATUM - UNIMPLEMENTED -OUTPUT -T_DATUM_K - sv_setpvn($arg, $var.dptr, $var.dsize); - ckFilter($arg, filter_fetch_key,\"filter_fetch_key\"); -T_DATUM_V - sv_setpvn($arg, $var.dptr, $var.dsize); - ckFilter($arg, filter_fetch_value,\"filter_fetch_value\"); -T_GDATUM - sv_usepvn($arg, $var.dptr, $var.dsize); -T_PTROBJ - sv_setref_pv($arg, dbtype, (void*)$var); |