12.3.91 SP_set_user_stream_post_hook() [preinit]

Synopsis

     #include <sicstus/sicstus.h>
     
     typedef SP_stream *
     SP_UserStreamPostHook(void *user_data, int which, SP_stream *str);
     
     SP_UserStreamPostHook *
     SP_set_user_stream_post_hook(SP_UserStreamPostHook *hook, void *user_data);

Sets the user-stream post-hook to hook. Must be called before SP_initialize().

Arguments

hook
The user-stream post-hook is, if defined, called after all the streams have been defined, once for each of the three standard streams. It has a slightly different prototype:
          void user_stream_post_hook(void *user_data, int which, SP_stream *str)
     

where user_data is the value passed to SP_set_user_stream_post_hook and where str is a pointer to the corresponding SP_stream structure. There are no requirements as to what this hook must do; the default behavior is to do nothing at all.

The post-hook is intended to be used to do things that may require that all streams have been created.

user_data
An arbitrary pointer that will be passed to the hook.

See Also

Hookable Standard Streams.


Send feedback on this subject.