OSI/AS Programming Manual
Example 2: Presentation Layer and ACSE
Sample Programs
E–70 056783 Tandem Computers Incorporated
--
-- 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 );
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;