parrotcode: Win32 IO layer | |
Contents | C |
src/io/name.c - Win32 IO layer
This is the Parrot OS-speciic IO layer for Win32 platforms.
Win32 System Programming, 2nd Edition.
static INTVAL flags_to_win32(INTVAL flags, DWORD *fdwAccess, DWORD *fdwShareMode, DWORD *fdwCreate)
static INTVAL PIO_win32_init(theINTERP, ParrotIOLayer *layer)
std*
IO handles.INTVAL PIO_win32_getblksize(PIOHANDLE fd)
PIO_BLKSIZE
.static ParrotIO *PIO_win32_open(theINTERP, ParrotIOLayer *layer, const char *spath, INTVAL flags)
CreateFile()
to open *spath
with the Win32 translation of flags
.static ParrotIO *PIO_win32_fdopen(theINTERP, ParrotIOLayer *layer, PIOHANDLE fd, INTVAL flags)
ParrotIO
with fd
as its file descriptor.static INTVAL PIO_win32_close(theINTERP, ParrotIOLayer *layer, ParrotIO *io)
CloseHandle()
to close *io
's file descriptor.INTVAL PIO_win32_isatty(PIOHANDLE fd)
fd
is a console/tty.static INTVAL PIO_win32_flush(theINTERP, ParrotIOLayer *layer, ParrotIO *io)
FlushFileBuffers()
to flush *io
's file descriptor.static size_t PIO_win32_read(theINTERP, ParrotIOLayer *layer, ParrotIO *io, STRING ** buf)
ReadFile()
to read up to len
bytes from *io
's file descriptor to the memory starting at buffer
.static size_t PIO_win32_write(theINTERP, ParrotIOLayer *layer, ParrotIO *io, STRING *)
WriteFile()
to write len
bytes from the memory starting at buffer
to *io
's file descriptor.static PIOOFF_T PIO_win32_seek(theINTERP, ParrotIOLayer *l, ParrotIO *io, PIOOFF_T off, INTVAL whence)
SetFilePointer()
to move the read/write position of *io
's file descriptor to off
bytes relative to the location specified by whence
.static PIOOFF_T PIO_win32_tell(theINTERP, ParrotIOLayer *l, ParrotIO *io)
*io
's file descriptor.STRING *PIO_sockaddr_in(theINTERP, unsigned short port, STRING *addr)
PIO_sockaddr_in()
is not part of the layer and so must be extern
.htons()
,
inet_aton()
,
etc.) and take this out of platform specific compilationstatic ParrotIO *PIO_win32_socket(theINTERP, ParrotIOLayer *layer, int fam, int type, int proto)
socket()
to create a socket with the specified address family,
socket type and protocol number.static INTVAL PIO_win32_connect(theINTERP, ParrotIOLayer *layer, ParrotIO *io, STRING *r)
*io
's socket to address *r
.static INTVAL PIO_win32_send(theINTERP, ParrotIOLayer *layer, ParrotIO *io, STRING *s)
*s
to *io
's connected socket.static INTVAL PIO_win32_recv(theINTERP, ParrotIOLayer *layer, ParrotIO *io, STRING **s)
**s
from *io
's connected socket.static INTVAL PIO_win32_bind(theINTERP, ParrotIOLayer *layer, ParrotIO *io, STRING *l)
*io
's socket to the local address and port specified by *l
.static INTVAL PIO_win32_listen(theINTERP, ParrotIOLayer *layer, ParrotIO *io, INTVAL sec)
STREAM
or SEQ
sockets.static ParrotIO *PIO_win32_accept(theINTERP, ParrotIOLayer *layer, ParrotIO *io)
ParrotIO
socket.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.
Initially written by Melvin Smith.
|