Next: cpg-ref-SP_set_user_stream_post_hook, Previous: cpg-ref-SP_set_memalloc_hooks, Up: cpg-bif [Contents][Index]
SP_set_user_stream_hook()
preinit#include <sicstus/sicstus.h> typedef SP_stream * SP_UserStreamHook(void *user_data, int which); SP_UserStreamHook * SP_set_user_stream_hook(SP_UserStreamHook *hook, void *user_data);
Sets the user-stream hook to hook
.
Must be called before SP_initialize()
.
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
Create stream for standard input.
SP_STREAMHOOK_STDOUT
Create stream for standard output.
SP_STREAMHOOK_STDERR
Create stream for standard error.
The hook should return a standard SICStus text I/O stream, as described in Defining a New Stream.
An arbitrary pointer that will be passed to the hook
.