OSI/AS Programming Manual
Example 2: Presentation Layer and ACSE
Sample Programs
056783 Tandem Computers Incorporated E–83
#pragma PAGE
/*--------------------------------------------------------*/
/* */
/* Wait for APS completion by first checking that the */
/* initial status was ok and then by calling */
/* MFM_AWAITIOX_. */
/* */
/*--------------------------------------------------------*/
void wait_for_aps_completion( error_proc )
int error_proc; /* i : aps proc label */
{
 int filenum;
 if ( status != ZAPS_VAL_STATUS_OK )
 display_aps_status( error_proc );
 else
 {
 /* */
 /* The initial status was OK, so we'll wait here. */
 /* Note that on completion, the tag will be set to */
 /* what it was when we called the corresponding APS */
 /* procedure. This example doesn't take advantage */
 /* of this fact. */
 /* Real applications might set the tag to the */
 /* address of a control block for remapping */
 /* at completion time. */
 /* */
 filenum = -1; /* wait for any completion */
 MFM_AWAITIOX_( &status
 ,&filenum
 , /* buffer-addr */
 , /* count-transferred */
 ,&tag
 , timelimit
 , /* segment-id */
 );
 if ( filenum != cepi )
 DEBUG(); /* shouldn't happen for this example */
 }; /* else... */
} /* proc wait_for_aps_completion */
#pragma PAGE
/*--------------------------------------------------------*/
/* */
/* wait for an event and make certain that it is the one */
/* that is expected. */
/* */
/*--------------------------------------------------------*/
void wait_for_event( expected_event_code )
int expected_event_code; /* i : expected evnt */
{
 tag = error_event_proc;










