OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide

C Program Example
OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide424822-001
B-21
printf (" WARNING! number: %d \n", local_rc );
printf (" ");
printf ("Insert the object into the MH_C_MESSAGE_RD object\n");
descriptor_count = 1;
descriptor_list[0].type = MH_T_RECIPIENT_NAME;
descriptor_list[0].syntax = OM_S_OBJECT;
descriptor_list[0].value.object.padding = 0;
descriptor_list[0].value.object.object = local_object;
local_rc = GPI_OM_INSERT_ ( object_id, /* Object identifier from */
/* the layer above */
IGNORED_FOR_SINGLE_VALUED_ATT,
descriptor_list,
descriptor_count);
} /* if */
} /* if */
return (local_rc);
} /* build_and_insert_rdorname_object */
#pragma page
/**************************************************************************/
/* Function Name: build_and_insert_messagerd_object */
/* */
/* Arguments: root_id IN */
/* */
/* Return: Return code from the function call */
/* */
/* Description: This function will create two mh_c_message_rd */
/* objects to show how to create multi-valued */
/* attributes. The first mh_c_message_rd object is */
/* created with the initial value parameter set to */
/* FALSE. The function then inserts all the required */
/* attributes into the object. It then inserts the */
/* object into the root object. The second message_rd */
/* is created in an awkward way to demonstrate the usage*/
/* of some GPI_* functions. First the function makes a */
/* copy of the first created message_rd. To replace */
/* the rdorname_object, we first need to get the object */
/* identifier of this object (using GPI_OM_EXAMINE */
/* and search_descriptor). Then the function deletes it */
/* and calls build_and_insert_rdorname_object with the */
/* second flag. The function then changes the recipient */
/* number by removing the old value and inserting a new */
/* one. When all this is done, the second */
/* mh-c-message-rd is inserted into the root object. */
/**************************************************************************/
unsigned short build_and_insert_messagerd_object (unsigned long root_id)
{
short
exist; /* Position of the attribute in the */
/* descriptor list */
unsigned short
local_rc; /* Return code from the function call */
unsigned long
descriptor_count = 5, /* Count of the elements */
total_number, /* Total number of elements that can be */
/* returned */
local_object, /* Local object identifier */