OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide
C Program Example
OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide—424822-001
B-40
 unsigned long
 environment_object, /* Object identifier of an object that */
 /* represents the local environment */
 outbound_object, /* Object identifier */
 available, /* Indicates the availability of an */
 /* unreserved message */
 inbound_object; /* Object identifier */
 char
 gateway_name[] = "Gateway ",
 gateway_instance_name[] = "Instance ",
 mhs_mgr_name[] = "$ZT1",
 gateway_password[] = "GATEWAY",
 local_identifier[32]; /* Local identifier string that uniquely */
 /* identifies the transferred out object */
 printf (" *******************************\n");
 printf (" * Program example is starting *\n");
 printf (" *******************************\n\n");
 /* Initialize the GPI system */
 printf (" Call GPI_INITIALIZE_");
 rc = GPI_INITIALIZE_ ();
 if (( rc == OM_RC_SUCCESS ) || ( rc == ZGPI_RC_WARNING ))
 {
 printf (" --> was successful! \n");
 if ( rc == ZGPI_RC_WARNING )
 {
 printf ("\n *********** WARNING! **********\n");
 show_gpi_status (ZGPI_ANY);
 }
 /* Open a session */
 printf (" Call GPI_OPEN_");
 mhs_mgr_name_len = (unsigned short) strlen (mhs_mgr_name);
 gateway_password_len = (unsigned short) strlen (gateway_password);
 rc = GPI_OPEN_ ( gateway_name,
 gateway_instance_name,
 &session,
 &environment_object,
 mhs_mgr_name,
 mhs_mgr_name_len,
 gateway_password,
 gateway_password_len);
 if (( rc == OM_RC_SUCCESS ) || ( rc == ZGPI_RC_WARNING ))
 {
 printf (" --> was successful! \n");
 if ( rc == ZGPI_RC_WARNING )
 {
 printf ("\n *********** WARNING! **********\n");
 show_gpi_status (ZGPI_ANY);
 }
 /* Build root object */
 printf (" Call BUILD_ROOT_OBJECT \n");
 rc = build_root_object (session,&outbound_object);
 if (( rc == OM_RC_SUCCESS ) || ( rc == ZGPI_RC_WARNING ))










