OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide
C Program Example
OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide—424822-001
B-5
/* information to the screen. It is called if */
/* a warning or an error is detected. It shows detailed */
/* information about the warning or error. */
/**************************************************************************/
void show_gpi_status (short status_context)
{
short
local_session; /* Session identifier from the error */
unsigned short
structure_size, /* Size of the structure */
local_rc = 0, /* Return code from the function call */
request_type, /* Request type for the most recent error */
old_status, /* The original status for the most recent */
/* error */
error_class, /* The class of the most recent error */
primary_code, /* The primary code for the most recent error */
secondary_code, /* The secondary code for the most recent error*/
error_qualifier, /* Qualifying information for the most recent */
/* error */
error_source, /* The source for the most recent error */
info_buffer_len = ZGPI_MAX_STATUS_BUF_LEN ,
/* Length of the info buffer */
actual_info_len, /* Bytes of error information returned */
total_info_len; /* Total number of bytes of error information */
ERROR_INFO
buffer;
void
*buffer_adress;
local_rc = GPI_STATUS_ ( status_context,
&local_session,
&request_type,
&old_status,
&error_class,
&primary_code,
&secondary_code,
&error_qualifier,
&error_source,
buffer.info_buffer,
info_buffer_len,
&actual_info_len,
&total_info_len ) ;
if (( local_rc == OM_RC_SUCCESS ) || ( local_rc == ZGPI_RC_WARNING ))
{
if ( local_rc == ZGPI_RC_WARNING )
printf (" WARNING from GPI_STATUS_! number: %d \n", local_rc );
printf ("\n Error Information \n");
printf (" ================= \n\n");
printf (" Request type: %d \n", request_type);
printf (" Session: %d \n", local_session);
printf (" Client return code: %d \n", old_status);
printf (" Error class: %d \n", error_class);
printf (" Primary code: %d \n", primary_code);
printf (" Secondary code: %d \n", secondary_code);
printf (" Qualifier code: %d \n", error_qualifier);
printf (" Error source: %d \n", error_source);
printf ("\n Info - buffer:\n");
if ( total_info_len > 0 )
{
printf (" Total info buffer size: %d \n\n",