NAME ^

src/io/io_stdio.c - STDIO layer

DESCRIPTION ^

This is the Parrot IO STDIO layer. This may provide a subset of full functionality, but must compile on any system with the ANSI C standard library. Also note that unlike the other low-level IO layers (UNIX, Win32), this is buffered IO, out of necessity.

Functions ^

PARROT_CONST_FUNCTION PARROT_CANNOT_RETURN_NULL static const char *flags_to_stdio(INTVAL flags)

Returns a C string representation of flags suitable for passing to fopen() in PIO_stdio_open().

static INTVAL PIO_stdio_init(PARROT_INTERP, NOTNULL(ParrotIOLayer *layer))

Setup standard streams, etc.

PARROT_WARN_UNUSED_RESULT PARROT_CANNOT_RETURN_NULL static ParrotIO *PIO_stdio_open(PARROT_INTERP, SHIM(ParrotIOLayer *layer), NOTNULL(const char *spath), INTVAL flags)

Open modes (read, write, append, etc.) are done in pseudo-Perl style using <, >, etc.

PARROT_WARN_UNUSED_RESULT PARROT_CANNOT_RETURN_NULL static ParrotIO *PIO_stdio_fdopen(PARROT_INTERP, SHIM(ParrotIOLayer *layer), PIOHANDLE fptr, INTVAL flags)

TODO: Not yet documented!!!

static INTVAL PIO_stdio_close(SHIM_INTERP, SHIM(ParrotIOLayer *layer), NOTNULL(ParrotIO *io))

TODO: Not yet documented!!!

static INTVAL PIO_stdio_isatty(PIOHANDLE fptr)

TODO: Not yet documented!!!

static size_t PIO_stdio_peek(PARROT_INTERP, SHIM(ParrotIOLayer *layer), NOTNULL(ParrotIO *io), NOTNULL(STRING **buf))

TODO: Not yet documented!!!

INTVAL PIO_stdio_getblksize(PIOHANDLE fptr)

TODO: Not yet documented!!!

static INTVAL PIO_stdio_flush(SHIM_INTERP, SHIM(ParrotIOLayer *layer), NOTNULL(ParrotIO *io))

TODO: Not yet documented!!!

static size_t PIO_stdio_read(PARROT_INTERP, SHIM(ParrotIOLayer *layer), NOTNULL(ParrotIO *io), NOTNULL(STRING **buf))

TODO: Not yet documented!!!

static size_t PIO_stdio_write(SHIM_INTERP, SHIM(ParrotIOLayer *layer), NOTNULL(ParrotIO *io), NOTNULL(STRING *s))

TODO: Not yet documented!!!

static PIOOFF_T PIO_stdio_seek(SHIM_INTERP, SHIM(ParrotIOLayer *layer), NOTNULL(ParrotIO *io), PIOOFF_T offset, INTVAL whence)

TODO: Not yet documented!!!

static PIOOFF_T PIO_stdio_tell(SHIM_INTERP, SHIM(ParrotIOLayer *layer), NOTNULL(ParrotIO *io))

TODO: Not yet documented!!!

SEE ALSO ^

src/io/io_buf.c, src/io/io_passdown.c, src/io/io_unix.c, src/io/io_win32.c, src/io/io.c, src/io/io_private.h.

HISTORY ^

Adapted from io_unix.c by Josh Wilmes (josh@hitchhiker.org).


parrot