| parrotcode: IO buffer layer | |
| Contents | C |

src/io/io_buf.c - IO buffer layer

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

static INTVAL PIO_buf_init(PARROT_INTERP, NOTNULL(ParrotIOLayer *layer))Init function.
Initializes buffering.PARROT_CAN_RETURN_NULL static ParrotIO *PIO_buf_open(PARROT_INTERP, NOTNULL(ParrotIOLayer *layer), NOTNULL(const char *path), INTVAL flags)Open function.static INTVAL PIO_buf_setbuf(PARROT_INTERP, NOTNULL(ParrotIOLayer *layer), NOTNULL(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(PARROT_INTERP, NOTNULL(ParrotIOLayer *layer), NOTNULL(ParrotIO *io))SetLineBuf function.PARROT_CAN_RETURN_NULL PARROT_WARN_UNUSED_RESULT static ParrotIO *PIO_buf_fdopen(PARROT_INTERP, NOTNULL(ParrotIOLayer *layer), PIOHANDLE fd, INTVAL flags)FDOpen function.static INTVAL PIO_buf_close(PARROT_INTERP, NOTNULL(ParrotIOLayer *layer), NOTNULL(ParrotIO *io))Close function.static INTVAL PIO_buf_flush(PARROT_INTERP, NOTNULL(ParrotIOLayer *layer), NOTNULL(ParrotIO *io))Flush function.static size_t PIO_buf_fill_readbuf(PARROT_INTERP, NOTNULL(ParrotIOLayer *layer), NOTNULL(ParrotIO *io), NOTNULL(ParrotIOBuf *b))Fill function.static size_t PIO_buf_read(PARROT_INTERP, NOTNULL(ParrotIOLayer *layer), NOTNULL(ParrotIO *io), NOTNULL(STRING **buf))Read function.static size_t PIO_buf_peek(PARROT_INTERP, NOTNULL(ParrotIOLayer *layer), NOTNULL(ParrotIO *io), NOTNULL(STRING **buf))static size_t PIO_buf_readline(PARROT_INTERP, NOTNULL(ParrotIOLayer *layer), NOTNULL(ParrotIO *io), NOTNULL(STRING **buf))PIO_buf_read() to do line buffered reading if that is what is required.static size_t PIO_buf_write(PARROT_INTERP, NOTNULL(ParrotIOLayer *layer), NOTNULL(ParrotIO *io), NOTNULL(STRING *s))Write function.static PIOOFF_T PIO_buf_seek(PARROT_INTERP, NOTNULL(ParrotIOLayer *l), NOTNULL(ParrotIO *io), PIOOFF_T offset, INTVAL whence)Seek function.static PIOOFF_T PIO_buf_tell(SHIM_INTERP, SHIM(ParrotIOLayer *layer), NOTNULL(ParrotIO *io))Tell function.
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 Melvin Smith.
Some ideas from AT&T SFIO.
|
|
|