12.3.28 SP_get_code()

Synopsis

     #include <sicstus/sicstus.h>
     
     spio_t_error_code
     SP_get_code(
       SP_stream *stream);

Read a character code from a text stream.

Arguments

stream
The stream. Must be a text stream open for input.

Return Value

On success, the character just read will be returned, cast to a spio_t_error_code. The value returned on successful return will never be negative.

On failure, returns an error code, recognizable with SPIO_FAILED(). Error codes are always negative.

Description

Note that SP_get_code() is implemented as a macro and may evaluate the stream argument more than once.

See Also

cpg-ref-SP_get_byte. Prolog Streams.


Send feedback on this subject.