COMPILATION LISTING OF SEGMENT register_mdir Compiled by: Multics PL/I Compiler, Release 27d, of October 11, 1982 Compiled at: Honeywell LISD Phoenix, System M Compiled on: 11/15/82 1733.4 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 /* REGISTER_MDIR: Command that will register an existing master directory in ring 1 */ 12 13 /* Written April 1976 by Larry Johnson */ 14 15 register_mdir: proc; 16 17 dcl code fixed bin (35); 18 dcl name char (13) int static options (constant) init ("register_mdir"); 19 dcl nargs fixed bin; 20 dcl arg_ptr ptr; 21 dcl arg_len fixed bin; 22 dcl arg char (arg_len) based (arg_ptr); 23 dcl path_ptr ptr; 24 dcl path_len fixed bin init (0); 25 dcl path char (path_len) based (path_ptr); 26 dcl all_sw bit (1) init ("0"b); 27 dcl bf_sw bit (1) init ("0"b); 28 dcl dir char (168); 29 dcl ename char (32); 30 dcl i fixed bin; 31 dcl (reg_count, check_count) fixed bin init (0); 32 33 dcl ioa_ entry options (variable); 34 dcl com_err_ entry options (variable); 35 dcl cu_$arg_count entry (fixed bin); 36 dcl cu_$arg_ptr entry (fixed bin, ptr, fixed bin, fixed bin (35)); 37 dcl mdc_priv_$register_mdir entry (char (*), char (*), fixed bin (35)); 38 dcl expand_path_ entry (ptr, fixed bin, ptr, ptr, fixed bin (35)); 39 dcl sweep_disk_ entry (char (168) aligned, entry); 40 41 dcl error_table_$badopt ext fixed bin (35); 42 dcl error_table_$mdc_not_mdir ext fixed bin (35); 43 dcl error_table_$request_not_recognized ext fixed bin (35); 44 dcl error_table_$noarg ext fixed bin (35); 45 dcl error_table_$namedup ext fixed bin (35); 46 47 dcl (substr, addr, length, verify, reverse, null) builtin; 48 49 50 /* Scan arguments */ 51 52 call cu_$arg_count (nargs); 53 if nargs = 0 then do; 54 call ioa_ ("Usage: ^a path -control_args-", name); 55 return; 56 end; 57 58 do i = 1 to nargs; 59 call cu_$arg_ptr (i, arg_ptr, arg_len, code); 60 if code ^= 0 then do; 61 err: call com_err_ (code, name); 62 return; 63 end; 64 if substr (arg, 1, 1) = "-" then do; 65 if arg = "-all" then all_sw = "1"b; 66 else if arg = "-brief" | arg = "-bf" then bf_sw = "1"b; 67 else do; 68 code = error_table_$badopt; 69 arg_err: call com_err_ (code, name, "^a", arg); 70 return; 71 end; 72 end; 73 else if path_len = 0 then do; /* No path yet */ 74 path_ptr = arg_ptr; 75 path_len = arg_len; 76 end; 77 else do; 78 code = error_table_$request_not_recognized; 79 go to arg_err; 80 end; 81 end; 82 83 84 /* Handel the case of a single directory to register */ 85 86 if ^all_sw then do; 87 if path_len = 0 then do; 88 code = error_table_$noarg; 89 go to err; 90 end; 91 call expand_path_ (path_ptr, path_len, addr (dir), addr (ename), code); 92 if code ^= 0 then do; 93 path_err: call com_err_ (code, name, "^a", path); 94 return; 95 end; 96 97 call mdc_priv_$register_mdir (dir, ename, code); 98 if code ^= 0 then call com_err_ (code, name, "^a>^a", dir, ename); 99 return; 100 end; 101 102 103 /* If -all given, must scan a tree. Let sweep_disk_ do the work */ 104 105 if path_len = 0 then do; /* No path given, assume root */ 106 dir = ">"; 107 ename = ""; 108 call register; /* Be sure root gets registered */ 109 end; 110 else do; 111 call expand_path_ (path_ptr, path_len, addr (dir), addr (ename), code); 112 if code ^= 0 then go to path_err; 113 call register; 114 call expand_path_ (path_ptr, path_len, addr (dir), null, code); 115 if code ^= 0 then go to path_err; 116 end; 117 118 call sweep_disk_ ((dir), check_mdir); /* Scan the hierarchy */ 119 call ioa_ ("^a: ^d directories checked, ^d registered.", name, check_count, reg_count); 120 return; 121 122 123 /* This procedure is called by sweep_disk_ each time it finds something */ 124 125 check_mdir: proc (sdn, sen, lvl, een, bptr, nptr); 126 127 dcl sdn char (168) aligned; /* Superior directory */ 128 dcl sen char (32) aligned; /* Containing directory */ 129 dcl lvl fixed bin; 130 dcl een char (32) aligned; /* Name of thing found */ 131 dcl (bptr, nptr) ptr; 132 133 dcl 1 branch based (bptr) aligned, /* Structure passed by sweep_disk_ */ 134 2 type bit (2) unal, 135 2 nname bit (16) unal, 136 2 nindex bit (18) unal, 137 2 dtm bit (36) unal, 138 2 dtu bit (36) unal, 139 2 mode bit (5) unal, 140 2 pad bit (13) unal, 141 2 records bit (18) unal; 142 143 if branch.type ^= "10"b then return; /* Only check directorys */ 144 145 dir = sdn; 146 if sen ^= "" then do; /* Build directory name */ 147 i = verify (reverse (dir), " "); 148 i = length (dir)-i+2; 149 if dir ^= ">" then substr (dir, i, 1) = ">"; 150 else i = i-1; 151 substr (dir, i+1) = sen; 152 end; 153 ename = een; 154 call register; 155 return; 156 157 end check_mdir; 158 159 160 register: proc; 161 162 check_count = check_count + 1; 163 call mdc_priv_$register_mdir (dir, ename, code); 164 if code = 0 then do; 165 reg_count = reg_count + 1; 166 if ^bf_sw then call ioa_ ("Registered ^a^v(>^)^a", dir, bin (dir ^= ">", 1), ename); 167 end; 168 else if code = error_table_$mdc_not_mdir then return; 169 else if code ^= error_table_$namedup then call com_err_ (code, name, "^a>^a", dir, ename); 170 return; 171 172 end register; 173 174 175 end register_mdir; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/15/82 1519.0 register_mdir.pl1 >dumps>old>recomp>register_mdir.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. addr builtin function dcl 47 ref 91 91 91 91 111 111 111 111 114 114 all_sw 000111 automatic bit(1) initial unaligned dcl 26 set ref 26* 65* 86 arg based char unaligned dcl 22 set ref 64 65 66 66 69* arg_len 000104 automatic fixed bin(17,0) dcl 21 set ref 59* 64 65 66 66 69 69 75 arg_ptr 000102 automatic pointer dcl 20 set ref 59* 64 65 66 66 69 74 bf_sw 000112 automatic bit(1) initial unaligned dcl 27 set ref 27* 66* 166 bptr parameter pointer dcl 131 ref 125 143 branch based structure level 1 dcl 133 check_count 000177 automatic fixed bin(17,0) initial dcl 31 set ref 31* 119* 162* 162 code 000100 automatic fixed bin(35,0) dcl 17 set ref 59* 60 61* 68* 69* 78* 88* 91* 92 93* 97* 98 98* 111* 112 114* 115 163* 164 168 169 169* com_err_ 000012 constant entry external dcl 34 ref 61 69 93 98 169 cu_$arg_count 000014 constant entry external dcl 35 ref 52 cu_$arg_ptr 000016 constant entry external dcl 36 ref 59 dir 000113 automatic char(168) unaligned dcl 28 set ref 91 91 97* 98* 106* 111 111 114 114 118 145* 147 148 149 149* 151* 163* 166* 166 166 169* een parameter char(32) dcl 130 ref 125 153 ename 000165 automatic char(32) unaligned dcl 29 set ref 91 91 97* 98* 107* 111 111 153* 163* 166* 169* error_table_$badopt 000026 external static fixed bin(35,0) dcl 41 ref 68 error_table_$mdc_not_mdir 000030 external static fixed bin(35,0) dcl 42 ref 168 error_table_$namedup 000036 external static fixed bin(35,0) dcl 45 ref 169 error_table_$noarg 000034 external static fixed bin(35,0) dcl 44 ref 88 error_table_$request_not_recognized 000032 external static fixed bin(35,0) dcl 43 ref 78 expand_path_ 000022 constant entry external dcl 38 ref 91 111 114 i 000175 automatic fixed bin(17,0) dcl 30 set ref 58* 59* 147* 148* 148 149 150* 150 151 ioa_ 000010 constant entry external dcl 33 ref 54 119 166 length builtin function dcl 47 ref 148 lvl parameter fixed bin(17,0) dcl 129 ref 125 mdc_priv_$register_mdir 000020 constant entry external dcl 37 ref 97 163 name 000000 constant char(13) initial unaligned dcl 18 set ref 54* 61* 69* 93* 98* 119* 169* nargs 000101 automatic fixed bin(17,0) dcl 19 set ref 52* 53 58 nptr parameter pointer dcl 131 ref 125 null builtin function dcl 47 ref 114 114 path based char unaligned dcl 25 set ref 93* path_len 000110 automatic fixed bin(17,0) initial dcl 24 set ref 24* 73 75* 87 91* 93 93 105 111* 114* path_ptr 000106 automatic pointer dcl 23 set ref 74* 91* 93 111* 114* reg_count 000176 automatic fixed bin(17,0) initial dcl 31 set ref 31* 119* 165* 165 reverse builtin function dcl 47 ref 147 sdn parameter char(168) dcl 127 ref 125 145 sen parameter char(32) dcl 128 ref 125 146 151 substr builtin function dcl 47 set ref 64 149* 151* sweep_disk_ 000024 constant entry external dcl 39 ref 118 type based bit(2) level 2 packed unaligned dcl 133 ref 143 verify builtin function dcl 47 ref 147 NAMES DECLARED BY EXPLICIT CONTEXT. arg_err 000227 constant label dcl 69 ref 79 check_mdir 000611 constant entry internal dcl 125 ref 118 118 err 000156 constant label dcl 61 ref 89 path_err 000334 constant label dcl 93 ref 112 115 register 000707 constant entry internal dcl 160 ref 108 113 154 register_mdir 000066 constant entry external dcl 15 NAME DECLARED BY CONTEXT OR IMPLICATION. bin builtin function ref 166 166 STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 1226 1266 1050 1236 Length 1460 1050 40 155 156 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME register_mdir 240 external procedure is an external procedure. check_mdir 64 internal procedure is assigned to an entry variable. register 122 internal procedure is called by several nonquick procedures. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME register_mdir 000100 code register_mdir 000101 nargs register_mdir 000102 arg_ptr register_mdir 000104 arg_len register_mdir 000106 path_ptr register_mdir 000110 path_len register_mdir 000111 all_sw register_mdir 000112 bf_sw register_mdir 000113 dir register_mdir 000165 ename register_mdir 000175 i register_mdir 000176 reg_count register_mdir 000177 check_count register_mdir THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. r_ne_as call_ext_out_desc call_ext_out call_int_this call_int_other return ext_entry int_entry THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. com_err_ cu_$arg_count cu_$arg_ptr expand_path_ ioa_ mdc_priv_$register_mdir sweep_disk_ THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. error_table_$badopt error_table_$mdc_not_mdir error_table_$namedup error_table_$noarg error_table_$request_not_recognized LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 15 000065 24 000073 26 000074 27 000075 31 000076 52 000100 53 000106 54 000110 55 000130 58 000131 59 000137 60 000154 61 000156 62 000173 64 000174 65 000201 66 000211 68 000224 69 000227 70 000261 72 000262 73 000263 74 000265 75 000266 76 000270 78 000271 79 000274 81 000275 86 000277 87 000301 88 000303 89 000306 91 000307 92 000332 93 000334 94 000366 97 000367 98 000410 99 000445 105 000446 106 000450 107 000453 108 000456 109 000462 111 000463 112 000506 113 000510 114 000514 115 000537 118 000541 119 000560 120 000607 125 000610 143 000616 145 000624 146 000631 147 000636 148 000650 149 000654 150 000664 151 000666 153 000674 154 000700 155 000705 160 000706 162 000714 163 000716 164 000736 165 000741 166 000742 167 001005 168 001006 169 001011 170 001045 ----------------------------------------------------------- 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