OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide
C Program Example
OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide—424822-001
B-12
 string_offset = ZGPI_NEW_VALUE;
 local_rc = GPI_OM_WRITE_ ( local_object,
 IM_T_TEXT, /* Attribute type */
 IGNORED_FOR_SINGLE_VALUED_ATT,
 &string_offset, /* String offset */
 data_string, /* Data string */
 element_number, /* Element number */
 OM_S_IA5_STRING ); /* Syntax */
 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 (" ");
 printf ("Use GPI_OM_WRITE_ to write the second line\n");
 /* Write the second string to the attribute */
 data_string = "This is the second line.";
 element_number = strlen (data_string);
 local_rc = GPI_OM_WRITE_ ( local_object,
 IM_T_TEXT, /* Attribute type */
 IGNORED_FOR_SINGLE_VALUED_ATT,
 &string_offset, /* The output from */
 /* the previous call*/
 /* is the new input */
 data_string, /* Data string */
 element_number,/* Element number */
 OM_S_IA5_STRING ); /* Syntax */
 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 (" ");
 printf ("Insert the object into the ");
 printf ("IM_C_INTERPERSONAL_MESSAGE object\n");
 descriptor_count = 1;
 descriptor_list[0].type = IM_T_BODY;
 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 */
 } /* if */
 } /* if */
 return (local_rc);
} /* build_and_insert_txtbody_object */










