OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide
C Program Example
OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide—424822-001
B-13
#pragma page
/**************************************************************************/
/* Function Name: build_and_insert_ipm_object */
/* */
/* Arguments: root_id IN */
/* */
/* Return: Return code from the function call */
/* */
/* Description: This function creates the im_c_interpersonal_message */
/* with the initial value parameter set to FALSE. The */
/* function then inserts all the required attributes */
/* into the object. It also calls the function */
/* build_and_insert_txtbody_object and the function */
/* build_and_insert_ipmid_object to create and insert */
/* these subobjects. After this, it then inserts the */
/* object into the root object. */
/**************************************************************************/
unsigned short build_and_insert_ipm_object (unsigned long root_id)
{
 unsigned short
 local_rc; /* Return code from the function call */
 unsigned long
 descriptor_count = 4, /* Count of the elements */
 local_object; /* Local object identifier */
 OM_descriptor
 descriptor_list[] =
 {
 IM_T_AUTO_FORWARDED, OM_S_BOOLEAN, { OM_FALSE },
 IM_T_IMPORTANCE, OM_S_ENUMERATION, { IM_ROUTINE },
 IM_T_SENSITIVITY, OM_S_ENUMERATION, { IM_NOT_SENSITIVE },
 IM_T_SUBJECT, OM_S_TELETEX_STRING, { 10 , "MY SUBJECT" }
 };
 printf (" Create the object\n");
 local_rc = GPI_OM_CREATE_ ( IM_C_INTERPERSONAL_MESSAGE,
 OM_FALSE, /* Without defined initial */
 /* values */
 &local_object,
 root_id, /* Root object identifier */
 ); /* Session not necessary */
 if (( local_rc == OM_RC_SUCCESS ) || ( local_rc == ZGPI_RC_WARNING ))
 {
 if ( local_rc == ZGPI_RC_WARNING )
 printf (" WARNING! number: %d \n", local_rc );
 printf (" Insert all the required attributes\n");
 local_rc = GPI_OM_INSERT_ ( local_object,
 IGNORED_FOR_SINGLE_VALUED_ATT,
 descriptor_list,
 descriptor_count);
 if (( local_rc == OM_RC_SUCCESS ) || ( local_rc == ZGPI_RC_WARNING ))
 {
 if ( local_rc == ZGPI_RC_WARNING )
 printf (" WARNING! number: %d \n", local_rc );
 printf (" Object IA5 TEXT BODY PART\n");
 local_rc = build_and_insert_txtbody_object (root_id,local_object);










