PreviousUpNext

15.3.563  src/lib/std/src/winix/winix-io.api

## winix-io.api

# Compiled by:
#     src/lib/std/src/standard-core.sublib



# A sub-api of api Winix:
#
#     src/lib/std/src/winix/winix.api

# This api is implemented in:
#
#     src/lib/std/src/posix/winix-io.pkg
#
api 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;

    # Block on a set of I/O descriptors until
    # an I/O opportunity arises or until
    # specified timeout expires.
    #
    # See also the 'wait_for_io_opportunity' operation in:   src/lib/std/src/socket/socket.api
    #
    wait_for_io_opportunity
      :
      { wait_requests:  List( Wait_Request ),
        timeout:        Null_Or( time::Time )                   # Timeout: NULL means wait forever, (THE time::zero_time) means do not block.
      }
      ->
      List( Wait_Result );

    # Deprecated synonym for above, mainly so that unix folks
    # looking for 'select' in the function index will get led here:
    #
    select
      :
      { wait_requests:  List( Wait_Request ),
        timeout:        Null_Or( time::Time )
      }
      ->
      List( Wait_Result );

};                                                              # api 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.


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext