This library contains primitives to read lines, files, multiple
terms, etc. The package clib
provides a shared object (DLL)
named readutil
. If the library can locate this shared
object it will use the foreign implementation for reading character
codes. Otherwise it will use a Prolog implementation. Distributed
applications should make sure to deliver the readutil
shared object if performance of these predicates is critical.
On end-of-file the atom end_of_file
is returned. See
also
at_end_of_stream/[0,1].
read_header_data(Stream, Header) :- read_line_to_codes(Stream, Header, Tail), read_header_data(Header, Stream, Tail). read_header_data("\r\n", _, _) :- !. read_header_data("\n", _, _) :- !. read_header_data("", _, _) :- !. read_header_data(_, Stream, Tail) :- read_line_to_codes(Stream, Tail, NewTail), read_header_data(Tail, Stream, NewTail).
tail(Tail)
is defined, forming a difference-list.tail(Tail)
is defined, forming a difference-list.