summaryrefslogtreecommitdiff
path: root/perlio.c
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>2001-01-06 21:47:52 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>2001-01-06 21:47:52 +0000
commitf7e7eb72c805f1b630a3d1a32ed33c0f6da60bea (patch)
tree63645881dcfc03711dec389545e2c09db571da1c /perlio.c
parentba2475127660598ffe45c99cc6ca9e93a5ca847c (diff)
downloadperl-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.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/perlio.c b/perlio.c
index 8db2b969e1..72efa366c3 100644
--- a/perlio.c
+++ b/perlio.c
@@ -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);
}