The Prolog representation of a Prolog stream provides a way of retrieving information from its corresponding C stream
It is currently represented as a Prolog term in the form of
'$stream'(N) where N is an integer to identify the stream.
However, a user application should not explicitly create such a Prolog
term as a Prolog stream,
it should only be obtained through
stream_code/2. In C code, a Prolog stream is
represented as a pointer to structure of type
The formatting information along with bottom layer functions of a stream
is stored in its
QP_stream structure. A stream behavior
depends on the values of fields in its
The options specified in
open/4 are converted and stored in the
QP_stream structure created for the stream.
Selected fields in
QP_stream that can be accessed and
modified by an application
are described in the remainder of the section.
Most of these fields are option fields, which can be specified