From 87217fe5ba58f5199d30586b5d9bec104dece445 Mon Sep 17 00:00:00 2001 From: Vladimir Azarov Date: Mon, 24 Mar 2025 21:51:16 +0100 Subject: Partition into structures --- stream.sig | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 stream.sig (limited to 'stream.sig') diff --git a/stream.sig b/stream.sig new file mode 100644 index 0000000..98cfb65 --- /dev/null +++ b/stream.sig @@ -0,0 +1,36 @@ +signature STREAM = sig + type fileId = int + type fileOffset = int + type pos = fileId * fileOffset + type convPos = string * int * int option + + type filesInfo = (fileId * string * string) list + + exception EndOfStream + exception EndOfFile + + exception LineWithoutNl + + type t + + val extractFilesInfo: t -> filesInfo + + val pos2str: convPos -> string + val printPos: (fileId * string * string) list -> pos -> unit + + val getchar: t -> char * t + val ungetc: t -> t + val readline: t -> string * t + + val getOffset: t -> fileOffset + val getPos: t -> pos + val getPosAfterCharRead: t -> pos + val getPposFromPos: pos -> t -> convPos + + val getSubstr: fileOffset -> fileOffset -> t -> string + val isFirstOnLine: pos -> t -> bool + + val advanceToNewFile: t -> t + + val streamInit: string -> t +end -- cgit v1.2.3