TAL Programmer's Guide
Modular Programming Example
Sample Programs
096254 Tandem Computers Incorporated A–17
Output File Module
Example A-6d shows the source code for the output file module. This module declares
a private global data block, which is accessible only to procedures in this module.
Some code that is parallel to code in the input file handler is not listed.
Example A-6d. D-Series Output File Module (Page 1 of 3)
!File name OUTS
NAME out_file_handler;
?PUSHLIST, NOLIST, SOURCE recdefs !BLOCK RECORD_DEFS
?POPLIST
?PUSHLIST, NOLIST, SOURCE inits (default) !BLOCK DEFAULT_VOL
?POPLIST
?PUSHLIST, NOLIST, SOURCE msgs (msglit) !BLOCK MSG_LITERALS
?POPLIST
BLOCK PRIVATE;
INT out_file;
END BLOCK;
!Following are external procedure declarations
?PUSHLIST, NOLIST, SOURCE $SYSTEM.SYSTEM.EXTDECS (
? FILE_CLOSE_, FILE_GETINFO_)
?POPLIST
?PUSHLIST, NOLIST, SOURCE $SYSTEM.SYSTEM.EXTDECS (
? FILE_OPEN_, FILENAME_RESOLVE_)
?POPLIST
?PUSHLIST, NOLIST, SOURCE $SYSTEM.SYSTEM.EXTDECS (
? PROCESS_STOP_, WRITEX)
?POPLIST
?PUSHLIST, NOLIST, SOURCE msgp
?POPLIST
?SECTION out_file_init
PROC out_file_init;
BEGIN
INT out_file_name_len := 7;
STRING .out_file_name[0:file_name_max_len - 1]
:= [ "OUTFILE" ];
INT status;
status := FILENAME_RESOLVE_
(out_file_name:out_file_name_len,
out_file_name:file_name_max_len,
out_file_name_len,
!options!,
!override_name:override_name_len!,
!search:search_len!,
def_vol_subvol:def_vol_subvol_len);