1 (* Copyright (C
) 1999-2006 Henry Cejtin
, Matthew Fluet
, Suresh
2 * Jagannathan
, and Stephen Weeks
.
3 * Copyright (C
) 1997-2000 NEC Research Institute
.
5 * MLton is released under a BSD
-style license
.
6 * See the file MLton
-LICENSE for details
.
9 structure TextIO: TEXT_IO_EXTRA
=
13 (structure Array
= CharArray
14 structure ArraySlice
= CharArraySlice
15 structure PrimIO
= TextPrimIO
16 structure Vector = CharVector
17 structure VectorSlice
= CharVectorSlice
18 val chunkSize
= Int32
.toInt (Primitive
.Controls
.bufSize
)
19 val fileTypeFlags
= [PrimitiveFFI
.Posix
.FileSys
.O
.TEXT
]
20 val line
= SOME
{isLine
= fn c
=> c
= #
"\n",
22 val mkReader
= Posix
.IO
.mkTextReader
23 val mkWriter
= Posix
.IO
.mkTextWriter
24 val someElem
= (#
"\000": Char.char
)
25 val xlatePos
= SOME
{fromInt
= fn i
=> i
,
33 fun outputSubstr (s
, ss
) = outputSlice (s
, ss
)
36 val outputSubstr
= outputSlice
38 val openString
= openVector
40 fun print (s
: string) = (output (stdOut
, s
); flushOut stdOut
)
43 structure TextIOGlobal
: TEXT_IO_GLOBAL
= TextIO