diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2003-09-24 04:54:33 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2003-09-24 04:54:33 +0000 |
commit | b0a2be78d1e39d7609b90d53c8fffeee3363fb76 (patch) | |
tree | e85e0ee44f7301e7f6abe90e56b8a775aeac1aad /pod | |
parent | 659cfd94ba23a1b903a75ecaffde534106f93c22 (diff) | |
download | perl-b0a2be78d1e39d7609b90d53c8fffeee3363fb76.tar.gz |
perliol tweaks.
p4raw-id: //depot/perl@21351
Diffstat (limited to 'pod')
-rw-r--r-- | pod/perliol.pod | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/pod/perliol.pod b/pod/perliol.pod index a2eeed3287..466959b001 100644 --- a/pod/perliol.pod +++ b/pod/perliol.pod @@ -733,10 +733,46 @@ The application (or layer above) must ensure they are consistent. =back +=head2 Utilities + +To ask for the next layer down use PerlIONext(PerlIO *f). + +To check that a PerlIO* is valid use PerlIOValid(PerlIO *f). (All +this does is really just to check that the pointer is non-NULL and +that the pointer behind that is non-NULL.) + +PerlIOBase(PerlIO *f) returns the "Base" pointer, or in other words, +the C<PerlIOl*> pointer. + +PerlIOSelf(PerlIO* f, type) return the PerlIOBase cast to a type. + +Perl_PerlIO_or_Base(PerlIO* f, callback, base, failure, args) either +calls the I<callback> from the functions of the layer I<f> (just by +the name of the IO function, like "Read") with the I<args>, or if +there is no such callback, calls the I<base> version of the callback +with the same args, or if the f is invalid, set errno to EBADF and +return I<failure>. + +Perl_PerlIO_or_fail(PerlIO* f, callback, failure, args) either calls +the I<callback> of the functions of the layer I<f> with the I<args>, +or if there is no such callback, set errno to EINVAL. Or if the f is +invalid, set errno to EBADF and return I<failure>. + +Perl_PerlIO_or_Base_void(PerlIO* f, callback, base, args) either calls +the I<callback> of the functions of the layer I<f> with the I<args>, +or if there is no such callback, calls the I<base> version of the +callback with the same args, or if the f is invalid, set errno to +EBADF. + +Perl_PerlIO_or_fail_void(PerlIO* f, callback, args) either calls the +I<callback> of the functions of the layer I<f> with the I<args>, or if +there is no such callback, set errno to EINVAL. Or if the f is +invalid, set errno to EBADF. + =head2 Implementing PerlIO Layers If you find the implementation document unclear or not sufficient, -look at the existing perlio layer implementations, which include: +look at the existing PerlIO layer implementations, which include: =over |