OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide
C Program Example
OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide—424822-001
B-3
unsigned long
read_object_id; /* This object identifer is used for calling */
/* GPI_OM_READ_. It contains the object identifer */
/* under which the attribute to be read is found. */
#pragma page
/**************************************************************************/
/* Function Name: print_info_buffer */
/* */
/* Arguments: buffer_in IN */
/* buffer_size OUT */
/* */
/* Description: This function prints the info_buffer, which is */
/* returned by the GPI_STATUS_ function call. It */
/* shows more detailed information about the error. */
/**************************************************************************/
void print_info_buffer ( ERROR_INFO *buffer_in,
unsigned short *buffer_size)
{
unsigned short
counter; /* counter for the loop */
switch (buffer_in->structure_type)
{
case ZGPI_ST_ERROR_ATTR:
*buffer_size = (unsigned short) sizeof (buffer_in->info_struc_1);
printf (" Structure type: Error attribute \n");
printf ("\n Object identifier: %ld\n",
buffer_in->info_struc_1.z_data.z_obj_id);
printf (" Object class: %d\n",
buffer_in->info_struc_1.z_data.z_obj_class);
printf (" Object type : %d\n",
buffer_in->info_struc_1.z_data.z_obj_type);
printf (" Attribute descriptor\n");
printf (" Attribute type: %d\n",
buffer_in->info_struc_1.z_data.z_attr_dscr.type);
printf (" Attribute syntax: %d\n",
buffer_in->info_struc_1.z_data.z_attr_dscr.syntax);
printf (" Attribute value: ");
/*
* Print the bytes in hex, because some of the characters may not
* be printable.
*
*/
printf (" String value: ");
for ( counter = 0; counter < 16; counter++)
{
if (buffer_in->info_struc_1.z_data.z_attr_string_value[counter]
== '\0')
break;
else
printf(" %x",
buffer_in->info_struc_1.z_data.z_attr_string_value[counter]);
} /* for */
printf ("\n\n");
break;
case ZGPI_ST_DANGLING_OBJ:
*buffer_size = (unsigned short) sizeof (buffer_in->info_struc_2);
printf (" Structure type: Dangling object \n");
printf ("\n ROOT object identifier: %ld\n",
buffer_in->info_struc_2.z_data.z_root_obj_id);
printf (" Object count: %d\n",