Next: , Previous: cpg-ref-SP_term_type, Up: cpg-bif

12.3.100 SP_unget_byte()


     #include <sicstus/sicstus.h>
       SP_stream *stream,
       int item);

Push back a byte so it can be read again by subsequent read operations.


The stream. Must be a binary stream open for input.
The byte to push back. This must be the byte that was most recently read from stream, e.g. with SP_get_byte(). As a special case, -1 can be put back if the last read operation returned end of file, i.e., SPIO_E_END_OF_FILE.

Return Value

On success, the byte has been pushed back and will be read by the next read operation. SPIO_S_NOERR or some other success code is returned.

On failure, an error code is returned.

See Also

cpg-ref-SP_get_byte. Prolog Streams.

Send feedback on this subject.