NAME ^

src/io/io_buf.c - IO buffer layer

DESCRIPTION ^

The "buf" layer of Parrot IO. Buffering and all the fun stuff.

Functions ^

static INTVAL PIO_buf_init(Interp *interp, ParrotIOLayer *layer)

The buffer layer's Init function. Initializes buffering.

static ParrotIO *PIO_buf_open(Interp *interp, ParrotIOLayer *layer, const char *path, INTVAL flags)

The buffer layer's Open function.

static INTVAL PIO_buf_setbuf(Interp *interp, ParrotIOLayer *layer, ParrotIO *io, size_t bufsize)

The buffer layer's SetBuf function.

Don't pass SetBuf calls down the stack, top layer wins. This doesn't mean other layers can't buffer, I just need to think about the mechanism for buffer control or if it even makes sense this way. Most layers will not implement SetBuf.

static INTVAL PIO_buf_setlinebuf(Interp *interp, ParrotIOLayer *layer, ParrotIO *io)

The buffer layer's SetLineBuf function.

static ParrotIO *PIO_buf_fdopen(Interp *interp, ParrotIOLayer *layer, PIOHANDLE fd, INTVAL flags)

The buffer layer's FDOpen function.

static INTVAL PIO_buf_close(Interp *interp, ParrotIOLayer *layer, ParrotIO *io)

The buffer layer's Close function.

static INTVAL PIO_buf_flush(Interp *interp, ParrotIOLayer *layer, ParrotIO *io)

The buffer layer's Flush function.

static size_t PIO_buf_fill_readbuf(Interp *interp, ParrotIOLayer *layer, ParrotIO *io, ParrotIOBuf *b)

The buffer layer's Fill function.

static size_t PIO_buf_read(Interp *interp, ParrotIOLayer *layer, ParrotIO *io, STRING **buf)

The buffer layer's Read function.

static size_t PIO_buf_readline(Interp *interp, ParrotIOLayer *layer, ParrotIO *io, void *buffer, size_t len)

This is called from PIO_buf_read() to do line buffered reading if that is what is required.

static size_t PIO_buf_write(Interp *interp, ParrotIOLayer *layer, ParrotIO *io, STRING *s)

The buffer layer's Write function.

static PIOOFF_T PIO_buf_seek(Interp *interp, ParrotIOLayer *l, ParrotIO *io, PIOOFF_T offset, INTVAL whence)

The buffer layer's Seek function.

static PIOOFF_T PIO_buf_tell(Interp *interp, ParrotIOLayer *layer, ParrotIO *io)

The buffer layer's Tell function.

SEE ALSO ^

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.

HISTORY ^

Initially written by Melvin Smith.

Some ideas from AT&T SFIO.


parrot