odm_err_msg Subroutine

Purpose

Returns an error message string.

Library

Object Data Manager Library (libodm.a)

Syntax

#include <odmi.h>

int odm_err_msg ( ODMErrno MessageString)
long ODMErrno;
char **MessageString;

Description

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.

Parameters

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.

Return Values

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.

Examples

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 );