D Eloquence Library

The ERROR Function

The ERROR function interprets the status array and returns the corresponding error or warning message. The syntax is as follows:

   int cc = idb_error(status,buffer,length)

   int status[10];
   char buffer[80];
   int *length;
The parameters are:

status
The status parameter of any failed function call (see below).
buffer
A pointer to a character array of at least 80 bytes. Used to return the message. The buffer will terminate with backslash 0 ('\0').
length
A NULL pointer, or a pointer to an integer to return the byte length of the message returned in buffer (except '\0').

Description

The idb_error function call returns a message explaining the specified status code. The message is returned to the buffer specified in the idb_error call.

Return value

Returns 0 if successful, or -1 if an error was encountered.

Example

   char buf[80];
   int status[10];

   ...

   if(idb_error(status, buf, NULL)) {
      printf("unable to analyze status");
      exit(1);
   }
The above will get a descriptive message for a failed idb function.


Eloquence Database Manual - 19 DEC 2002