diff options
author | Nick Ing-Simmons <nik@tiuk.ti.com> | 2001-01-06 21:47:52 +0000 |
---|---|---|
committer | Nick Ing-Simmons <nik@tiuk.ti.com> | 2001-01-06 21:47:52 +0000 |
commit | f7e7eb72c805f1b630a3d1a32ed33c0f6da60bea (patch) | |
tree | 63645881dcfc03711dec389545e2c09db571da1c /perlio.c | |
parent | ba2475127660598ffe45c99cc6ca9e93a5ca847c (diff) | |
download | perl-f7e7eb72c805f1b630a3d1a32ed33c0f6da60bea.tar.gz |
FILE * in XS code for PerlIO world:
- make PERLIO_NOT_STDIO 0 (co-existance) default for non PERL_CORE case.
- Add FILE * T_STDIO typemap.
- Finish PerlIO_findFILE() and PerlIO_extprtFILE()
p4raw-id: //depot/perlio@8356
Diffstat (limited to 'perlio.c')
-rw-r--r-- | perlio.c | 20 |
1 files changed, 18 insertions, 2 deletions
@@ -1767,15 +1767,31 @@ PerlIO_funcs PerlIO_stdio = { FILE * PerlIO_exportFILE(PerlIO *f, int fl) { + FILE *stdio; PerlIO_flush(f); - /* Should really push stdio discipline when we have them */ - return fdopen(PerlIO_fileno(f),"r+"); + stdio = fdopen(PerlIO_fileno(f),"r+"); + if (stdio) + { + PerlIOStdio *s = PerlIOSelf(PerlIO_push(f,&PerlIO_stdio,"r+",Nullch,0),PerlIOStdio); + s->stdio = stdio; + } + return stdio; } #undef PerlIO_findFILE FILE * PerlIO_findFILE(PerlIO *f) { + PerlIOl *l = *f; + while (l) + { + if (l->tab == &PerlIO_stdio) + { + PerlIOStdio *s = PerlIOSelf(&l,PerlIOStdio); + return s->stdio; + } + l = *PerlIONext(&l); + } return PerlIO_exportFILE(f,0); } |