SP_next_stream()
#include <sicstus/sicstus.h> spio_t_error_code SP_next_stream(SP_stream *stream, SP_stream **pnext);
Iterate through all Prolog streams.
NULL
then *pnext
is set to the first stream in the list of streams. If this is non-NULL
then the stream following stream in the list of streams is returned in *pnext
.
*pnext
.
On success, *pnext
is assigned, and
SPIO_S_NOERR
or some other success code is returned. You should
use the SPIO_FAILED()
macro to determine if the return value
signifies failure or success.
When stream
is the last stream *pnext
is set to NULL
.
This function can be used to iterate over all Prolog streams. One way
to use this is together with SP_get_stream_user_data
to find
all currently open user defined streams of a particular type.