For each new stream the appropriate low level I/O functions have
to be defined. Error handling, prompt handling and character counting
is handled in a layer above these functions. They all operate on a user
defined private data structure pointed out by user_handle
in
SP_stream
.
User defined low level I/O functions may invoke Prolog code and use most
of the support functions described in the other sections of this
chapter. They must not use SP_fail()
or
SP_raise_exception()
, doing so will not have the intended effect
and may cause problems.
int
my_fgetc(void *handle)
int
my_fputc(char c, void *handle)
c
and return the character written.
int
my_flush(void *handle)
int
my_eof(void *handle)
void
my_clrerr(void *handle)
EOF
indicators.
int
my_close(void *handle)