OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide

C Program Example
OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide424822-001
B-31
/* the number of attributes in the message. */
/* f_desc_list contains the same attributes as */
/* print_data, but in the OM_descriptor structure. It */
/* is used as the input for GPI_OM_FETCH_, which */
/* will fill in the value fields. desc_list */
/* contains all the attributes from the same level as */
/* the object to be printed. */
/* The function will search through desc_list for */
/* the object identifier of local_type. With this */
/* object identifier, the function will call */
/* GPI_OM_FETCH_ to get the values of the attributes */
/* in f_desc_list. When it has these values */
/* (attribute_list_out), it calls the function */
/* print_attributes to print them to the screen. */
/**************************************************************************/
void print_object ( unsigned short
local_type, /* Type of the object */
unsigned long
number_of_attri, /* Number of attributes in the */
/* array print_data */
PRINT_DEF
*print_data, /* Array with the type and print */
/* string for the attributes */
OM_descriptor
*f_desc_list, /* Descriptor list for fetch */
OM_descriptor
*desc_list, /* Descriptor list */
unsigned long
max_number) /* Number of elements in the */
/* descriptor list */
{
short
exist; /* Position of the element in the array */
unsigned short
local_rc; /* Return code from a function call */
unsigned long
actual_string_len, /* Returns the actual number of bytes */
total_string_len; /* Returns the total number of bytes */
char
string_buffer[STRING_BUFFER_LEN]; /* Buffer for the strings */
OM_descriptor
descriptor_list_out[MAX_DESCRIPTORS];
/* Locate the object in the descriptor list */
exist = search_descriptor ( local_type,
desc_list,
max_number);
if ( exist > -1 )
{
/*
* This object identifier is only needed to show
* the use of the function GPI_OM_READ_.
*/
read_object_id = desc_list[exist].value.object.object;
/* Fetch the attributes from the object */