Returns an error message string.
Object Data Manager Library (libodm.a)
#include <odmi.h>
int odm_err_msg ( ODMErrno, MessageString)
long ODMErrno;
char **MessageString;
The odm_err_msg subroutine takes as input an ODMErrno parameter and an address in which to put the string pointer of the message string that corresponds to the input ODM error number. If no corresponding message is found for the input error number, a null string is returned and the subroutine is unsuccessful.
Item | Description |
---|---|
ODMErrno | Specifies the error code for which the message string is retrieved. |
MessageString | Specifies the address of a string pointer that will point to the returned error message string. |
Upon successful completion, a value of 0 is returned. If the odm_err_msg subroutine is unsuccessful, a value of -1 is returned, and the MessageString value returned is a null string.
The following example shows the use of the odm_err_msg subroutine:
#include <odmi.h>
char *error_message;
...
/*--------------------------------------------------------------*/
/*ODMErrno was returned from a previous ODM subroutine call.*/
/*--------------------------------------------------------------*/
returnstatus = odm_err_msg ( odmerrno, &error_message );
if ( returnstatus < 0 )
printf ( "Retrieval of error message failed\n" );
else
printf ( error_message );