OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide

C Program Example
OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide424822-001
B-6
total_info_len);
/* access info buffer memory only if a buffer was provided */
if ( actual_info_len > 0 )
{
buffer_adress = &buffer;
do
{
print_info_buffer (buffer_adress,&structure_size);
actual_info_len = actual_info_len - structure_size;
if ( actual_info_len > 0 )
{
/* Add calculation for second buffer */
actual_info_len = 0;
} /* if */
}
while ( actual_info_len > 0 );
}; /* if */
if ( total_info_len > ZGPI_MAX_STATUS_BUF_LEN )
{
printf (" The size of the info buffer is too small \n");
printf (" to get all of the information. \n\n");
} /* if */
} /* if */
else
{
printf (" No Info - buffer present\n\n");
} /* else */
} /* if */
else
{
printf (" GPI_STATUS_ failed! Error: %d \n\n", local_rc );
} /* else */
} /* show_gpi_status */
#pragma page
/**************************************************************************/
/* Function Name: search_descriptor */
/* */
/* Arguments: type IN */
/* att_list IN */
/* number IN */
/* */
/* Return: Position of the type in the descriptor list */
/* ( -1 if no element is found) */
/* */
/* Description: This function searches for the type in the */
/* descriptor list and returns the position of the */
/* type. */
/**************************************************************************/
short search_descriptor (unsigned short type, /* Type to search for */
OM_descriptor *att_list, /* Descriptor list */
unsigned long number) /* Number of elements */
/* in the descriptor */
/* list */
{
short
counter = 0, /* Counter for the loop */
position = -1; /* Position of the element */