OSI/AS Programming Manual

Example 1: Session Layer
Sample Programs
E–10 056783 Tandem Computers Incorporated
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 );
CALL OPEN( startup.output_file_name, output );
outline ':=' "$RECEIVE READ error." -> @outptr;
CALL WRITE( output, outline_w, @outptr '-' @outline );
CALL ABEND;
END;
CALL CLOSE( receive );
--
-- Open the OUT file.
--
CALL OPEN( startup.output_file_name, output );
IF <> THEN
BEGIN
CALL MYTERM( startup.output_file_name );
CALL OPEN( startup.output_file_name,output );
outline ':=' "Output file OPEN error." -> @outptr;
CALL WRITE( output, outline_w, @outptr '-' @outline );
CALL ABEND;
END;
--
-- Ask the API to allocate and initialize a reserved
-- extended segment for this process.
--
error := APS_INITIALIZE_( swapvol );
IF ( error <> ZAPS^ERR^OK ) THEN
CALL display_aps_error( error_initialize_proc );