Next: , Previous: , Up: cpg-bif   [Contents][Index]


12.3.60 SP_next_stream()

Synopsis

#include <sicstus/sicstus.h>

spio_t_error_code
SP_next_stream(SP_stream *stream, SP_stream **pnext);

Iterate through all Prolog streams.

Arguments

stream

If this is 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

The returned stream is returned in *pnext.

Return Value

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.

See Also

SICStus Streams.


Send feedback on this subject.