12.1 Return Values and Errors

Many, but not all, C functions return one of the codes SP_SUCCESS for success, SP_FAILURE for failure, SP_ERROR if an error condition occurred, or if an uncaught exception was raised during a call from C to Prolog. If the value is SP_ERROR, the macro SP_errno will return a value (an integer) describing the error condition.

The function SP_error_message() returns a pointer to the diagnostic message corresponding to a specified error number.

See mpg-ref-ove for a description of the conventions observed in the Reference Pages for Prolog predicates. C function Reference Pages differ primarily in the synopsis. Also, the Reference Page for each C function documents its return values.

The following function annotations are used in the Reference Pages:

hook
The function is user defined and is called in some specific context.


macro
The function is defined as a C macro.


preinit
It is only meaningful to call the function before initializing the Prolog engine

Send feedback on this subject.