OSI/AS Programming Manual

Example 2: Presentation Layer and ACSE
Sample Programs
056783 Tandem Computers Incorporated E–39
, original_error_info
);
IF ( error <> ZAPS^ERR^OK ) THEN
CALL display_aps_error( error_status_proc );
--
-- Check for the expected event.
-- A real application would take appropriate action.
--
IF ( event_code <> expected_event_code ) THEN
CALL DEBUG;
END; -- proc wait_for_event
? PAGE
------------------------------------------------------------
--
-- Read the startup message, open the output file, and
-- initialize the API.
--
------------------------------------------------------------
PROC initialize_appl;
BEGIN
INT receive;
INT .receive_name[0:11] :=
[ "$RECEIVE", 8*[" "] ];
STRUCT .startup;
BEGIN
INT msg_code;
INT default_vol[0:7];
INT input_file_name[0:11];
INT output_file_name[0:11];
STRING params[0:131];
END;
--
-- Open $RECEIVE.
--
CALL OPEN( receive_name, receive );
IF <> THEN
BEGIN
CALL MYTERM( startup.output_file_name );
CALL OPEN( startup.output_file_name, output );
outline ':=' "$RECEIVE OPEN error." -> @outptr;
CALL WRITE( output, outline_w, @outptr '-' @outline );
CALL ABEND;
END;
--
-- Read the startup message.
--
CALL READ( receive, startup, $LEN( startup ) );
IF <> THEN
BEGIN
CALL MYTERM( startup.output_file_name );