QP_error_message() #include <quintus/quintus.h>
int QP_error_message(errno, is_qp_error, error_string)
int errno;
int *is_qp_error;
char **error_string;
This function supplies the text corresponding to the error number errno. The output parameter is_qp_error can be used to determine if the error number was one created by Quintus or is a system error number.
Typically, the error number of interest is the one in the global variable
QP_errno. This variable is discussed in the man pages for
QP_perror().
QP_SUCCESS
The following fragment takes the status value returned by some function that returns C calling Prolog style status values and prints out the corresponding error.
#include <quintus/quintus.h>
...
int is_qp_error;
char *error_message;
...
status = some_function();
switch(status) {
case QP_ERROR:
(void) QP_error_message(QP_errno, &is_qp_error,
&error_message);
if(is_qp_error)
(void) QP_fputs("prolog error: ", QP_stderr);
else (void) QP_fputs("UNIX error: ", QP_stderr);
(void) QP_fputs(error_message, QP_stderr);
(void) QP_fnewln(QP_stderr);
...
QP_perror()