Import Upstream version 20180207
[hcoop/debian/mlton.git] / basis-library / io / stream-io.sig
CommitLineData
7f918cf1
CE
1signature STREAM_IO =
2 sig
3 type elem
4 type instream
5 type out_pos
6 type outstream
7 type pos
8 type reader
9 type vector
10 type writer
11
12 val canInput: instream * int -> int option
13 val closeIn: instream -> unit
14 val closeOut: outstream -> unit
15 val endOfStream: instream -> bool
16 val filePosIn: instream -> pos
17 val filePosOut: out_pos -> pos
18 val flushOut: outstream -> unit
19 val getBufferMode: outstream -> IO.buffer_mode
20 val getPosOut: outstream -> out_pos
21 val getReader: instream -> reader * vector
22 val getWriter: outstream -> writer * IO.buffer_mode
23 val input1: instream -> (elem * instream) option
24 val input: instream -> vector * instream
25 val inputAll: instream -> vector * instream
26 val inputN: instream * int -> vector * instream
27 val mkInstream: reader * vector -> instream
28 val mkOutstream: writer * IO.buffer_mode -> outstream
29 val output1: outstream * elem -> unit
30 val output: outstream * vector -> unit
31 val setBufferMode: outstream * IO.buffer_mode -> unit
32 val setPosOut: out_pos -> outstream
33 end
34
35signature STREAM_IO_EXTRA =
36 sig
37 include STREAM_IO
38 type vector_slice
39
40 structure Close:
41 sig
42 type t
43
44 val close: t -> unit
45 val equalsInstream: t * instream -> bool
46 val make: instream -> t
47 end
48
49 val equalsIn: instream * instream -> bool
50 val equalsOut: outstream * outstream -> bool
51 val input1': instream -> elem option * instream
52 val inputLine: instream -> (vector * instream) option
53 val instreamReader: instream -> reader
54 val mkInstream': {bufferContents: (bool * vector) option,
55 closed: bool,
56 reader: reader} -> instream
57 val mkOutstream': {bufferMode: IO.buffer_mode,
58 closed: bool,
59 writer: writer} -> outstream
60 val outputSlice: outstream * vector_slice -> unit
61 val outstreamWriter: outstream -> writer
62 end
63
64signature STREAM_IO_EXTRA_FILE =
65 sig
66 include STREAM_IO_EXTRA
67
68 val inFd: instream -> Posix.IO.file_desc
69 val mkInstream'': {bufferContents: (bool * vector) option,
70 closeAtExit: bool,
71 closed: bool,
72 reader: reader} -> instream
73 val outFd: outstream -> Posix.IO.file_desc
74 val mkOutstream'': {bufferMode: IO.buffer_mode,
75 closeAtExit: bool,
76 closed: bool,
77 writer: writer} -> outstream
78 end