1(*
2    Title:      Standard Basis Library: Imperative IO Signature
3    Copyright   David C.J. Matthews 2000
4
5    This library is free software; you can redistribute it and/or
6    modify it under the terms of the GNU Lesser General Public
7    License as published by the Free Software Foundation; either
8    version 2.1 of the License, or (at your option) any later version.
9    
10    This library is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13    Lesser General Public License for more details.
14    
15    You should have received a copy of the GNU Lesser General Public
16    License along with this library; if not, write to the Free Software
17    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18*)
19
20(* G&R 2004 status: checked, no change *)
21
22signature IMPERATIVE_IO =
23sig
24    structure StreamIO : STREAM_IO
25    type vector = StreamIO.vector
26    type elem = StreamIO.elem
27
28    type instream
29    type outstream
30    val input : instream -> vector
31    val input1 : instream -> elem Option.option
32    val inputN : instream * int -> vector
33    val inputAll : instream -> vector
34    val canInput : instream * int -> int Option.option
35    val lookahead : instream -> elem Option.option
36    val closeIn : instream -> unit
37    val endOfStream : instream -> bool
38    val output : outstream * vector -> unit
39    val output1 : outstream * elem -> unit
40    val flushOut : outstream -> unit
41    val closeOut : outstream -> unit
42    val mkInstream : StreamIO.instream -> instream
43    val getInstream : instream -> StreamIO.instream
44    val setInstream : instream * StreamIO.instream -> unit
45    val mkOutstream : StreamIO.outstream -> outstream
46    val getOutstream : outstream -> StreamIO.outstream
47    val setOutstream : outstream * StreamIO.outstream -> unit
48    val getPosOut : outstream -> StreamIO.out_pos
49    val setPosOut : outstream * StreamIO.out_pos -> unit
50end;
51