summaryrefslogtreecommitdiff
path: root/pod/perlapio.pod
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>2002-05-08 19:08:43 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>2002-05-08 19:08:43 +0000
commit22569500a4329ba00826e9a263a1e15c2b24247f (patch)
tree807f4cbbb318a3e3d4eb2c4fc62d3dcb95aa5f83 /pod/perlapio.pod
parent8dcb57838133afcca1063f491fdd55188f1d84ed (diff)
downloadperl-22569500a4329ba00826e9a263a1e15c2b24247f.tar.gz
Portability and doc tweaks to PerlIO/XS stuff.
We are still "papering over the cracks" a bit, but now it is good stiff card held on with epoxy. p4raw-id: //depot/perlio@16496
Diffstat (limited to 'pod/perlapio.pod')
-rw-r--r--pod/perlapio.pod37
1 files changed, 25 insertions, 12 deletions
diff --git a/pod/perlapio.pod b/pod/perlapio.pod
index 22128db978..a0e4ffaf10 100644
--- a/pod/perlapio.pod
+++ b/pod/perlapio.pod
@@ -305,27 +305,34 @@ changes in this area.
=item B<PerlIO_importFILE(f,flags)>
-Used to get a PerlIO * from a FILE *. May need additional arguments,
-interface under review.
+Used to get a PerlIO * from a FILE *.
The flags argument was meant to be used for read vs write vs
read/write information. In hindsight it would have been better to make
-it a char *mode as in fopen/freopen.
+it a char *mode as in fopen/freopen. Flags arecurrently ignored, and
+code attempts to empirically determine the mode in which I<f> is open.
+
+Once called the FILE * should I<ONLY> be closed by calling
+C<PerlIO_close()> on the returned PerlIO *.
+
=item B<PerlIO_exportFILE(f,flags)>
Given a PerlIO * create a 'native' FILE * suitable for passing to code
expecting to be compiled and linked with ANSI C I<stdio.h>.
+The flags argument was meant to be used for read vs write vs
+read/write information. In hindsight it would have been better to make
+it a char *mode as in fopen/freopen. Flags are ignored and the
+FILE * is opened in same mode as the PerlIO *.
-The fact that such a FILE * has been 'exported' is recorded, and may
-affect future PerlIO operations on the original PerlIO *.
-
-Calling this function repeatedly will create a FILE * on each call.
-
-=item B<PerlIO_findFILE(f)>
+The fact that such a FILE * has been 'exported' is recorded, (normally by
+pushing a new :stdio "layer" onto the PerlIO *), which may affect future
+PerlIO operations on the original PerlIO *.
+You should not call C<fclose()> on the file unless you call
+C<PerlIO_releaseFILE()> to disassociate it from the the PerlIO *.
-Returns a native FILE * used by a stdio layer. If there is none, it
-will create one with PerlIO_exportFILE.
+Calling this function repeatedly will create a FILE * on each call
+(and will push an :stdio layer each time as well).
=item B<PerlIO_releaseFILE(p,f)>
@@ -333,7 +340,13 @@ Calling PerlIO_releaseFILE informs PerlIO that all use of FILE * is
complete. It is removed from list of 'exported' FILE *s, and
associated PerlIO * should revert to original behaviour.
-(Currently a noop.)
+=item B<PerlIO_findFILE(f)>
+
+Returns a native FILE * used by a stdio layer. If there is none, it
+will create one with PerlIO_exportFILE. In either case the FILE *
+should be considered at belonging to PerlIO subsystem and should
+only be closed by calling C<PerlIO_close()>.
+
=back