PreviousUpNext

15.3.486  src/lib/std/src/io/winix-base-file-io-driver-for-os.api

## winix-base-file-io-driver-for-os.api
#
# This is a multithreaded replacement for standard.lib's
#
#     src/lib/std/src/io/winix-base-file-io-driver-for-os--premicrothread.api
#
# The differences are that we use mailop-valued
# interfaces instead of non-blocking operations,
# and that the operations are not optional.
#
# This is the lowest layer in the multithreaded file I/O stack;
# The api for the next layer up is defined by
#
#     src/lib/std/src/io/winix-file-for-os.api
#

# Compiled by:
#     src/lib/std/standard.lib


stipulate
    package thr =  threadkit;                                                   # threadkit                     is from   src/lib/src/lib/thread-kit/src/core-thread-kit/threadkit.pkg
    package wnx =  winix__premicrothread;                                       # winix__premicrothread         is from   src/lib/std/winix--premicrothread.pkg
    package wio =  winix__premicrothread::io;                                   # winix_io__premicrothread      is from   src/lib/std/src/posix/winix-io--premicrothread.pkg
herein

    api Winix_Base_File_Io_Driver_For_Os {
        #
        Mailop(X)   = thr::Mailop(X);

        Rw_Vector;
        Vector;
        Element;
        Vector_Slice;
        Rw_Vector_Slice;
        eqtype File_Position;

        compare:  (File_Position, File_Position) -> Order;

        Filereader
            =
            FILEREADER
              {
                filename:               String, 
                best_io_quantum:        Int,

                read_vector:            Int -> Vector,

                read_vector_mailop:     Int -> Mailop( Vector ),

                avail:                  Void -> Null_Or( Int ),                 # Number of items which can definitely be read without blocking.

                get_file_position:      Null_Or( Void -> File_Position ),
                set_file_position:      Null_Or( File_Position -> Void ),

                end_file_position:      Null_Or( Void -> File_Position ),
                verify_file_position:   Null_Or( Void -> File_Position ),

                close:                  Void -> Void,

                io_descriptor:          Null_Or( wio::Iod )
              };

        Filewriter
            =
            FILEWRITER
              {
                filename:               String,
                best_io_quantum:        Int,

                write_vector:              Vector_Slice -> Int,
                write_rw_vector:        Rw_Vector_Slice -> Int,

                write_vector_mailop:       Vector_Slice -> Mailop( Int ),
                write_rw_vector_mailop: Rw_Vector_Slice -> Mailop( Int ),

                get_file_position:      Null_Or( Void -> File_Position ),
                set_file_position:      Null_Or( File_Position -> Void ),

                end_file_position:      Null_Or( Void -> File_Position ),
                verify_file_position:   Null_Or( Void -> File_Position ),

                close:                  Void -> Void,

                io_descriptor:          Null_Or( wio::Iod )
              };

    };
end;


## COPYRIGHT (c) 1991 John H. Reppy.
## COPYRIGHT (c) 1996 AT&T Research.
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext