Next: cpg-ref-SP_free, Previous: cpg-ref-SP_foreign_stash, Up: cpg-bif [Contents][Index]
SP_fprintf()
#include <sicstus/sicstus.h> spio_t_error_code SP_fprintf( SP_stream *stream, char const *fmt, …);
Formatted output on the Prolog stream stream
.
The stream. Must be a text stream open for output.
The format string. This uses the same syntax as the C library
printf
functions.
The data to format.
On success, all data has been written and SPIO_S_NOERR
or some
other success code returned.
On failure, returns an error code without transferring any data. Error
codes with special meaning for SP_fprintf()
:
SPIO_E_PARAMETER_ERROR
The underlying C library function reported an error while formatting the string.
Other error codes may also be returned.
First the formatting operation will be performed. The resulting string
will be assumed to be in internal encoding, and will then be output
using the SP_put_encoded_string()
function. This means
e.g. that the ‘%c’ printf conversion specification can only be
used for ASCII characters, and the strings included using a ‘%s’
specification should also be encoded strings.