parrotcode: IO buffer layer | |
Contents | C |
io/io_buf.c - IO buffer layer
The "buf" layer of Parrot IO. Buffering and all the fun stuff.
static INTVAL PIO_buf_init(theINTERP, ParrotIOLayer *layer)
Init
function.
Initializes buffering.static ParrotIO *PIO_buf_open(theINTERP, ParrotIOLayer *layer, const char *path, INTVAL flags)
Open
function.static INTVAL PIO_buf_setbuf(theINTERP, ParrotIOLayer *layer, ParrotIO *io, size_t bufsize)
SetBuf
function.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(theINTERP, ParrotIOLayer *layer, ParrotIO *io)
SetLineBuf
function.static ParrotIO *PIO_buf_fdopen(theINTERP, ParrotIOLayer *layer, PIOHANDLE fd, INTVAL flags)
FDOpen
function.static INTVAL PIO_buf_close(theINTERP, ParrotIOLayer *layer, ParrotIO *io)
Close
function.static INTVAL PIO_buf_flush(theINTERP, ParrotIOLayer *layer, ParrotIO *io)
Flush
function.static size_t PIO_buf_fill_readbuf(theINTERP, ParrotIOLayer *layer, ParrotIO *io, ParrotIOBuf *b)
Fill
function.static size_t PIO_buf_read(theINTERP, ParrotIOLayer *layer, ParrotIO *io, STRING **buf)
Read
function.static size_t PIO_buf_readline(theINTERP, ParrotIOLayer *layer, ParrotIO *io, void *buffer, size_t len)
PIO_buf_read()
to do line buffered reading if that is what is required.static size_t PIO_buf_write(theINTERP, ParrotIOLayer *layer, ParrotIO *io, STRING *s)
Write
function.static PIOOFF_T PIO_buf_seek(theINTERP, ParrotIOLayer *l, ParrotIO *io, PIOOFF_T offset, INTVAL whence)
Seek
function.static PIOOFF_T PIO_buf_tell(theINTERP, ParrotIOLayer *layer, ParrotIO *io)
Tell
function.io/io_passdown.c, io/io_stdio.c, io/io_unix.c, io/io_win32.c, io/io.c, io/io_private.h.
Initially written by Melvin Smith.
Some ideas from AT&T SFIO.
|