NAME

src/io/portable.c - Portable I/O utility functions

DESCRIPTION

This file implements generic, portable I/O functionality using C's STDIO. This function set is the default fallback for all platforms. It must compile on any system with the ANSI C standard library. Also note that unlike the other low-level I/O utility function sets (UNIX, Win32), this is buffered I/O, out of necessity.

Functions

static const char *convert_flags_to_stdio
Returns a C string representation of flags suitable for passing to fopen() in Parrot_io_open_portable().
INTVAL Parrot_io_init_portable
Sets up standard streams, etc.
PMC *Parrot_io_open_portable
Opens a new FileHandle PMC from a given STRING path with the provided modes.
PMC *Parrot_io_fdopen_portable
Associates an IO PMC with a file descriptor.
INTVAL Parrot_io_close_portable
Closes the underlying filehandle of a given IO PMC.
INTVAL Parrot_io_is_closed_portable
Tests whether the filehandle has been closed.
static INTVAL io_is_tty_portable
Tests whether the given file descriptor is attached to a tty.
size_t Parrot_io_peek_portable
Retrieves the next character in the stream without modifying the stream.
INTVAL Parrot_io_getblksize_portable
Returns the block size of the given file descriptor.
INTVAL Parrot_io_flush_portable
Flushes the underlying file descriptor of the given IO PMC.
size_t Parrot_io_read_portable
Reads from the given filehandle into the provided STRING, returning the number of bytes read.
size_t Parrot_io_write_portable
Writes the given STRING to the provided IO PMC.
PIOOFF_T Parrot_io_seek_portable
Seeks to the given offset and position within the provided IO PMC.
PIOOFF_T Parrot_io_tell_portable
Returns the current position of the given IO PMC.
PMC *Parrot_io_open_pipe_portable
Opens a pipe. Not implemented for this platform.

SEE ALSO

src/io/unix.c, src/io/win32.c, src/io/io.c, src/io/io_private.h, include/parrot/io_portable.h.