OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide
C Program Example
OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide—424822-001
B-20
/* */
/* Description: This function creates the mh_c_or_name */
/* 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 mh_c_message_rd object. */
/* */
/* NOTE: This function is called twice: once for each */
/* of the multivalued attributes */
/* (mh-c-message-rd). */
/**************************************************************************/
unsigned short build_and_insert_rdorname_object
( unsigned long root_id, /* Object id from the root object */
unsigned long object_id, /* Object id from the layer above */
unsigned short flag ) /* Flag for the second */
/* multivalued attribute */
{
unsigned short
local_rc; /* Return code from the function */
/* call */
unsigned long
descriptor_count = 6, /* Count of the elements */
local_object; /* Local object identifier */
OM_descriptor
descriptor_list[] =
{
MH_T_ADMD_NAME, OM_S_PRINTABLE_STRING,{ 11 , "POSTMASTER1" },
MH_T_COUNTRY_NAME, OM_S_PRINTABLE_STRING,{ 2 , "US" },
MH_T_PRMD_NAME, OM_S_PRINTABLE_STRING,{ 11 , "DEVELOPMENT" },
MH_T_ORGANIZATION_NAME, OM_S_PRINTABLE_STRING,{ 4 , "MTA1" },
MH_T_ORGANIZATIONAL_UNIT_NME_1,OM_S_PRINTABLE_STRING,{ 7 , "GWUSERS" },
MH_T_SURNAME, OM_S_PRINTABLE_STRING,{ 6 , "UAGW11" }
};
/* Change value for second recipient descriptor */
if ( flag == SECOND )
descriptor_list[5].value.z_string.elements = "UAGW12";
printf (" Create the object \n");
local_rc = GPI_OM_CREATE_ ( MH_C_OR_NAME,
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 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 )