OSI/AS Programming Manual
Example 2: Presentation Layer and ACSE
Sample Programs
E–84 056783 Tandem Computers Incorporated
status = APS_EVENT_RECEIVE_( cepi
, timelimit
, tag
);
wait_for_aps_completion( error_event_proc );
if ( status != ZAPS_VAL_STATUS_EVENT )
display_aps_status( error_event_proc );
/* */
/* Find out which event was received. */
/* */
error = APS_STATUS_( cepi
, &event_code
, (int *) &device_name
, &error_code
, &error_subcode
, &service_id
, (int *) &diagnostic_buffer
, (int *) &original_error_info
);
if ( error != ZAPS_ERR_OK )
display_aps_error( error_status_proc );
/* */
/* Check for the expected event. */
/* A real application would take appropriate action. */
/* */
if ( event_code != expected_event_code )
DEBUG();
} /* proc wait_for_event */
#pragma PAGE
/*--------------------------------------------------------*/
/* */
/* initialize APS. */
/* */
/*--------------------------------------------------------*/
void initialize_appl ()
{
/* */
/* Ask APS to allocate and initialize a reserved */
/* extended segment for this process. */
/* */
error = APS_INITIALIZE_( (int *) &swapvol );
if ( error != ZAPS_ERR_OK )
display_aps_error( error_initialize_proc );
} /* proc initialize_appl */
#pragma PAGE
/*--------------------------------------------------------*/
/* */
/* Main procedure for Example 2, Application 2. */