COMPILATION LISTING OF SEGMENT copy_names_ Compiled by: Multics PL/I Compiler, Release 28d, of October 4, 1983 Compiled at: Honeywell LCPD Phoenix, System M Compiled on: 10/25/83 1540.2 mst Tue Options: optimize map 1 /* ************************************************************** 2* * * 3* * Copyright, (C) Massachusetts Institute of Technology, 1983 * 4* * * 5* * Copyright, (C) Honeywell Information Systems Inc., 1983 * 6* * * 7* ************************************************************** */ 8 9 10 11 12 /* format: style2,idind30,indcomtxt */ 13 14 copy_names_: 15 proc (dir1, en1, dir2, en2, entry_name, errsw, code); 16 17 18 /* Procedure to copy (copy_names_) or move (move_names_) the names from one segment to another. */ 19 /* Copy_names_ copies all the names on a segment, move_names_ ignores the first name */ 20 /* Coded by John Strayhorn 7/1/70 */ 21 /* modified by E. Stone 12/71 - to allow nd_handler_ to be called from the user ring only */ 22 /* last modified by J. Klensin 8/73 - to permit handling more than 60 names */ 23 /* Bug fixed 1/22/76 by Steve Herbst */ 24 /* changed to call object_type_ Jay Pattin 2/17/83 */ 25 /* 830924 object_type_ -> fs_util_ BIM */ 26 27 dcl (count, i) fixed bin (17); 28 dcl code fixed bin (35); 29 dcl (dir1, dir2) char (*); /* directories */ 30 dcl (en1, en2, entry_name) char (*); /* entry names */ 31 dcl name char (32); /* temporary name to save based references */ 32 dcl (areap, eptr) ptr; 33 dcl np ptr init (null); 34 dcl 1 branch aligned, /* structure for status */ 35 2 type bit (2) unal, 36 2 nnames bit (16) unal, 37 2 nrp bit (18) unal, 38 2 pad bit (108) unal; 39 40 dcl area area based (areap); 41 42 dcl cleanup condition; 43 44 dcl names (0:119) char (32) based (np); 45 dcl hcs_$status_ entry (char (*), char (*), fixed bin, ptr, ptr, fixed bin (35)); 46 dcl fs_util_$chname_file entry (char (*), char (*), char (*), char (*), fixed bin (35)); 47 dcl nd_handler_ entry (char (*), char (*), char (*), fixed bin (35)); 48 dcl get_system_free_area_ entry () returns (ptr); 49 50 dcl (addr, bin, empty, null, ptr) builtin; 51 dcl (get_ring_, get_initial_ring_) 52 returns (fixed bin); 53 dcl error_table_$namedup external fixed bin (35); 54 dcl error_table_$segnamedup external fixed bin (35); 55 dcl (mvsw, errsw, nd_flag, sd_flag, user_ring) 56 bit (1) aligned; 57 58 59 mvsw = "0"b; 60 go to start; 61 62 63 /* This entry deletes the names before adding them to the target segment. */ 64 65 move_names_: 66 entry (dir1, en1, dir2, en2, entry_name, errsw, code); 67 mvsw = "1"b; 68 69 /* Default assumption is that error occurred while referencing first segment. */ 70 71 start: 72 errsw, nd_flag, sd_flag = "0"b; 73 74 /* set switch to indicate whether called from user ring (OK to query) */ 75 user_ring = (get_ring_ () >= get_initial_ring_ ()); 76 77 78 /* initialize pointers and area (for status) */ 79 80 81 areap = get_system_free_area_ (); 82 83 eptr = addr (branch); 84 85 on condition (cleanup) call clean_up; 86 87 /* call status to get names (get link names if a link). */ 88 89 90 call hcs_$status_ (dir1, en1, 0, eptr, areap, code); 91 if code ^= 0 92 then go to out; 93 94 np = ptr (areap, branch.nrp); 95 count = bin (branch.nnames, 17); 96 97 /* move the names: same order, deleting first for move */ 98 99 do i = 0 to count - 1; 100 101 name = np -> names (i); 102 103 if mvsw 104 then do; 105 if name = en1 106 then go to nex_nam; /* leave the name given as argument */ 107 call fs_util_$chname_file (dir1, en1, name, "", code); 108 if code ^= 0 109 then go to out; 110 end; 111 112 113 next_try: 114 call fs_util_$chname_file (dir2, en2, "", name, code); 115 if code ^= 0 116 then do; 117 if code = error_table_$namedup 118 then do; /* name already in directory */ 119 if user_ring 120 then do; /* query user to correct namedup */ 121 call nd_handler_ (entry_name, dir2, name, code); 122 if code = 0 123 then go to next_try; 124 end; 125 nd_flag, errsw = "1"b; 126 go to nex_nam; 127 end; 128 129 else if code = error_table_$segnamedup 130 then do; /* name already on segment */ 131 sd_flag = "1"b; 132 go to nex_nam; 133 end; 134 135 else do; 136 if mvsw 137 then call fs_util_$chname_file (dir1, en1, "", name, code); 138 errsw = "1"b; 139 call clean_up; 140 return; 141 end; 142 end; 143 nex_nam: 144 end; 145 146 out: 147 if nd_flag 148 then code = error_table_$namedup; 149 else if sd_flag 150 then code = error_table_$segnamedup; 151 152 call clean_up; 153 154 clean_up: 155 proc (); /* procedure to free any space in system area */ 156 157 if np ^= null 158 then free names in (area); 159 160 end clean_up; 161 162 end copy_names_; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 10/25/83 1444.6 copy_names_.pl1 >spec>on>eod-fix>copy_names_.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 50 ref 83 area based area(1024) dcl 40 ref 157 areap 000112 automatic pointer dcl 32 set ref 81* 90* 94 157 bin builtin function dcl 50 ref 95 branch 000120 automatic structure level 1 dcl 34 set ref 83 cleanup 000124 stack reference condition dcl 42 ref 85 code parameter fixed bin(35,0) dcl 28 set ref 14 65 90* 91 107* 108 113* 115 117 121* 122 129 136* 146* 149* count 000100 automatic fixed bin(17,0) dcl 27 set ref 95* 99 dir1 parameter char unaligned dcl 29 set ref 14 65 90* 107* 136* dir2 parameter char unaligned dcl 29 set ref 14 65 113* 121* en1 parameter char unaligned dcl 30 set ref 14 65 90* 105 107* 136* en2 parameter char unaligned dcl 30 set ref 14 65 113* entry_name parameter char unaligned dcl 30 set ref 14 65 121* eptr 000114 automatic pointer dcl 32 set ref 83* 90* error_table_$namedup 000024 external static fixed bin(35,0) dcl 53 ref 117 146 error_table_$segnamedup 000026 external static fixed bin(35,0) dcl 54 ref 129 149 errsw parameter bit(1) dcl 55 set ref 14 65 71* 125* 138* fs_util_$chname_file 000012 constant entry external dcl 46 ref 107 113 136 get_initial_ring_ 000022 constant entry external dcl 51 ref 75 get_ring_ 000020 constant entry external dcl 51 ref 75 get_system_free_area_ 000016 constant entry external dcl 48 ref 81 hcs_$status_ 000010 constant entry external dcl 45 ref 90 i 000101 automatic fixed bin(17,0) dcl 27 set ref 99* 101* mvsw 000132 automatic bit(1) dcl 55 set ref 59* 67* 103 136 name 000102 automatic char(32) unaligned dcl 31 set ref 101* 105 107* 113* 121* 136* names based char(32) array unaligned dcl 44 ref 101 157 nd_flag 000133 automatic bit(1) dcl 55 set ref 71* 125* 146 nd_handler_ 000014 constant entry external dcl 47 ref 121 nnames 0(02) 000120 automatic bit(16) level 2 packed unaligned dcl 34 set ref 95 np 000116 automatic pointer initial dcl 33 set ref 33* 94* 101 157 157 nrp 0(18) 000120 automatic bit(18) level 2 packed unaligned dcl 34 set ref 94 null builtin function dcl 50 ref 33 157 ptr builtin function dcl 50 ref 94 sd_flag 000134 automatic bit(1) dcl 55 set ref 71* 131* 149 user_ring 000135 automatic bit(1) dcl 55 set ref 75* 119 NAME DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. empty builtin function dcl 50 NAMES DECLARED BY EXPLICIT CONTEXT. clean_up 000546 constant entry internal dcl 154 ref 85 139 152 copy_names_ 000027 constant entry external dcl 14 move_names_ 000073 constant entry external dcl 65 nex_nam 000521 constant label dcl 143 ref 105 126 132 next_try 000352 constant label dcl 113 ref 122 out 000523 constant label dcl 146 ref 91 108 start 000135 constant label dcl 71 set ref 60 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 726 756 563 736 Length 1142 563 30 147 142 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME copy_names_ 134 external procedure is an external procedure. on unit on line 85 64 on unit clean_up 64 internal procedure is called by several nonquick procedures. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME copy_names_ 000100 count copy_names_ 000101 i copy_names_ 000102 name copy_names_ 000112 areap copy_names_ 000114 eptr copy_names_ 000116 np copy_names_ 000120 branch copy_names_ 000132 mvsw copy_names_ 000133 nd_flag copy_names_ 000134 sd_flag copy_names_ 000135 user_ring copy_names_ THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. r_ge_a call_ext_out_desc call_ext_out call_int_this call_int_other return enable ext_entry_desc int_entry free_based THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. fs_util_$chname_file get_initial_ring_ get_ring_ get_system_free_area_ hcs_$status_ nd_handler_ THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. error_table_$namedup error_table_$segnamedup LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 33 000015 14 000021 59 000067 60 000070 65 000071 67 000133 71 000135 75 000141 81 000163 83 000172 85 000174 90 000216 91 000255 94 000260 95 000265 99 000271 101 000277 103 000304 105 000306 107 000315 108 000347 113 000352 115 000405 117 000410 119 000413 121 000415 122 000442 125 000445 126 000450 129 000451 131 000453 132 000455 136 000456 138 000511 139 000514 140 000520 143 000521 146 000523 149 000532 152 000540 162 000544 154 000545 157 000553 160 000562 ----------------------------------------------------------- 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