FTAM/9000 Programmer's Guide

196 Chapter 4
Using Support Functions
Translating Error Messages
Translating Error Messages
FTAM and Event Management functions return Return_codes.
To translate errors returned by Event Management to character
strings, invoke em_gperror().
To translate errors return by FTAM functions to character strings,
invoke ft_gperror().
em_gperror()
#include %</opt/ftam/include/map.h>
Return_code
em_gperror(input_result, return_string, vendor_string, result)
Api_rc *input_result;
Octet **return_string;
Octet **vendor_string;
Api_rc *result;
The em_gperror() function translates the input_result structure from
Event Management functions to character strings, as follows:
The input_result->return_code is translated to a character string
called return_string.
The input_result->vendor_code is translated to a character string
called vendor_string.
If the address that the return_string points to is NULL, the interface
automatically allocates the required memory. After em_gperror()
returns, you must use em_fdmemory() to free the memory. Do not use
free() to deallocate memory allocated by FTAM.
If the address that the return_string points to is not NULL, the value
must be the address of the memory that was previously allocated. The
specified data area must be large enough to hold a 256-byte string
(including the NULL-terminator).
You may receive unpredictable results if using free() for memory
allocated by em_gperror().