NAME ^

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 ^

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(theINTERP, ParrotIOLayer *layer)

Setup standard streams, etc.

static ParrotIO *PIO_stdio_open(theINTERP, ParrotIOLayer *layer, const char *spath, INTVAL flags)

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

static ParrotIO *PIO_stdio_fdopen(theINTERP, ParrotIOLayer *layer, PIOHANDLE fptr, INTVAL flags)

Desc.

static INTVAL PIO_stdio_close(theINTERP, ParrotIOLayer *layer, ParrotIO *io)

Desc.

static INTVAL PIO_stdio_isatty(PIOHANDLE fptr)

Desc.

INTVAL PIO_stdio_getblksize(PIOHANDLE fptr)

Desc.

static INTVAL PIO_stdio_flush(theINTERP, ParrotIOLayer *layer, ParrotIO *io)

Desc.

static size_t PIO_stdio_read(theINTERP, ParrotIOLayer *layer, ParrotIO *io, STRING **)

Desc.

static size_t PIO_stdio_write(theINTERP, ParrotIOLayer *layer, ParrotIO *io, STRING *s)

Desc.

static PIOOFF_T PIO_stdio_seek(theINTERP, ParrotIOLayer *layer, ParrotIO *io, PIOOFF_T offset, INTVAL whence)

Hard seek.

static PIOOFF_T PIO_stdio_tell(theINTERP, ParrotIOLayer *layer, ParrotIO *io)

Desc.

SEE ALSO ^

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

HISTORY ^

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


parrot