sfset(sfstdout, SF_SHARE, 0);
}
+/* This is not the reverse of PerlIO_exportFILE(), PerlIO_releaseFILE() is. */
PerlIO *
PerlIO_importFILE(FILE *stdio, const char *mode)
{
#endif /* USE_STDIO_PTR */
};
+/* Note that calls to PerlIO_exportFILE() are reversed using
+ * PerlIO_releaseFILE(), not importFILE. */
FILE *
PerlIO_exportFILE(PerlIO * f, const char *mode)
{
return PerlIO_exportFILE(f, Nullch);
}
+/* Use this to reverse PerlIO_exportFILE calls. */
void
PerlIO_releaseFILE(PerlIO *p, FILE *f)
{
The PerlIO is set to textmode. Use PerlIO_binmode if this is
not the desired mode.
+This is B<not> the reverse of PerlIO_exportFILE().
+
=item B<PerlIO_exportFILE(f,mode)>
Given a PerlIO * create a 'native' FILE * suitable for passing to code
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 PerlIO *.
+(And do not use PerlIO_importFILE() for doing to disassociation.)
Calling this function repeatedly will create a FILE * on each call
(and will push an :stdio layer each time as well).
complete. It is removed from the list of 'exported' FILE *s, and the
associated PerlIO * should revert to its original behaviour.
+Use this to disassociate a file from a PerlIO * that was associated
+using PerlIO_exportFILE().
+
=item B<PerlIO_findFILE(f)>
Returns a native FILE * used by a stdio layer. If there is none, it