COMPILATION LISTING OF SEGMENT apl_translate_pathname_ Compiled by: Multics PL/I Compiler, Release 28d, of October 4, 1983 Compiled at: Honeywell LCPD Phoenix, System M Compiled on: 11/29/83 1618.6 mst Tue Options: optimize map 1 /* ****************************************************** 2* * * 3* * * 4* * Copyright (c) 1972 by Massachusetts Institute of * 5* * Technology and Honeywell Information Systems, Inc. * 6* * * 7* * * 8* ****************************************************** */ 9 10 /* format: style3 */ 11 apl_translate_pathname_: 12 procedure (a_wsid, a_dname, a_ename, a_fcbp, a_code); 13 14 /* procedure to translate an APL wsid into a Multics pathname and find the entry. 15* Written August 1973 by RSL. 16* Modified 15 Sep 1973 by DAM for user numbers as directory names, special-case "continue" 17* Modified 740201 by PG to change continue to Username.sv.apl, and allow V1 ws names. 18* Modified 740423 by PG to make V1 & V2 names mutually exclusive. 19* Modified 790110 by William York to add file system expansion capability. 20* Modified 800307 by PG to fix 459 (did not strip existing suffixes). 21* Modified 811210 by TO to add 'use_search_paths' entrypoint. 22* */ 23 24 declare a_wsid char (*) parameter, /* (Input) the APL workspace name */ 25 a_dname char (*) parameter, /* (Output) The Multics directory pathname */ 26 a_ename char (*) parameter, /* (Output) The Multics entry name */ 27 a_fcbp pointer parameter, /* (Output) if non-null, points at the msf_manager_ file control block */ 28 a_code fixed bin (35) parameter; /* (Output) 0 means ws exists, /=0 means non-exist or error */ 29 30 /* Code starts here for normal call. */ 31 32 component_file = "0"b; /* ws id, not file system file */ 33 may_use_search_paths = "0"b; /* Ignore APL search paths. */ 34 version_one = "0"b; /* version 2, not 1 */ 35 goto common_code; 36 37 file_system_pathname: /* called by apl_file_system_ */ 38 entry (a_wsid, a_dname, a_ename, a_fcbp, a_code); 39 40 component_file = "1"b; /* file system file, not WS */ 41 may_use_search_paths = "0"b; /* Ignore APL search paths. */ 42 version_one = "0"b; /* version 2 names, not version 1 */ 43 goto common_code; 44 45 allow_version_one: /* called by )V1COPY and )V1PCOPY */ 46 entry (a_wsid, a_dname, a_ename, a_fcbp, a_code); 47 48 component_file = "0"b; 49 may_use_search_paths = "0"b; /* Ignore APL search paths. */ 50 version_one = "1"b; 51 goto common_code; 52 53 54 use_search_paths: /* Called by ')LOAD'. */ 55 entry (a_wsid, a_dname, a_ename, a_fcbp, a_code); 56 57 component_file = "0"b; /* ws id, not file system file */ 58 may_use_search_paths = "1"b; /* Allow use of APL search paths. */ 59 version_one = "0"b; /* version 2 names, not version 1 */ 60 goto common_code; 61 62 common_code: 63 a_fcbp = null; 64 65 /* check for an APL/360 style wsid; i.e. a number and an optional name (optional for )LIB.) */ 66 67 /* If there is a leading digit, it is a library number. V1 wsid's 68* have no library numbers, so ignore it. */ 69 70 idx = verify (a_wsid, whitespace); /* flush leading blanks and tabs */ 71 72 if ^version_one & index ("0123456789", substr (a_wsid, idx, 1)) ^= 0 73 then do; 74 75 number_from_wsid = cv_dec_check_ (substr (a_wsid, idx), end_of_number); 76 end_of_number = end_of_number + idx - 1; 77 idx = end_of_number; 78 79 start_of_name = idx + verify (substr (a_wsid, idx), whitespace) - 1; 80 81 if start_of_name > end_of_number 82 then do; 83 if component_file 84 then call ioa_$rsnnl (">^a.cf.apl", entry_name_part, (0), substr (a_wsid, start_of_name)); 85 else call ioa_$rsnnl (">^a.sv.apl", entry_name_part, (0), substr (a_wsid, start_of_name)); 86 absolute_path = "0"b; 87 end; 88 else do; /* just a number, return directory pathname for ")LIB" */ 89 entry_name_part = " "; 90 absolute_path = "1"b; 91 a_ename = " "; /* will be changed to ".sv.apl", an illegal name which will be 92* if this is )LIB, which is what we expect */ 93 94 end; 95 96 call user_info_$whoami (user_name, user_project); 97 98 /* the user number may refer either to a public library 99* (in >apl) or a private library belonging to a member 100* of the user's project */ 101 102 if number_from_wsid >= 1000 103 then call ioa_$rsnnl (">udd>^a>apl_directories>^d^a", Multics_wsid, length_Multics_wsid, user_project, 104 number_from_wsid, entry_name_part); 105 else call ioa_$rsnnl (">apl>library_^d^a", Multics_wsid, length_Multics_wsid, number_from_wsid, 106 entry_name_part); 107 108 if absolute_path 109 then call absolute_pathname_ (Multics_wsid, dname, a_code); 110 else call expand_pathname_ (Multics_wsid, dname, ename, a_code); 111 if a_code ^= 0 112 then return; 113 114 if length (a_ename) = 0 115 then do; /* )LIB - return now without going through msf_manager_ cruft */ 116 a_dname = dname; 117 return; 118 end; 119 end; 120 121 else if length (a_ename) = 0 /* ")LIB" - just get directory pathname from argument */ 122 then do; 123 call absolute_pathname_ (a_wsid, dname, a_code); 124 a_dname = dname; 125 return; 126 end; 127 128 /* check for the continue workspace, punting for file system */ 129 130 else do; 131 if version_one 132 then suffix = "apl"; 133 else if component_file 134 then suffix = "cf.apl"; 135 else suffix = "sv.apl"; 136 137 call expand_pathname_$add_suffix (a_wsid, suffix, dname, ename, a_code); 138 if a_code ^= 0 139 then return; 140 141 /* Handle the continue ws */ 142 143 if ename = "continue.sv.apl" 144 then do; 145 call user_info_$whoami (user_name, user_project); 146 call user_info_$homedir (dname); 147 148 ename = rtrim (user_name) || ".sv.apl"; 149 end; 150 else if (version_one & ename = "continue.apl") 151 then do; 152 dname = get_wdir_ (); 153 end; 154 else if may_use_search_paths & search (a_wsid, "<>") = 0 155 then do; 156 157 /* Use search paths if path is relative and we were supposed to try search paths. */ 158 if apl_dir = "" then 159 call hcs_$fs_get_path_name (codeptr (apl_translate_pathname_), apl_dir, (0), (dname), a_code); 160 call search_paths_$find_dir ("apl", null (), ename, apl_dir, dname, a_code); 161 if a_code ^= 0 162 then dname = get_wdir_ (); 163 end; 164 end; 165 166 /* dname and ename have been set up. Now find the entry and 167* see what kind it is */ 168 169 call msf_manager_$open (dname, ename, a_fcbp, a_code); 170 171 if a_code ^= 0 172 then if a_code ^= error_table_$noentry /* this code is OK; msf_manager_$get_ptr will */ 173 then if a_fcbp ^= null /* create the SSF/MSF later. Any other code we */ 174 then do; /* treat as fatal. */ 175 call msf_manager_$close (a_fcbp); 176 a_fcbp = null; 177 end; 178 179 a_dname = dname; 180 a_ename = ename; 181 return; 182 183 /* Entries */ 184 185 dcl ioa_$rsnnl entry options (variable); 186 dcl get_wdir_ entry returns (char (168)); 187 dcl user_info_$whoami entry (char (*), char (*)); 188 dcl user_info_$homedir entry (char (*)); 189 dcl expand_pathname_ entry (char (*), char (*), char (*), fixed bin (35)); 190 dcl hcs_$fs_get_path_name entry (ptr, char (*), fixed bin, char (*), fixed bin (35)); 191 dcl expand_pathname_$add_suffix 192 entry (char (*), char (*), char (*), char (*), fixed bin (35)); 193 dcl absolute_pathname_ entry (char (*), char (*), fixed bin (35)); 194 dcl msf_manager_$open entry (char (*), char (*), pointer, fixed binary (35)); 195 dcl msf_manager_$close entry (pointer); 196 dcl search_paths_$find_dir entry (char (*), ptr, char (*), char (*), char (*), fixed bin (35)); 197 dcl cv_dec_check_ entry (char (*), fixed bin (35)) returns (fixed bin (35)); 198 199 /* Automatic */ 200 201 dcl suffix char (6); 202 dcl user_project char (9); 203 dcl user_name char (24); 204 dcl (component_file, may_use_search_paths, version_one) 205 bit (1) aligned; 206 dcl absolute_path bit (1) aligned; 207 dcl apl_dir char (168) static init (""); 208 dcl number_from_wsid fixed bin (35); 209 dcl idx fixed bin; 210 dcl end_of_number fixed bin (35); 211 dcl start_of_name fixed bin; 212 dcl entry_name_part char (33); /* blank or ">" and the ename (for number-format wsid) */ 213 dcl Multics_wsid char (168); 214 dcl length_Multics_wsid fixed bin; 215 dcl dname char (168); 216 dcl ename char (32); 217 218 /* Builtins */ 219 220 dcl (index, length, null, rtrim, substr, verify) 221 builtin; 222 223 /* External static */ 224 225 dcl error_table_$noentry 226 fixed bin (35) external static; 227 228 /* Internal Static */ 229 230 dcl whitespace char (2) init (" ") internal static; 231 /* space, tab */ 232 233 end apl_translate_pathname_; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/29/83 1347.3 apl_translate_pathname_.pl1 >special_ldd>on>apl.1129>apl_translate_pathname_.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. Multics_wsid 000134 automatic char(168) unaligned dcl 213 set ref 102* 105* 108* 110* a_code parameter fixed bin(35,0) dcl 24 set ref 11 37 45 54 108* 110* 111 123* 137* 138 158* 160* 161 169* 171 171 a_dname parameter char unaligned dcl 24 set ref 11 37 45 54 116* 124* 179* a_ename parameter char unaligned dcl 24 set ref 11 37 45 54 91* 114 121 180* a_fcbp parameter pointer dcl 24 set ref 11 37 45 54 62* 169* 171 175* 176* a_wsid parameter char unaligned dcl 24 set ref 11 37 45 54 70 72 75 75 79 83 83 85 85 123* 137* 154 absolute_path 000116 automatic bit(1) dcl 206 set ref 86* 90* 108 absolute_pathname_ 000100 constant entry external dcl 193 ref 108 123 apl_dir 000010 internal static char(168) initial unaligned dcl 207 set ref 158 158* 160* component_file 000113 automatic bit(1) dcl 204 set ref 32* 40* 48* 57* 83 133 cv_dec_check_ 000110 constant entry external dcl 197 ref 75 dname 000207 automatic char(168) unaligned dcl 215 set ref 108* 110* 116 123* 124 137* 146* 152* 158 160* 161* 169* 179 ename 000261 automatic char(32) unaligned dcl 216 set ref 110* 137* 143 148* 150 160* 169* 180 end_of_number 000121 automatic fixed bin(35,0) dcl 210 set ref 75* 76* 76 77 81 entry_name_part 000123 automatic char(33) unaligned dcl 212 set ref 83* 85* 89* 102* 105* error_table_$noentry 000112 external static fixed bin(35,0) dcl 225 ref 171 expand_pathname_ 000072 constant entry external dcl 189 ref 110 expand_pathname_$add_suffix 000076 constant entry external dcl 191 ref 137 get_wdir_ 000064 constant entry external dcl 186 ref 152 161 hcs_$fs_get_path_name 000074 constant entry external dcl 190 ref 158 idx 000120 automatic fixed bin(17,0) dcl 209 set ref 70* 72 75 75 76 77* 79 79 index builtin function dcl 220 ref 72 ioa_$rsnnl 000062 constant entry external dcl 185 ref 83 85 102 105 length builtin function dcl 220 ref 114 121 length_Multics_wsid 000206 automatic fixed bin(17,0) dcl 214 set ref 102* 105* may_use_search_paths 000114 automatic bit(1) dcl 204 set ref 33* 41* 49* 58* 154 msf_manager_$close 000104 constant entry external dcl 195 ref 175 msf_manager_$open 000102 constant entry external dcl 194 ref 169 null builtin function dcl 220 ref 62 160 160 171 176 number_from_wsid 000117 automatic fixed bin(35,0) dcl 208 set ref 75* 102 102* 105* rtrim builtin function dcl 220 ref 148 search_paths_$find_dir 000106 constant entry external dcl 196 ref 160 start_of_name 000122 automatic fixed bin(17,0) dcl 211 set ref 79* 81 83 83 85 85 substr builtin function dcl 220 ref 72 75 75 79 83 83 85 85 suffix 000100 automatic char(6) unaligned dcl 201 set ref 131* 133* 135* 137* user_info_$homedir 000070 constant entry external dcl 188 ref 146 user_info_$whoami 000066 constant entry external dcl 187 ref 96 145 user_name 000105 automatic char(24) unaligned dcl 203 set ref 96* 145* 148 user_project 000102 automatic char(9) unaligned dcl 202 set ref 96* 102* 145* verify builtin function dcl 220 ref 70 79 version_one 000115 automatic bit(1) dcl 204 set ref 34* 42* 50* 59* 72 131 150 whitespace constant char(2) initial unaligned dcl 230 ref 70 79 NAMES DECLARED BY EXPLICIT CONTEXT. allow_version_one 000164 constant entry external dcl 45 apl_translate_pathname_ 000075 constant entry external dcl 11 ref 158 158 common_code 000252 constant label dcl 62 set ref 35 43 51 60 file_system_pathname 000130 constant entry external dcl 37 use_search_paths 000220 constant entry external dcl 54 NAMES DECLARED BY CONTEXT OR IMPLICATION. codeptr builtin function ref 158 158 search builtin function ref 154 STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 2216 2332 1774 2226 Length 2540 1774 114 172 222 52 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME apl_translate_pathname_ 294 external procedure is an external procedure. STORAGE FOR INTERNAL STATIC VARIABLES. LOC IDENTIFIER BLOCK NAME 000010 apl_dir apl_translate_pathname_ STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME apl_translate_pathname_ 000100 suffix apl_translate_pathname_ 000102 user_project apl_translate_pathname_ 000105 user_name apl_translate_pathname_ 000113 component_file apl_translate_pathname_ 000114 may_use_search_paths apl_translate_pathname_ 000115 version_one apl_translate_pathname_ 000116 absolute_path apl_translate_pathname_ 000117 number_from_wsid apl_translate_pathname_ 000120 idx apl_translate_pathname_ 000121 end_of_number apl_translate_pathname_ 000122 start_of_name apl_translate_pathname_ 000123 entry_name_part apl_translate_pathname_ 000134 Multics_wsid apl_translate_pathname_ 000206 length_Multics_wsid apl_translate_pathname_ 000207 dname apl_translate_pathname_ 000261 ename apl_translate_pathname_ THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. alloc_cs call_ext_out_desc call_ext_out return shorten_stack ext_entry_desc THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. absolute_pathname_ cv_dec_check_ expand_pathname_ expand_pathname_$add_suffix get_wdir_ hcs_$fs_get_path_name ioa_$rsnnl msf_manager_$close msf_manager_$open search_paths_$find_dir user_info_$homedir user_info_$whoami THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. error_table_$noentry LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 11 000070 32 000122 33 000123 34 000124 35 000125 37 000126 40 000155 41 000157 42 000160 43 000161 45 000162 48 000211 49 000212 50 000213 51 000215 54 000216 57 000245 58 000246 59 000250 60 000251 62 000252 70 000255 72 000271 75 000304 76 000341 77 000351 79 000352 81 000375 83 000377 85 000450 86 000520 87 000522 89 000523 90 000526 91 000530 96 000535 102 000552 105 000616 108 000655 110 000701 111 000726 114 000731 116 000733 117 000740 119 000741 121 000742 123 000744 124 000766 125 000774 131 000775 133 001002 135 001010 137 001013 138 001045 143 001050 145 001054 146 001071 148 001102 149 001130 150 001132 152 001140 153 001147 154 001150 158 001166 160 001231 161 001272 169 001304 171 001332 175 001344 176 001352 179 001355 180 001362 181 001367 ----------------------------------------------------------- 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