diff options
author | Peter Prymmer <PPrymmer@factset.com> | 2001-06-22 12:08:23 -0700 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-06-23 03:29:04 +0000 |
commit | 493ba88a837f5a6b31674dce8a7f80c8b594af17 (patch) | |
tree | be319a87819e628d687ac7c4dc53b2703846ed5a /vms | |
parent | 91e5ac1f8a0d22b86589cdd756c0172cc6d41af6 (diff) | |
download | perl-493ba88a837f5a6b31674dce8a7f80c8b594af17.tar.gz |
build (and test!) VMS::Stdio on VMS
Message-ID: <Pine.OSF.4.10.10106221903270.24012-100000@aspara.forte.com>
p4raw-id: //depot/perl@10850
Diffstat (limited to 'vms')
-rw-r--r-- | vms/descrip_mms.template | 12 | ||||
-rw-r--r-- | vms/ext/Stdio/Stdio.xs | 25 |
2 files changed, 26 insertions, 11 deletions
diff --git a/vms/descrip_mms.template b/vms/descrip_mms.template index c4cae568ae..2dc013b05d 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 9b61c590c0..64bd75017a 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; } |