


## threadkit-winix-io.api
# Compiled by:
# src/lib/std/standard.lib# The threadkit version of the generic low-level I/O interface.
api Threadkit_Winix_Io {
#
eqtype Io_Descriptor;
#
# An Io_Descriptor is an abstract descriptor for an OS entity that
# supports I/O (e.g., file, tty device, socket, ...).
eqtype Io_Descriptor_Kind;
hash: Io_Descriptor -> Unt;
#
# Return a hash value for the I/O descriptor.
compare: (Io_Descriptor, Io_Descriptor) -> Order;
#
# Compare two I/O descriptors
kind: Io_Descriptor -> Io_Descriptor_Kind;
#
# Return the kind of I/O descriptor.
package kind
:
api {
file: Io_Descriptor_Kind;
dir: Io_Descriptor_Kind;
symlink: Io_Descriptor_Kind;
tty: Io_Descriptor_Kind;
pipe: Io_Descriptor_Kind;
socket: Io_Descriptor_Kind;
device: Io_Descriptor_Kind;
};
Wait_Request
=
{ io_descriptor: Io_Descriptor,
readable: Bool,
writable: Bool,
oobdable: Bool # Out-Of-Band-Data available on socket or PTY.
};
#
# Public representation of a polling operation on
# an I/O descriptor.
Wait_Result = Wait_Request; # A synonym to clarify declarations.
exception BAD_WAIT_REQUEST;
wait_for_io_opportunity
:
( List( Wait_Request ),
Null_Or( time::Time ) # Timeout: NULL means wait indefinitely; (THE time::zero_time) means do not block.
)
->
List( Wait_Result );
wait_for_io_opportunity_mailop
:
List( Wait_Request )
->
mailop::Mailop( List( Wait_Result ) );
# Deprecated synonyms for above, mainly so that unix
# folks looking for 'select' in the function index
# will get led here:
#
select
:
( List( Wait_Request ),
Null_Or( time::Time ) # Timeout: NULL means wait indefinitely; (THE time::zero_time) means do not block.
)
->
List( Wait_Result );
select_mailop
:
List( Wait_Request )
->
mailop::Mailop( List( Wait_Result ) );
}; # Winix_Io
## COPYRIGHT (c) 1995 AT&T Bell Laboratories.
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2012,
## released under Gnu Public Licence version 3.


