OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide

C Program Example
OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide424822-001
B-33
total_string_len, /* Returns the total number of bytes */
total_string_len_2, /* Returns the total number of bytes */
max_PRINT_DEF = 7; /* Number of attributes to print */
char
string_buffer[STRING_BUFFER_LEN], /* Buffer for the strings */
string_buffer_2[STRING_BUFFER_LEN]; /* Buffer for the strings */
PRINT_DEF
print_arr[7] =
{
MH_T_ALTERNATE_RECIP_ALLOWED, " Alternate Recip Allowed: ",
MH_T_CONTENT_IDENTIFIER, " Content Identifier: ",
MH_T_CONTENT_RETURN_REQUESTED, " Content Return Request: ",
MH_T_CONTENT_TYPE, " Content Type: ",
MH_T_CONVERSION_PROHIBITED, " Conversion Prohibited: ",
MH_T_DISCLOSURE_ALLOWED, " Disclosure Allowed: ",
MH_T_PRIORITY, " Priority: "
};
OM_descriptor
descriptor_list[MAX_DESCRIPTORS], /* First descriptor list */
descriptor_list_2[MAX_DESCRIPTORS], /* Second descriptor list */
descriptor_list_3[MAX_DESCRIPTORS], /* Third descriptor list */
f_descriptor_list[MAX_DESCRIPTORS]; /* Descriptor list for fetch */
local_rc = GPI_OM_EXAMINE_ ( root_id, /* Root object identifier */
OM_TRUE, /* Values returned */
0, /* First element */
MAX_DESCRIPTORS,
descriptor_list,
&total_number,
&actual_number,
string_buffer,
STRING_BUFFER_LEN,
&actual_string_len,
&total_string_len );
if (( local_rc == OM_RC_SUCCESS ) || ( local_rc == ZGPI_RC_WARNING ))
{
if ( local_rc == ZGPI_RC_WARNING )
printf (" WARNING! number: %d \n", local_rc );
/* Include the class in the count */
printf (" Number of attributes: %d \n\n", total_number - 1);
/* Print all root attributes that aren't objects */
print_attributes ( max_PRINT_DEF,
print_arr,
descriptor_list,
actual_number);
/* Print bilateral information */
max_PRINT_DEF = 3;
f_descriptor_list[0].type = MH_T_ADMD_NAME;
f_descriptor_list[1].type = MH_T_COUNTRY_NAME;
f_descriptor_list[2].type = MH_T_INFORMATION;
print_arr[0].type = MH_T_ADMD_NAME;
print_arr[1].type = MH_T_COUNTRY_NAME;
print_arr[2].type = MH_T_INFORMATION;
print_arr[0].text = " Admd Name: ";
print_arr[1].text = " Country Name: ";
print_arr[2].text = " Information: ";