COMPILATION LISTING OF SEGMENT file_monitor_ Compiled by: Multics PL/I Compiler, Release 27d, of October 11, 1982 Compiled at: Honeywell LISD Phoenix, System M Compiled on: 11/15/82 1741.0 mst Mon Options: optimize map 1 /* *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Information Systems Inc., 1982 * 4* * * 5* * Copyright (c) 1972 by Massachusetts Institute of * 6* * Technology and Honeywell Information Systems, Inc. * 7* * * 8* *********************************************************** */ 9 10 11 file_monitor_: proc; 12 13 return; /* not a legal entry point */ 14 15 16 /* FILE_MONITOR_ -- handles interface with ANSI tape DIM. Opens and closes files 17* on the tape as required. 18* 0) Created 12/5/74 by Janice B. Phillipps 19* 1) Revised 7/10/75 by J.Phillipps for new IO Daemon. 20* 2) Modified 1/31/78 by J. C. Whitmore for new printer features and prtdim/spooldim merge. 21**/ 22 23 24 25 1 1 /* BEGIN INCLUDE FILE ... spooling_info.incl.pl1 */ 1 2 /* Spooling IO Module control structure. Created 11/4/74 by Janice Phillipps */ 1 3 /* Modified 1/25/78 by J. C. Whitmore during spool driver update */ 1 4 1 5 dcl sip ptr; /* pointer to spooling info structure */ 1 6 1 7 dcl 1 spooling_info based (sip) aligned, /* spooling info structure */ 1 8 2 version fixed bin, /* version of structure */ 1 9 2 pad1 fixed bin, /* space broken for ptr allocation */ 1 10 2 iocbp ptr, /* ptr to io control block used by tape_ansi_ */ 1 11 2 switch_name char (32), /* name of io switch attached to tape_ansi_ */ 1 12 2 nvols fixed bin, /* number of tape volumes requested */ 1 13 2 density char (4), 1 14 2 block_lnth char (4), 1 15 2 volids (3) char (6), /* array of tape volume ids */ 1 16 2 filesetid char (6), /* name of current ansi file set */ 1 17 2 comment char (64), /* comment to operator at mount */ 1 18 2 phys_line_length fixed bin, 1 19 2 phys_page_length fixed bin, 1 20 2 filenumber fixed bin, /* number of current file on tape */ 1 21 2 static_number char (6) aligned, 1 22 2 flgs, 1 23 3 fst_call bit (1) unaligned, /* indicates first time thru attach code */ 1 24 3 lst_call bit (1) unaligned, /* indicates spooling tape will be detached */ 1 25 3 io_sw bit (1) unaligned, /* = "1"b if ring in tape */ 1 26 3 vol_mount bit (1) unaligned, 1 27 3 pad1 bit (32) unaligned, 1 28 2 spooling_limits, 1 29 3 spool_file_limit_sw fixed bin, /* = 1 when reached specified spooling file limit */ 1 30 3 spool_line_limit_sw fixed bin, /* = 1 when reached specifid spooling line limit */ 1 31 3 file_limit fixed bin (35), /* count of files to spool until */ 1 32 3 line_limit fixed bin (35), /* count of lines to spool until */ 1 33 2 spooling_file_count fixed bin (35), /* count of files spooled so far */ 1 34 2 spooling_line_count fixed bin (35); /* count of lines spooled so far */ 1 35 1 36 dcl spooling_info_version_4 fixed bin int static init (4) options (constant); 1 37 1 38 1 39 /* END INCLUDE FILE ... spooling_info.incl.pl1 */ 26 27 28 dcl terminal_sw fixed bin, /* switch set when tape will be taken down */ 29 cnst fixed bin init (1), 30 a_fnbr fixed bin, 31 fnbr fixed bin, 32 tm_sw fixed bin; /* parameter for terminal_sw */ 33 34 dcl command_question condition; 35 dcl attach_description char (256) varying; 36 dcl comment_string char (80) var; /* comment field for the attach description */ 37 38 dcl ctr fixed bin init (1); 39 40 dcl spooling_question_handler_ entry (ptr, fixed bin (35)); 41 dcl ioa_ entry options (variable); 42 dcl iox_$control entry (ptr, char (*), ptr, fixed bin (35)); 43 dcl iox_$attach_ioname entry (char (*), ptr, char (*), fixed bin (35)); 44 dcl iox_$attach_iocb entry (ptr, char (*), fixed bin (35)); 45 dcl iox_$open entry (ptr, fixed bin, bit (1) aligned, fixed bin (35)); 46 dcl iox_$close entry (ptr, fixed bin (35)); 47 dcl iox_$detach_iocb entry (ptr, fixed bin (35)); 48 49 dcl spool_static_$debug fixed bin ext; 50 51 dcl error_table_$dev_nt_assnd fixed bin (35) ext; 52 dcl error_table_$fatal_error fixed bin (35) ext; 53 54 dcl a_sip ptr, 55 number pic "zzzzz9", 56 line_length pic "zzzzz9", 57 vols char (128) aligned varying, 58 a_vols char (*), 59 (i, ii, j, k) fixed bin, /* indicies */ 60 code fixed bin (35), 61 scode fixed bin (35); 62 63 dcl (verify, addr, null, fixed, substr) builtin; 64 65 66 67 attach: entry (a_sip, a_vols, a_fnbr, code); 68 69 sip = a_sip; /* local ptr */ 70 fnbr = a_fnbr; 71 vols = a_vols; 72 code = 0; 73 i, ii, j, k = 0; 74 75 if spooling_info.version ^= spooling_info_version_4 then do; 76 code = error_table_$fatal_error; 77 return; 78 end; 79 80 /* if tape_ansi_ asks for something */ 81 82 on command_question call spooling_question_handler_ (sip, scode); 83 84 if spooling_info.fst_call then do; /* 1st time thru set up vol list */ 85 spooling_info.filenumber = 0; /* initialize */ 86 spooling_info.filesetid = spooling_info.volids (1); /* establish the file set identifier */ 87 spooling_info.fst_call = "0"b; /* reset */ 88 end; 89 90 if spooling_info.filesetid = "" then do; 91 code = error_table_$dev_nt_assnd; 92 return; 93 end; 94 95 if spooling_info.nvols > 1 then do; /* pass tape_ansi_ all mbrs of fileset */ 96 vols = ""; 97 do i = 2 to spooling_info.nvols; 98 vols = vols || " " || spooling_info.volids (i); 99 end; 100 vols = vols || " " || a_vols; 101 end; 102 103 if fnbr > 0 then /* was the file number given? */ 104 spooling_info.filenumber = fnbr; 105 else spooling_info.filenumber = spooling_info.filenumber + 1; /* otherwise use the next file in sequence */ 106 107 number = fixed (spooling_info.filenumber); /* convert file index to character string */ 108 i = verify (number, " "); /* mark first non-blank */ 109 spooling_info.static_number = substr (number, i); 110 111 line_length = fixed (spooling_info.phys_line_length) + 5; /* convert to character string */ 112 j = verify (line_length, " "); /* mark first non-blank */ 113 114 comment_string = ""; /* clear the comment field */ 115 if ^spooling_info.vol_mount then /* when mounting the volume, give comment */ 116 if spooling_info.comment ^= "" then 117 comment_string = " -comment " || rtrim (spooling_info.comment); 118 119 if spooling_info.flgs.io_sw then do; /* setup for write */ 120 attach_description = "tape_ansi_ " || spooling_info.filesetid || " " || vols || comment_string 121 || " -create -name FILE" || substr (number, i) 122 || " -number " || substr (number, i) 123 || " -record " || substr (line_length, j) 124 || " -block "|| spooling_info.block_lnth 125 || " -density " || spooling_info.density 126 || " -format db -retain all -force -mode ascii"; 127 end; 128 else do; /* setup to read the tape */ 129 attach_description = "tape_ansi_ " || spooling_info.filesetid || " " || vols || comment_string 130 || " -number " || substr (number, i) 131 || " -retain all -mode ascii"; 132 end; 133 134 if spool_static_$debug = 1 then 135 call ioa_ ("file_monitor_: attach description is^/^a", attach_description); 136 137 call attach_and_open (scode); /* internal proc to do the attachment */ 138 if scode = 0 then 139 spooling_info.flgs.vol_mount = "1"b; /* volume up now */ 140 code = scode; 141 142 return; 143 144 145 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ 146 detach: entry (a_sip, tm_sw, code); 147 148 sip = a_sip; 149 terminal_sw = tm_sw; /* = 1 if wont count file in file count */ 150 code = 0; 151 scode = 0; 152 153 on command_question call spooling_question_handler_ (sip, scode); 154 155 if terminal_sw = 1 then 156 call iox_$control (spooling_info.iocbp, "retain_none", addr (cnst), code); 157 158 call close_and_detach (scode); 159 if scode = 0 & terminal_sw = 1 then do; 160 spooling_info.flgs.vol_mount = "0"b; /* volume no longer mounted */ 161 spooling_info.filesetid = ""; 162 end; 163 code = scode; 164 165 return; 166 167 168 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ 169 cleanup: entry (a_sip, a_vols, code); 170 171 sip = a_sip; 172 vols = a_vols; 173 scode, code = 0; 174 175 if spooling_info.flgs.vol_mount then do; 176 177 call ioa_ ("^/Taking tape volume down.^/"); 178 179 attach_description = "tape_ansi_ " || spooling_info.filesetid 180 || " -retain none -number 1"; 181 182 if spool_static_$debug = 1 then 183 call ioa_ ("file_monitor_$cleanup: attach desc: ^a", attach_description); 184 185 /* attach/detach sequence here required by ansi dim to take down volume */ 186 187 call attach_and_open (scode); 188 call iox_$control (spooling_info.iocbp, "retain_none", addr (cnst), code); /* in case already attached */ 189 call close_and_detach (scode); /* dont increment file count */ 190 if scode = 0 then do; /* if it was good, mark it as done */ 191 spooling_info.flgs.vol_mount = "0"b; /* volume no longer up */ 192 spooling_info.filesetid = ""; 193 end; 194 end; 195 code = scode; 196 return; 197 198 199 200 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ 201 attach_and_open: proc (rcode); /* internal proc to do attach thru tape dim */ 202 203 dcl rcode fixed bin (35); 204 dcl scode fixed bin (35); 205 dcl open_mode fixed bin; 206 207 if spooling_info.iocbp = null then do; 208 call iox_$attach_ioname ((spooling_info.switch_name), spooling_info.iocbp, (attach_description), rcode); 209 end; 210 else call iox_$attach_iocb (spooling_info.iocbp, (attach_description), rcode); 211 212 if spooling_info.flgs.io_sw then open_mode = 5; /* sequential output not extending */ 213 else open_mode = 4; /* sequential input */ 214 215 call iox_$open (spooling_info.iocbp, open_mode, "0"b, scode); /* open I/O switch */ 216 217 if scode = 0 then rcode = 0; /* if open worked, all is well */ 218 else if rcode = 0 then rcode = scode; /* if attach worked, give open error */ 219 220 return; 221 222 end attach_and_open; 223 224 225 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ 226 close_and_detach: proc (rcode); 227 228 /* close and detach the current io switch */ 229 230 dcl rcode fixed bin (35); 231 232 call iox_$close (spooling_info.iocbp, rcode); 233 call iox_$detach_iocb (spooling_info.iocbp, rcode); 234 235 return; 236 237 end close_and_detach; 238 239 end file_monitor_; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/15/82 1524.0 file_monitor_.pl1 >dumps>old>recomp>file_monitor_.pl1 26 1 02/23/78 1619.8 spooling_info.incl.pl1 >ldd>include>spooling_info.incl.pl1 NAMES DECLARED IN THIS COMPILATION. IDENTIFIER OFFSET LOC STORAGE CLASS DATA TYPE ATTRIBUTES AND REFERENCES (* indicates a set context) NAMES DECLARED BY DECLARE STATEMENT. a_fnbr parameter fixed bin(17,0) dcl 28 ref 67 70 a_sip parameter pointer dcl 54 ref 67 69 146 148 169 171 a_vols parameter char unaligned dcl 54 ref 67 71 100 169 172 addr builtin function dcl 63 ref 155 155 188 188 attach_description 000114 automatic varying char(256) dcl 35 set ref 120* 129* 134* 179* 182* 208 210 block_lnth 16 based char(4) level 2 dcl 1-7 ref 120 cnst 000103 automatic fixed bin(17,0) initial dcl 28 set ref 28* 155 155 188 188 code parameter fixed bin(35,0) dcl 54 set ref 67 72* 76* 91* 140* 146 150* 155* 163* 169 173* 188* 195* command_question 000106 stack reference condition dcl 34 ref 82 153 comment 27 based char(64) level 2 dcl 1-7 ref 115 115 comment_string 000215 automatic varying char(80) dcl 36 set ref 114* 115* 120 129 ctr 000242 automatic fixed bin(17,0) initial dcl 38 set ref 38* density 15 based char(4) level 2 dcl 1-7 ref 120 error_table_$dev_nt_assnd 000032 external static fixed bin(35,0) dcl 51 ref 91 error_table_$fatal_error 000034 external static fixed bin(35,0) dcl 52 ref 76 filenumber 51 based fixed bin(17,0) level 2 dcl 1-7 set ref 85* 103* 105* 105 107 filesetid 25 based char(6) level 2 dcl 1-7 set ref 86* 90 120 129 161* 179 192* fixed builtin function dcl 63 ref 107 111 flgs 54 based structure level 2 dcl 1-7 fnbr 000104 automatic fixed bin(17,0) dcl 28 set ref 70* 103 103 fst_call 54 based bit(1) level 3 packed unaligned dcl 1-7 set ref 84 87* i 000311 automatic fixed bin(17,0) dcl 54 set ref 73* 97* 98* 108* 109 120 120 129 ii 000312 automatic fixed bin(17,0) dcl 54 set ref 73* io_sw 54(02) based bit(1) level 3 packed unaligned dcl 1-7 ref 119 212 ioa_ 000012 constant entry external dcl 41 ref 134 177 182 iocbp 2 based pointer level 2 dcl 1-7 set ref 155* 188* 207 208* 210* 215* 232* 233* iox_$attach_iocb 000020 constant entry external dcl 44 ref 210 iox_$attach_ioname 000016 constant entry external dcl 43 ref 208 iox_$close 000024 constant entry external dcl 46 ref 232 iox_$control 000014 constant entry external dcl 42 ref 155 188 iox_$detach_iocb 000026 constant entry external dcl 47 ref 233 iox_$open 000022 constant entry external dcl 45 ref 215 j 000313 automatic fixed bin(17,0) dcl 54 set ref 73* 112* 120 k 000314 automatic fixed bin(17,0) dcl 54 set ref 73* line_length 000246 automatic picture(6) unaligned dcl 54 set ref 111* 112 120 null builtin function dcl 63 ref 207 number 000244 automatic picture(6) unaligned dcl 54 set ref 107* 108 109 120 120 129 nvols 14 based fixed bin(17,0) level 2 dcl 1-7 ref 95 97 open_mode 000331 automatic fixed bin(17,0) dcl 205 set ref 212* 213* 215* phys_line_length 47 based fixed bin(17,0) level 2 dcl 1-7 ref 111 rcode parameter fixed bin(35,0) dcl 230 in procedure "close_and_detach" set ref 226 232* 233* rcode parameter fixed bin(35,0) dcl 203 in procedure "attach_and_open" set ref 201 208* 210* 217* 218 218* scode 000330 automatic fixed bin(35,0) dcl 204 in procedure "attach_and_open" set ref 215* 217 218 scode 000315 automatic fixed bin(35,0) dcl 54 in procedure "file_monitor_" set ref 82* 137* 138 140 151* 153* 158* 159 163 173* 187* 189* 190 195 sip 000100 automatic pointer dcl 1-5 set ref 69* 75 82* 84 85 86 86 87 90 95 97 98 103 105 105 107 109 111 115 115 115 119 120 120 120 129 138 148* 153* 155 160 161 171* 175 179 188 191 192 207 208 208 210 212 215 232 233 spool_static_$debug 000030 external static fixed bin(17,0) dcl 49 ref 134 182 spooling_info based structure level 1 dcl 1-7 spooling_info_version_4 constant fixed bin(17,0) initial dcl 1-36 ref 75 spooling_question_handler_ 000010 constant entry external dcl 40 ref 82 153 static_number 52 based char(6) level 2 dcl 1-7 set ref 109* substr builtin function dcl 63 ref 109 120 120 120 129 switch_name 4 based char(32) level 2 dcl 1-7 ref 208 terminal_sw 000102 automatic fixed bin(17,0) dcl 28 set ref 149* 155 159 tm_sw parameter fixed bin(17,0) dcl 28 ref 146 149 verify builtin function dcl 63 ref 108 112 version based fixed bin(17,0) level 2 dcl 1-7 ref 75 vol_mount 54(03) based bit(1) level 3 packed unaligned dcl 1-7 set ref 115 138* 160* 175 191* volids 17 based char(6) array level 2 dcl 1-7 ref 86 98 vols 000250 automatic varying char(128) dcl 54 set ref 71* 96* 98* 98 100* 100 120 129 172* NAMES DECLARED BY EXPLICIT CONTEXT. attach 000162 constant entry external dcl 67 attach_and_open 001462 constant entry internal dcl 201 ref 137 187 cleanup 001264 constant entry external dcl 169 close_and_detach 001632 constant entry internal dcl 226 ref 158 189 detach 001133 constant entry external dcl 146 file_monitor_ 000146 constant entry external dcl 11 NAME DECLARED BY CONTEXT OR IMPLICATION. rtrim builtin function ref 115 STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 2074 2132 1673 2104 Length 2346 1673 36 177 201 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME file_monitor_ 306 external procedure is an external procedure. on unit on line 82 70 on unit on unit on line 153 70 on unit attach_and_open internal procedure shares stack frame of external procedure file_monitor_. close_and_detach internal procedure shares stack frame of external procedure file_monitor_. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME file_monitor_ 000100 sip file_monitor_ 000102 terminal_sw file_monitor_ 000103 cnst file_monitor_ 000104 fnbr file_monitor_ 000114 attach_description file_monitor_ 000215 comment_string file_monitor_ 000242 ctr file_monitor_ 000244 number file_monitor_ 000246 line_length file_monitor_ 000250 vols file_monitor_ 000311 i file_monitor_ 000312 ii file_monitor_ 000313 j file_monitor_ 000314 k file_monitor_ 000315 scode file_monitor_ 000330 scode attach_and_open 000331 open_mode attach_and_open THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. alloc_cs cat_realloc_cs call_ext_out_desc call_ext_out return enable shorten_stack ext_entry ext_entry_desc int_entry THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. ioa_ iox_$attach_iocb iox_$attach_ioname iox_$close iox_$control iox_$detach_iocb iox_$open spooling_question_handler_ THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. error_table_$dev_nt_assnd error_table_$fatal_error spool_static_$debug LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 28 000140 38 000142 11 000145 13 000154 67 000155 69 000201 70 000205 71 000207 72 000220 73 000221 75 000225 76 000230 77 000233 82 000234 84 000262 85 000266 86 000267 87 000273 90 000275 91 000304 92 000307 95 000310 96 000313 97 000314 98 000322 99 000362 100 000365 101 000423 103 000424 105 000431 107 000433 108 000443 109 000455 111 000466 112 000502 114 000514 115 000515 119 000556 120 000562 127 000771 129 000773 132 001072 134 001073 137 001116 138 001120 140 001125 142 001126 146 001127 148 001144 149 001150 150 001152 151 001153 153 001154 155 001202 158 001240 159 001242 160 001247 161 001252 163 001255 165 001257 169 001260 171 001303 172 001307 173 001320 175 001322 177 001325 179 001341 182 001364 187 001410 188 001412 189 001445 190 001447 191 001451 192 001454 195 001457 196 001461 201 001462 207 001464 208 001471 209 001532 210 001534 212 001566 213 001576 215 001600 217 001617 218 001624 220 001631 226 001632 232 001634 233 001647 235 001662 ----------------------------------------------------------- Historical Background This edition of the Multics software materials and documentation is provided and donated to Massachusetts Institute of Technology by Group BULL including BULL HN Information Systems Inc. as a contribution to computer science knowledge. This donation is made also to give evidence of the common contributions of Massachusetts Institute of Technology, Bell Laboratories, General Electric, Honeywell Information Systems Inc., Honeywell BULL Inc., Groupe BULL and BULL HN Information Systems Inc. to the development of this operating system. Multics development was initiated by Massachusetts Institute of Technology Project MAC (1963-1970), renamed the MIT Laboratory for Computer Science and Artificial Intelligence in the mid 1970s, under the leadership of Professor Fernando Jose Corbato. Users consider that Multics provided the best software architecture for managing computer hardware properly and for executing programs. Many subsequent operating systems incorporated Multics principles. Multics was distributed in 1975 to 2000 by Group Bull in Europe , and in the U.S. by Bull HN Information Systems Inc., as successor in interest by change in name only to Honeywell Bull Inc. and Honeywell Information Systems Inc. . ----------------------------------------------------------- Permission to use, copy, modify, and distribute these programs and their documentation for any purpose and without fee is hereby granted,provided that the below copyright notice and historical background appear in all copies and that both the copyright notice and historical background and this permission notice appear in supporting documentation, and that the names of MIT, HIS, BULL or BULL HN not be used in advertising or publicity pertaining to distribution of the programs without specific prior written permission. Copyright 1972 by Massachusetts Institute of Technology and Honeywell Information Systems Inc. Copyright 2006 by BULL HN Information Systems Inc. Copyright 2006 by Bull SAS All Rights Reserved