From: Paul Marquess Date: Tue, 8 Jun 1999 22:34:01 +0000 (+0100) Subject: DBM Filters X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e62f7e435fed297897e82caa3159e7f13edf50c2;p=p5sagit%2Fp5-mst-13.2.git DBM Filters Message-ID: <5104D4DBC598D211B5FE0000F8FE7EB29C6C3B@mbtlipnt02.btlabs.bt.co.uk> p4raw-id: //depot/perl@3603 --- diff --git a/ext/GDBM_File/GDBM_File.pm b/ext/GDBM_File/GDBM_File.pm index 42bb6d2..aff0152 100644 --- a/ext/GDBM_File/GDBM_File.pm +++ b/ext/GDBM_File/GDBM_File.pm @@ -59,7 +59,7 @@ require DynaLoader; GDBM_WRITER ); -$VERSION = "1.02"; +$VERSION = "1.03"; sub AUTOLOAD { my($constname); diff --git a/ext/GDBM_File/GDBM_File.xs b/ext/GDBM_File/GDBM_File.xs index db28891..be1817b 100644 --- a/ext/GDBM_File/GDBM_File.xs +++ b/ext/GDBM_File/GDBM_File.xs @@ -304,7 +304,8 @@ gdbm_setopt (db, optflag, optval, optlen) #define setFilter(type) \ { \ if (db->type) \ - RETVAL = newSVsv(db->type) ; \ + RETVAL = sv_mortalcopy(db->type) ; \ + ST(0) = RETVAL ; \ if (db->type && (code == &PL_sv_undef)) { \ SvREFCNT_dec(db->type) ; \ db->type = NULL ; \ @@ -326,8 +327,6 @@ filter_fetch_key(db, code) SV * RETVAL = &PL_sv_undef ; CODE: setFilter(filter_fetch_key) ; - OUTPUT: - RETVAL SV * filter_store_key(db, code) @@ -336,8 +335,6 @@ filter_store_key(db, code) SV * RETVAL = &PL_sv_undef ; CODE: setFilter(filter_store_key) ; - OUTPUT: - RETVAL SV * filter_fetch_value(db, code) @@ -346,8 +343,6 @@ filter_fetch_value(db, code) SV * RETVAL = &PL_sv_undef ; CODE: setFilter(filter_fetch_value) ; - OUTPUT: - RETVAL SV * filter_store_value(db, code) @@ -356,6 +351,4 @@ filter_store_value(db, code) SV * RETVAL = &PL_sv_undef ; CODE: setFilter(filter_store_value) ; - OUTPUT: - RETVAL diff --git a/ext/NDBM_File/NDBM_File.pm b/ext/NDBM_File/NDBM_File.pm index cad800a..8db59ee 100644 --- a/ext/NDBM_File/NDBM_File.pm +++ b/ext/NDBM_File/NDBM_File.pm @@ -12,7 +12,7 @@ require DynaLoader; @ISA = qw(Tie::Hash DynaLoader); -$VERSION = "1.02"; +$VERSION = "1.03"; bootstrap NDBM_File $VERSION; diff --git a/ext/NDBM_File/NDBM_File.xs b/ext/NDBM_File/NDBM_File.xs index 60b141e..29cc288 100644 --- a/ext/NDBM_File/NDBM_File.xs +++ b/ext/NDBM_File/NDBM_File.xs @@ -117,7 +117,8 @@ ndbm_clearerr(db) #define setFilter(type) \ { \ if (db->type) \ - RETVAL = newSVsv(db->type) ; \ + RETVAL = sv_mortalcopy(db->type) ; \ + ST(0) = RETVAL ; \ if (db->type && (code == &PL_sv_undef)) { \ SvREFCNT_dec(db->type) ; \ db->type = NULL ; \ @@ -139,8 +140,6 @@ filter_fetch_key(db, code) SV * RETVAL = &PL_sv_undef ; CODE: setFilter(filter_fetch_key) ; - OUTPUT: - RETVAL SV * filter_store_key(db, code) @@ -149,8 +148,6 @@ filter_store_key(db, code) SV * RETVAL = &PL_sv_undef ; CODE: setFilter(filter_store_key) ; - OUTPUT: - RETVAL SV * filter_fetch_value(db, code) @@ -159,8 +156,6 @@ filter_fetch_value(db, code) SV * RETVAL = &PL_sv_undef ; CODE: setFilter(filter_fetch_value) ; - OUTPUT: - RETVAL SV * filter_store_value(db, code) @@ -169,6 +164,4 @@ filter_store_value(db, code) SV * RETVAL = &PL_sv_undef ; CODE: setFilter(filter_store_value) ; - OUTPUT: - RETVAL diff --git a/ext/ODBM_File/ODBM_File.pm b/ext/ODBM_File/ODBM_File.pm index 572318b..0af875d 100644 --- a/ext/ODBM_File/ODBM_File.pm +++ b/ext/ODBM_File/ODBM_File.pm @@ -8,7 +8,7 @@ require DynaLoader; @ISA = qw(Tie::Hash DynaLoader); -$VERSION = "1.01"; +$VERSION = "1.02"; bootstrap ODBM_File $VERSION; diff --git a/ext/ODBM_File/ODBM_File.xs b/ext/ODBM_File/ODBM_File.xs index 9ad794d..7601c34 100644 --- a/ext/ODBM_File/ODBM_File.xs +++ b/ext/ODBM_File/ODBM_File.xs @@ -158,7 +158,8 @@ odbm_NEXTKEY(db, key) #define setFilter(type) \ { \ if (db->type) \ - RETVAL = newSVsv(db->type) ; \ + RETVAL = sv_mortalcopy(db->type) ; \ + ST(0) = RETVAL ; \ if (db->type && (code == &PL_sv_undef)) { \ SvREFCNT_dec(db->type) ; \ db->type = Nullsv ; \ @@ -180,8 +181,6 @@ filter_fetch_key(db, code) SV * RETVAL = &PL_sv_undef ; CODE: setFilter(filter_fetch_key) ; - OUTPUT: - RETVAL SV * filter_store_key(db, code) @@ -190,8 +189,6 @@ filter_store_key(db, code) SV * RETVAL = &PL_sv_undef ; CODE: setFilter(filter_store_key) ; - OUTPUT: - RETVAL SV * filter_fetch_value(db, code) @@ -200,8 +197,6 @@ filter_fetch_value(db, code) SV * RETVAL = &PL_sv_undef ; CODE: setFilter(filter_fetch_value) ; - OUTPUT: - RETVAL SV * filter_store_value(db, code) @@ -210,6 +205,4 @@ filter_store_value(db, code) SV * RETVAL = &PL_sv_undef ; CODE: setFilter(filter_store_value) ; - OUTPUT: - RETVAL diff --git a/ext/SDBM_File/SDBM_File.pm b/ext/SDBM_File/SDBM_File.pm index 006bbbd..34c9717 100644 --- a/ext/SDBM_File/SDBM_File.pm +++ b/ext/SDBM_File/SDBM_File.pm @@ -8,7 +8,7 @@ require DynaLoader; @ISA = qw(Tie::Hash DynaLoader); -$VERSION = "1.01" ; +$VERSION = "1.02" ; bootstrap SDBM_File $VERSION; diff --git a/ext/SDBM_File/SDBM_File.xs b/ext/SDBM_File/SDBM_File.xs index e8711f4..c2e940b 100644 --- a/ext/SDBM_File/SDBM_File.xs +++ b/ext/SDBM_File/SDBM_File.xs @@ -23,16 +23,13 @@ typedef datum datum_value ; if (db->filtering) \ croak("recursion detected in %s", name) ; \ db->filtering = TRUE ; \ - /* SAVE_DEFSV ;*/ /* save $_ */ \ save_defsv = newSVsv(DEFSV) ; \ sv_setsv(DEFSV, arg) ; \ PUSHMARK(sp) ; \ (void) perl_call_sv(db->type, G_DISCARD|G_NOARGS); \ - /* SPAGAIN ; */ \ sv_setsv(arg, DEFSV) ; \ sv_setsv(DEFSV, save_defsv) ; \ SvREFCNT_dec(save_defsv) ; \ - /* PUTBACK ; */ \ db->filtering = FALSE ; \ /*printf("end of filtering %s\n", name) ;*/ \ } @@ -143,7 +140,8 @@ sdbm_clearerr(db) #define setFilter(type) \ { \ if (db->type) \ - RETVAL = newSVsv(db->type) ; \ + RETVAL = sv_mortalcopy(db->type) ; \ + ST(0) = RETVAL ; \ if (db->type && (code == &PL_sv_undef)) { \ SvREFCNT_dec(db->type) ; \ db->type = NULL ; \ @@ -165,8 +163,6 @@ filter_fetch_key(db, code) SV * RETVAL = &PL_sv_undef ; CODE: setFilter(filter_fetch_key) ; - OUTPUT: - RETVAL SV * filter_store_key(db, code) @@ -175,8 +171,6 @@ filter_store_key(db, code) SV * RETVAL = &PL_sv_undef ; CODE: setFilter(filter_store_key) ; - OUTPUT: - RETVAL SV * filter_fetch_value(db, code) @@ -185,8 +179,6 @@ filter_fetch_value(db, code) SV * RETVAL = &PL_sv_undef ; CODE: setFilter(filter_fetch_value) ; - OUTPUT: - RETVAL SV * filter_store_value(db, code) @@ -195,6 +187,4 @@ filter_store_value(db, code) SV * RETVAL = &PL_sv_undef ; CODE: setFilter(filter_store_value) ; - OUTPUT: - RETVAL