NAME ^

src/io/name.c - Win32 IO layer

DESCRIPTION ^

This is the Parrot OS-specific IO layer for Win32 platforms.

References ^

Win32 System Programming, 2nd Edition.

Functions ^

flags_to_win32

Convert to platform-specific bit open flags.

PIO_win32_init

Sets up the standard std* IO handles.

PIO_win32_getblksize

Returns PIO_BLKSIZE.

PIO_win32_open

Calls CreateFile() to open *spath with the Win32 translation of flags.

PIO_win32_fdopen

Returns a new ParrotIO with fd as its file descriptor.

PIO_win32_close

Calls CloseHandle() to close *io's file descriptor.

PIO_win32_isatty

Returns whether fd is a console/tty.

PIO_win32_flush

Calls FlushFileBuffers() to flush *io's file descriptor.

PIO_win32_read

Calls ReadFile() to read up to len bytes from *io's file descriptor to the memory starting at buffer.

PIO_win32_write

Calls WriteFile() to write len bytes from the memory starting at buffer to *io's file descriptor.

PIO_win32_seek

Hard seek.

Calls SetFilePointer() to move the read/write position of *io's file descriptor to off bytes relative to the location specified by whence.

PIO_win32_tell

Returns the current read/write position of *io's file descriptor.

PIO_sockaddr_in

PIO_sockaddr_in() is not part of the layer and so must be extern.

XXX: We can probably just write our own routines (htons(), inet_aton(), etc.) and take this out of platform specific compilation

PIO_win32_socket

Uses socket() to create a socket with the specified address family, socket type and protocol number.

PIO_win32_connect

Connects *io's socket to address *r.

PIO_win32_send

Send the message *s to *io's connected socket.

PIO_win32_recv

Receives a message in **s from *io's connected socket.

PIO_win32_bind

Binds *io's socket to the local address and port specified by *l.

PIO_win32_listen

Listen for new connections. This is only applicable to STREAM or SEQ sockets.

PIO_win32_accept

Accept a new connection and return a newly created ParrotIO socket.

SEE ALSO ^

src/io/io_buf.c, src/io/io_passdown.c, src/io/io_stdio.c, src/io/io_unix.c, src/io/io.c, src/io/io_private.h.

HISTORY ^

Initially written by Melvin Smith.


parrot