OSI/MHS P7 Application Programmatic Interface (P7 API) Manual

C Language Example Program
OSI/MHS P7 Application Programmatic Interface (P7 API) Manual424825-001
E-5
scanf ("%d", &choice);
printf (" \n");
/* execute the selection */
switch (choice)
{
case 0 : /* send MSBIND */
sendData (buffer, connection, ZMHS_VAL_DT_MS_BIND_ARG);
awaitCompletion(); /* see if the send worked */
break;
case 1 : /* await completion */
awaitCompletion(); /* check for responses to our requests */
break;
case 2 : /* send P7 data */
/* Note: This choice was not tested with valid ASN.1
data. In it's present state, the data being sent
will cause the LO connection to be aborted. */
sendData (buffer, connection, ZMHS_VAL_DT_P_DATA);
awaitCompletion(); /* see if the send worked */
break;
case 3 : /* send MSUNBIND */
sendData (buffer, connection, ZMHS_VAL_DT_MS_UNBIND_ARG);
awaitCompletion(); /* see if the send worked */
break;
case EXIT_PROGRAM :
printf (
"\n P7 API Programming example terminating by user
request.\n");
/* any cleanup operations should be done here*/
break;
default : /* invalid menu choice */
printf("Invalid menu choice, try again.\n");
} /* end switch */
} /* while */
} /* end main */
#pragma page
/***************************************************************************/
/* Function name: awaitCompletion */
/* */
/* Arguments: none */
/* */
/* Description: This function calls AWAITIOX to see if any of the open */
/* files has had a completion. If so, it will call the */
/* appropriate completion function. */
/***************************************************************************/
void
awaitCompletion ()
{
long int timeLimit; /* Timeout for AWAITIOX */
long int tag; /* Used in AWAITIOX call */
short int error; /* Used in AWAITIOX call */
short int status; /* Used in AWAITIOX call */