From: Peter Prymmer Date: Fri, 22 Jun 2001 19:08:23 +0000 (-0700) Subject: build (and test!) VMS::Stdio on VMS X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=493ba88a837f5a6b31674dce8a7f80c8b594af17;p=p5sagit%2Fp5-mst-13.2.git build (and test!) VMS::Stdio on VMS Message-ID: p4raw-id: //depot/perl@10850 --- diff --git a/vms/descrip_mms.template b/vms/descrip_mms.template index c4cae56..2dc013b 100644 --- a/vms/descrip_mms.template +++ b/vms/descrip_mms.template @@ -908,10 +908,16 @@ perly$(O) : perly.c, perly.h, $(h) [.t.lib]vmsish.t : [.vms.ext]vmsish.t Copy/Log/NoConfirm $(MMS$SOURCE) $(MMS$TARGET) +[.t.lib]vms_dclsym.t : [.vms.ext.DCLsym]test.pl + Copy/Log/NoConfirm $(MMS$SOURCE) $(MMS$TARGET) + +[.t.lib]vms_stdio.t : [.vms.ext.Stdio]test.pl + Copy/Log/NoConfirm $(MMS$SOURCE) $(MMS$TARGET) + check : test @ Continue -test : all [.t.lib]vmsfspec.t [.t.lib]vmsish.t +test : all [.t.lib]vmsfspec.t [.t.lib]vmsish.t [.t.lib]vms_dclsym.t [.t.lib]vms_stdio.t - @[.VMS]Test.Com "$(E)" "$(__DEBUG__)" @ $(MINIPERL) -e "print ""Ran tests"";" > [.t]rantests. @@ -1316,6 +1322,10 @@ realclean : clean - If F$Search("[...]*$(E)").nes."" Then Delete/NoConfirm/Log [...]*$(E);* - If F$Search("[.vms]Perl_Setup.Com").nes."" Then Delete/NoConfirm/Log [.vms]Perl_Setup.Com;* - If F$Search("[.t]rantests.").nes."" Then Delete/NoConfirm/Log [.t]rantests.;* + - If F$Search("[.t.lib]vmsfspec.t").nes."" Then Delete/NoConfirm/Log [.t.lib]vmsfspec.t;* + - If F$Search("[.t.lib]vmsish.t").nes."" Then Delete/NoConfirm/Log [.t.lib]vmsish.t;* + - If F$Search("[.t.lib]vms_dclsym.t").nes."" Then Delete/NoConfirm/Log [.t.lib]vms_dclsym.t;* + - If F$Search("[.t.lib]vms_stdio.t").nes."" Then Delete/NoConfirm/Log [.t.lib]vms_stdio.t;* cleansrc : clean !GROK!THIS! diff --git a/vms/ext/Stdio/Stdio.xs b/vms/ext/Stdio/Stdio.xs index 9b61c59..64bd750 100644 --- a/vms/ext/Stdio/Stdio.xs +++ b/vms/ext/Stdio/Stdio.xs @@ -128,12 +128,16 @@ binmode(fh) SV * fh PROTOTYPE: $ CODE: - IO *io = sv_2io(fh); - PerlIO *fp = io ? IoOFP(io) : NULL; - char iotype = io ? IoTYPE(io) : '\0'; - char filespec[NAM$C_MAXRSS], *acmode, *s, *colon, *dirend = Nullch; - int ret = 0, saverrno = errno, savevmserrno = vaxc$errno; + SV *name; + IO *io; + char iotype; + char filespec[NAM$C_MAXRSS], *acmode, *s, *colon, *dirend = Nullch; + int ret = 0, saverrno = errno, savevmserrno = vaxc$errno; SV pos; + PerlIO *fp; + io = sv_2io(fh); + fp = io ? IoOFP(io) : NULL; + iotype = io ? IoTYPE(io) : '\0'; if (fp == NULL || strchr(">was+-|",iotype) == Nullch) { set_errno(EBADF); set_vaxc_errno(SS$_IVCHAN); XSRETURN_UNDEF; } @@ -169,7 +173,7 @@ binmode(fh) acmode = "rb+"; } /* appearances to the contrary, this is an freopen substitute */ - SV *name = sv_2mortal(newSVpvn(filespec,strlen(filespec))); + name = sv_2mortal(newSVpvn(filespec,strlen(filespec))); if (PerlIO_openn(Nullch,acmode,-1,0,0,fp,1,&name) == Nullfp) XSRETURN_UNDEF; if (iotype != '-' && ret != -1 && PerlIO_setpos(fp,&pos) == -1) XSRETURN_UNDEF; if (ret == -1) { set_errno(saverrno); set_vaxc_errno(savevmserrno); } @@ -291,6 +295,7 @@ vmsopen(spec,...) char *args[8],mode[3] = {'r','\0','\0'}, type = '<'; register int i, myargc; FILE *fp; + SV *fh; PerlIO *pio_fp; STRLEN n_a; @@ -344,8 +349,8 @@ vmsopen(spec,...) } if (fp != Null(FILE*)) { pio_fp = PerlIO_importFILE(fp,0); - SV *fh = newFH(pio_fp,(mode[1] ? '+' : (mode[0] == 'r' ? '<' : (mode[0] == 'a' ? 'a' : '>')))); - ST(0) = (fh ? sv_2mortal(fh) : &PL_sv_undef); + fh = newFH(pio_fp,(mode[1] ? '+' : (mode[0] == 'r' ? '<' : (mode[0] == 'a' ? 'a' : '>')))); + ST(0) = (fh ? sv_2mortal(fh) : &PL_sv_undef); } else { ST(0) = &PL_sv_undef; } @@ -404,8 +409,8 @@ vmssysopen(spec,mode,perm,...) if (fd >= 0 && ((fp = fdopen(fd, &("r\000w\000r+"[2*i]))) != Null(FILE*))) { pio_fp = PerlIO_importFILE(fp,0); - SV *fh = newFH(pio_fp,"<>++"[i]); - ST(0) = (fh ? sv_2mortal(fh) : &PL_sv_undef); + fh = newFH(pio_fp,"<>++"[i]); + ST(0) = (fh ? sv_2mortal(fh) : &PL_sv_undef); } else { ST(0) = &PL_sv_undef; }