Defining a New Stream
The following steps are required to define a new stream in C:
- Define low level functions (character reading, writing etc).
- Initialize and open your stream.
- Allocate memory needed for your particular stream.
- Initialize and install a Prolog stream with
SP_make_stream()
or SP_make_stream_context()
.
- Initialize additional fields. Some streams may require additional
changes to the fields in the
SP_stream
structure than the default
values set by SP_make_stream()
.