summaryrefslogtreecommitdiff
path: root/lib/ExtUtils
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 /lib/ExtUtils
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 'lib/ExtUtils')
-rw-r--r--lib/ExtUtils/typemap16
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/ExtUtils/typemap b/lib/ExtUtils/typemap
index a5d06cafeb..c59c3dc88a 100644
--- a/lib/ExtUtils/typemap
+++ b/lib/ExtUtils/typemap
@@ -40,7 +40,8 @@ Boolean T_IV
double T_DOUBLE
SysRet T_SYSRET
SysRetLong T_SYSRET
-FILE * T_IN
+FILE * T_STDIO
+PerlIO * T_INOUT
FileHandle T_PTROBJ
InputStream T_IN
InOutStream T_INOUT
@@ -138,7 +139,7 @@ T_PTROBJ
T_PTRDESC
if (sv_isa($arg, \"${ntype}\")) {
IV tmp = SvIV((SV*)SvRV($arg));
- ${type}_desc = (\U${type}_DESC\E*) tmp;
+ ${type}_desc = (\U${type}_DESC\E*) tmp;
$var = ${type}_desc->ptr;
}
else
@@ -173,6 +174,8 @@ T_ARRAY
while (items--) {
DO_ARRAY_ELEM;
}
+T_STDIO
+ $var = PerlIO_findFILE(IoIFP(sv_2io($arg)))
T_IN
$var = IoIFP(sv_2io($arg))
T_INOUT
@@ -267,6 +270,15 @@ T_ARRAY
DO_ARRAY_ELEM
}
SP += $var.size - 1;
+T_STDIO
+ {
+ GV *gv = newGVgen("$Package");
+ PerlIO *fp = PerlIO_importFILE($var,0);
+ if ( fp && do_open(gv, "+<&", 3, FALSE, 0, 0, fp) )
+ sv_setsv($arg, sv_bless(newRV((SV*)gv), gv_stashpv("$Package",1)));
+ else
+ $arg = &PL_sv_undef;
+ }
T_IN
{
GV *gv = newGVgen("$Package");