PreviousUpNext

15.3.492  src/lib/std/src/io/winix-file-for-os.api

## winix-file-for-os.api
#
# This defines the multithreaded api for our basic file-io layer
# above the low-level file-io driver layer defined by
#
#     src/lib/std/src/io/winix-base-file-io-driver-for-os.api
#
# This is the multithread adaptation of
#
#     src/lib/std/src/io/winix-file-for-os--premicrothread.api
#
# It differs in adding mailop-valued operations.

# 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
herein

    api Winix_File_For_Os {
        #
        Vector;
        Element;

        Input_Stream;
        Output_Stream;

        read:                            Input_Stream -> Vector;
        read_one:                        Input_Stream -> Null_Or( Element );

        read_n:                         (Input_Stream, Int) -> Vector;
        read_all:                        Input_Stream -> Vector;

        peek:                            Input_Stream -> Null_Or( Element );            # Return next element in stream (if any) without advancing file pointer.

        close_input:                     Input_Stream -> Void;
        end_of_stream:                   Input_Stream -> Bool;

        write:        (Output_Stream, Vector) -> Void;
        write_one:    (Output_Stream, Element) -> Void;
        flush:         Output_Stream -> Void;
        close_output:  Output_Stream -> Void;
                                                                                        # Winix_Pure_File_For_Os                is from   src/lib/std/src/io/winix-pure-file-for-os.api

        package pur:  Winix_Pure_File_For_Os;                                           # "pur" is short for "pure" (I/O).
                      sharing Vector  == pur::Vector;
                      sharing Element == pur::Element;

    /*
        get_pos_in:     Input_Stream -> pur::in_pos
        set_pos_in:     (Input_Stream, pur::in_pos) -> Void
    */
        make_instream:   pur::Input_Stream -> Input_Stream;

        get_instream:  Input_Stream -> pur::Input_Stream;
        set_instream:  (Input_Stream, pur::Input_Stream) -> Void;

        get_output_position:     Output_Stream -> pur::Out_Position;
        set_output_position:    (Output_Stream, pur::Out_Position) -> Void;

        make_outstream:   pur::Output_Stream -> Output_Stream;

        get_outstream:  Output_Stream -> pur::Output_Stream;
        set_outstream:  (Output_Stream, pur::Output_Stream) -> Void;

        input1evt:         Input_Stream       -> thr::Mailop( Null_Or( Element ) );
        input_nevt:       (Input_Stream, Int) -> thr::Mailop( Vector );
        input_mailop:      Input_Stream       -> thr::Mailop( Vector );
        input_all_mailop:  Input_Stream       -> thr::Mailop( Vector );

    };
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