Node:Writing User-stream Hooks, Next:Writing User-stream Post-hooks, Previous:Hookable Standard Streams, Up:Hookable Standard Streams
The user-stream hook is, if defined, called during
SP_initialize()
. It has the following prototype:
SP_stream *user_stream_hook(int which)
If the hook is not defined, SICStus will attempt to open the standard TTY/console versions of these streams. If they are unavailable (such as for windowed executables under Windows), the result is undefined.
It is called three times, one for each stream. The which
argument
indicates which stream it is called for. The value of which
is one of:
SP_STREAMHOOK_STDIN
SP_STREAMHOOK_STDOUT
SP_STREAMHOOK_STDERR
The hook should return a standard SICStus I/O stream, as described in Defining a New Stream.