parrotcode: IO layer handling | |
Contents | C |
src/io/io_passdown.c - IO layer handling
This is a set of helper functions which search for the first implementation of a function in the layer-stack, call it with the appropriate arguments and return the value returned.
PARROT_WARN_UNUSED_RESULT PARROT_CAN_RETURN_NULL ParrotIO *PIO_open_down(PARROT_INTERP, NULLOK(ParrotIOLayer *layer), ARGIN(const char *name), INTVAL flags)
Open
and calls it if found,
returning its return value.NULL
if no implementation is found.PARROT_WARN_UNUSED_RESULT PARROT_CAN_RETURN_NULL ParrotIO *PIO_open_async_down(PARROT_INTERP, NULLOK(ParrotIOLayer *layer), ARGIN(const char *name), ARGIN(const char *mode), NOTNULL(DummyCodeRef *dummy))
Open_ASync
and calls it if found,
returning its return value.NULL
if no implementation is found.PARROT_WARN_UNUSED_RESULT PARROT_CAN_RETURN_NULL ParrotIO *PIO_fdopen_down(PARROT_INTERP, NULLOK(ParrotIOLayer *layer), PIOHANDLE fd, INTVAL flags)
FDOpen
and calls it if found,
returning its return value.NULL
if no implementation is found.PARROT_WARN_UNUSED_RESULT size_t PIO_peek_down(PARROT_INTERP, NULLOK(ParrotIOLayer *layer), NOTNULL(ParrotIO *io), NOTNULL(STRING **buf))
PARROT_WARN_UNUSED_RESULT INTVAL PIO_close_down(PARROT_INTERP, NULLOK(ParrotIOLayer *layer), NOTNULL(ParrotIO *io))
Close
and calls it if found,
returning its return value.-1
if no implementation is found.PARROT_WARN_UNUSED_RESULT size_t PIO_write_down(PARROT_INTERP, NULLOK(ParrotIOLayer *layer), NOTNULL(ParrotIO *io), NOTNULL(STRING *s))
Write
and calls it if found,
returning its return value.0
if no implementation is found.PARROT_WARN_UNUSED_RESULT size_t PIO_write_async_down(PARROT_INTERP, NULLOK(ParrotIOLayer *layer), NOTNULL(ParrotIO *io), NOTNULL(STRING *s), NOTNULL(DummyCodeRef *dummy))
WriteASync
and calls it if found,
returning its return value.0
if no implementation is found.PARROT_WARN_UNUSED_RESULT size_t PIO_read_down(PARROT_INTERP, NULLOK(ParrotIOLayer *layer), NOTNULL(ParrotIO *io), NOTNULL(STRING **buf))
Read
and calls it if found,
returning its return value.0
if no implementation is found.PARROT_WARN_UNUSED_RESULT size_t PIO_read_async_down(PARROT_INTERP, NULLOK(ParrotIOLayer *layer), NOTNULL(ParrotIO *io), NOTNULL(STRING **buf), NOTNULL(DummyCodeRef *dummy))
Read_ASync
and calls it if found,
returning its return value.0
if no implementation is found.PARROT_WARN_UNUSED_RESULT INTVAL PIO_flush_down(PARROT_INTERP, NULLOK(ParrotIOLayer *layer), NOTNULL(ParrotIO *io))
Flush
and calls it if found,
returning its return value.0
if no implementation is found.PARROT_WARN_UNUSED_RESULT PIOOFF_T PIO_seek_down(PARROT_INTERP, NULLOK(ParrotIOLayer *layer), NOTNULL(ParrotIO *io), PIOOFF_T offset, INTVAL whence)
Seek
and calls it if found,
returning its return value.-1
if no implementation is found.PARROT_WARN_UNUSED_RESULT PIOOFF_T PIO_tell_down(PARROT_INTERP, NULLOK(ParrotIOLayer *layer), NOTNULL(ParrotIO *io))
Tell
and calls it if found,
returning its return value.0
if no implementation is found.PARROT_WARN_UNUSED_RESULT INTVAL PIO_setbuf_down(PARROT_INTERP, NULLOK(ParrotIOLayer *layer), NOTNULL(ParrotIO *io), size_t bufsize)
SetBuf
and calls it if found,
returning its return value.-1
if no implementation is found.PARROT_WARN_UNUSED_RESULT INTVAL PIO_setlinebuf_down(PARROT_INTERP, NULLOK(ParrotIOLayer *layer), NOTNULL(ParrotIO *io))
SetLineBuf
and calls it if found,
returning its return value.-1
if no implementation is found.PARROT_WARN_UNUSED_RESULT INTVAL PIO_eof_down(PARROT_INTERP, NULLOK(ParrotIOLayer *layer), NOTNULL(ParrotIO *io))
Eof
and calls it if found,
returning its return value.-1
if no implementation is found.PARROT_WARN_UNUSED_RESULT INTVAL PIO_poll_down(PARROT_INTERP, NOTNULL(ParrotIOLayer *layer), NOTNULL(ParrotIO *io), INTVAL which, INTVAL sec, INTVAL usec)
Poll
and calls it if found,
returning its return value.-1
if no implementation is found.PARROT_WARN_UNUSED_RESULT PARROT_CAN_RETURN_NULL ParrotIO *PIO_socket_down(PARROT_INTERP, NOTNULL(ParrotIOLayer *layer), INTVAL fam, INTVAL type, INTVAL proto)
Socket
and calls it if found,
returning its return value.NULL
if no implementation is found.PARROT_WARN_UNUSED_RESULT INTVAL PIO_recv_down(PARROT_INTERP, NOTNULL(ParrotIOLayer *layer), NOTNULL(ParrotIO *io), NOTNULL(STRING **buf))
Recv
and calls it if found,
returning its return value.-1
if no implementation is found.PARROT_WARN_UNUSED_RESULT INTVAL PIO_send_down(PARROT_INTERP, NOTNULL(ParrotIOLayer *layer), NOTNULL(ParrotIO *io), NOTNULL(STRING *buf))
Send
and calls it if found,
returning its return value.-1
if no implementation is found.PARROT_WARN_UNUSED_RESULT INTVAL PIO_connect_down(PARROT_INTERP, NOTNULL(ParrotIOLayer *layer), NOTNULL(ParrotIO *io), NOTNULL(STRING *address))
Connect
and calls it if found,
returning its return value.-1
if no implementation is found.PARROT_WARN_UNUSED_RESULT INTVAL PIO_bind_down(PARROT_INTERP, NOTNULL(ParrotIOLayer *layer), NOTNULL(ParrotIO *io), NOTNULL(STRING *address))
Bind
and calls it if found,
returning its return value.-1
if no implementation is found.PARROT_WARN_UNUSED_RESULT INTVAL PIO_listen_down(PARROT_INTERP, NOTNULL(ParrotIOLayer *layer), NOTNULL(ParrotIO *io), INTVAL backlog)
listen
and calls it if found,
returning its return value.-1
if no implementation is found.PARROT_WARN_UNUSED_RESULT PARROT_CAN_RETURN_NULL ParrotIO *PIO_accept_down(PARROT_INTERP, NOTNULL(ParrotIOLayer *layer), NOTNULL(ParrotIO *io))
Accept
and calls it if found,
returning its return value.-1
if no implementation is found.src/io/io_buf.c, src/io/io_passdown.c, src/io/io_stdio.c, src/io/io_unix.c, src/io/io_win32.c, src/io/io.c, src/io/io_private.h.
Initially written by Juergen Boemmels
Some ideas and goals from Perl5.7 and Nick Ing-Simmons' work.
|