Return-Path: Mailing-List: contact modperl-cvs-help@apache.org; run by ezmlm Delivered-To: mailing list modperl-cvs@apache.org Received: (qmail 70822 invoked by uid 1066); 5 Apr 2000 04:55:55 -0000 Date: 5 Apr 2000 04:55:55 -0000 Message-ID: <20000405045555.70821.qmail@locus.apache.org> From: dougm@locus.apache.org To: modperl-cvs@apache.org Subject: cvs commit: modperl/src/modules/perl Apache.xs dougm 00/04/04 21:55:55 Modified: . Changes Apache Apache.pm src/modules/perl Apache.xs Log: added Apache::OPEN method for 5.6.0+ tied filehandle support Revision Changes Path 1.460 +2 -0 modperl/Changes Index: Changes =================================================================== RCS file: /home/cvs/modperl/Changes,v retrieving revision 1.459 retrieving revision 1.460 diff -u -r1.459 -r1.460 --- Changes 2000/04/05 04:04:59 1.459 +++ Changes 2000/04/05 04:55:54 1.460 @@ -10,6 +10,8 @@ =item 1.22_01-dev +added Apache::OPEN method for 5.6.0+ tied filehandle support + Apache::Table is now loaded by default (if enabled), rather than autoloading when first needed 1.46 +0 -5 modperl/Apache/Apache.pm Index: Apache.pm =================================================================== RCS file: /home/cvs/modperl/Apache/Apache.pm,v retrieving revision 1.45 retrieving revision 1.46 diff -u -r1.45 -r1.46 --- Apache.pm 2000/04/05 04:05:00 1.45 +++ Apache.pm 2000/04/05 04:55:55 1.46 @@ -189,11 +189,6 @@ } } -sub TIEHANDLE { - my($class, $r) = @_; - $r ||= Apache->request; -} - 1; __END__ 1.94 +39 -0 modperl/src/modules/perl/Apache.xs Index: Apache.xs =================================================================== RCS file: /home/cvs/modperl/src/modules/perl/Apache.xs,v retrieving revision 1.93 retrieving revision 1.94 diff -u -r1.93 -r1.94 --- Apache.xs 2000/04/03 05:41:29 1.93 +++ Apache.xs 2000/04/05 04:55:55 1.94 @@ -561,6 +561,45 @@ items = items; /*NOOP*/ +Apache +TIEHANDLE(classname, r=NULL) + SV *classname + Apache r + + CODE: + RETVAL = r ? r : perl_request_rec(NULL); + + OUTPUT: + RETVAL + +int +OPEN(self, arg1, arg2=Nullsv) + SV *self + SV *arg1 + SV *arg2 + + PREINIT: + char *name; + STRLEN len; + GV *gv = gv_fetchpv("STDOUT", TRUE, SVt_PVIO); + SV *arg; + + CODE: + sv_unmagic((SV*)gv, 'q'); /* untie *STDOUT */ + if (arg2) { + arg = newSVsv(arg1); + sv_catsv(arg, arg2); + } + else { + arg = arg1; + } + + name = SvPV(arg, len); + RETVAL = do_open(gv, name, len, FALSE, O_RDONLY, 0, Nullfp); + + OUTPUT: + RETVAL + SV * as_string(r) Apache r