COMPILATION LISTING OF SEGMENT find_source_file_ Compiled by: Multics PL/I Compiler, Release 32a, of May 31, 1989 Compiled at: Bull HN, Phoenix AZ, System-M Compiled on: 06/09/89 0824.1 mst Fri Options: optimize map 1 /****^ *********************************************************** 2* * * 3* * Copyright, (C) BULL HN Information Systems Inc., 1989 * 4* * * 5* * Copyright, (C) Honeywell Information Systems Inc., 1983 * 6* * * 7* *********************************************************** */ 8 9 10 11 /****^ HISTORY COMMENTS: 12* 1) change(87-01-30,JRGray), approve(89-04-17,MCR8064), audit(89-04-18,Huen), 13* install(89-06-09,MR12.3-1055): 14* Modified to work with explicit archive component pathnames. 15* END HISTORY COMMENTS */ 16 17 18 /* format: style4,indattr,ifthenstmt,ifthen,^indcomtxt,idind33 */ 19 20 find_source_file_: 21 proc (p_pathname, p_suffix, p_source_name, p_source_ptr, p_source_bit_count, p_code); 22 23 /* DESCRIPTION: 24* 25* Find a source file given a pathname (including archive component 26* pathname) and optional suffix to apply to the entryname portion. The 27* results given back to the caller are the sourcename, pointer to, and 28* bit count of the source file. A status code is returned to indicate 29* a fatal error; it only indicates a fatal error if it is non-zero 30* on return. There are three entrypoints: 31* find_source_file_, $look_in_wdir, and $search_path. The first looks only 32* where its input arguments tell it. $look_in_wdir will use the processes' 33* current working_dir if the first check fails. The $search_path entry 34* will only use the search path specified in the argument list. 35**/ 36 37 /* HISTORY: 38* 39*Written by Melanie Weaver, 07/12/83: based on a version by 40* J. R. Gray, 04/25/83. 41*Modified: 42*08/18/83 by S. Herbst: fix bug that only found segs in wdir. 43*08/29/83 by Lee A. Newcomb: add $search_paths entry to implement probe 44* search paths, see MCR 6240 as amended. 45**/ 46 47 /* START OF DECLARATIONS */ 48 /* Parameter */ 49 dcl ( 50 p_pathname char (*), /* full pathname of source file to find */ 51 p_suffix char (*), /* (optional) suffix to be apply */ 52 p_search_list_name char (*), /* name of search list to use */ 53 p_source_name char (*), /* entryname of the file found */ 54 p_source_ptr ptr, /* pointer to the file found */ 55 p_source_bit_count fixed bin (24), /* size of the file found */ 56 p_code fixed bin (35) /* status code, ^= 0 only error occurred */ 57 ) parameter; 58 59 /* Automatic */ 60 dcl ( 61 component_name char (32), /* archive component name. */ 62 dir_name char (528), /* curr. dir to look in, 528 max. depth */ 63 entry_name char (32), 64 ref_dir char (528), /* only used in $search_path entry */ 65 working_dir_name char (528) /* only used in $look_in_wdir */ 66 ) automatic; 67 68 /* Builtin */ 69 70 dcl null builtin; 71 72 /* Entry */ 73 dcl 74 expand_pathname_$component_add_suffix entry (char (*), char (*), char (*), char (*), char (*), fixed bin (35)), 75 get_wdir_ entry () returns (char (168)), 76 initiate_file_$component entry (char (*), char (*), char (*), bit (*), ptr, fixed bin (24), fixed bin (35)), 77 search_paths_$find_dir entry (char (*), ptr, char (*), char (*), char (*), fixed bin (35)); 78 79 80 /* END OF DECLARATIONS */ 81 82 /* find_source_file_: 83*/* proc (p_pathname, p_suffix, p_source_name, p_source_ptr, p_source_bit_count, p_code); */ 84 85 call COMMON_INIT (); /* init output params. & parse p_pathname */ 86 if p_code ^= 0 then return; /* will be zero if no error */ 87 88 call initiate_file_$component (dir_name, entry_name, component_name, R_ACCESS, p_source_ptr, p_source_bit_count, p_code); 89 return; 90 91 /* end find_source_file_; */ 92 93 94 look_in_wdir: 95 entry (p_pathname, p_suffix, p_source_name, p_source_ptr, p_source_bit_count, p_code); 96 97 /* do the same as the main entry, but look in the working directory */ 98 /* if we do not find the file where p_pathname says it is */ 99 100 call COMMON_INIT (); /* init output params. & parse p_pathname */ 101 if p_code ^= 0 then return; /* will be zero if no error */ 102 103 call initiate_file_$component (dir_name, entry_name, component_name, R_ACCESS, p_source_ptr, p_source_bit_count, p_code); 104 if p_code = 0 then return; 105 106 /* if we get here, we need to look in the working directory */ 107 108 working_dir_name = get_wdir_ (); 109 if working_dir_name ^= dir_name then do; /* only do if not dup. effort */ 110 call initiate_file_$component (working_dir_name, entry_name, component_name, R_ACCESS, p_source_ptr, p_source_bit_count, p_code); 111 if p_code = 0 then return; 112 end; 113 114 if component_name ^= "" then /* look for unarchived source in working_dir */ 115 call initiate_file_$component (working_dir_name, component_name, "", R_ACCESS, p_source_ptr, p_source_bit_count, p_code); 116 117 return; 118 119 /* end find_source_file_$look_in_wdir; */ 120 121 search_path: 122 entry (p_pathname, p_suffix, p_search_list_name, p_source_name, p_source_ptr, p_source_bit_count, p_code); 123 124 /* This entry only uses the search list given to find the source file. */ 125 /* This is currently being added for support of the probe search list. */ 126 127 call COMMON_INIT (); /* get entryname to look for */ 128 if p_code ^= 0 then return; /* will be zero if no error */ 129 130 /* set the ref_dir from dir_name so dir_name will be the resultant dir */ 131 132 ref_dir = dir_name; 133 call search_paths_$find_dir (p_search_list_name, null (), entry_name, ref_dir, dir_name, p_code); 134 if p_code = 0 then do; 135 call initiate_file_$component (dir_name, entry_name, component_name, 136 R_ACCESS, p_source_ptr, p_source_bit_count, p_code); 137 if p_code = 0 then return; 138 end; 139 140 if component_name = "" then return; 141 142 /* couldn't find archive?, look for unarchived source */ 143 call search_paths_$find_dir (p_search_list_name, null (), component_name, ref_dir, dir_name, p_code); 144 if p_code ^= 0 then return; 145 146 call initiate_file_$component (dir_name, component_name, "", R_ACCESS, p_source_ptr, p_source_bit_count, p_code); 147 return; 148 149 /* end find_source_file_$search_path; */ 150 151 152 153 154 COMMON_INIT: 155 proc (); 156 157 /* This procedure parses the input pathname into its directory and entryname */ 158 /* portions. If the input is an archive pathname, we return a status code */ 159 /* until support for them is added. First, all output parameters are */ 160 /* initialized, just for safety. */ 161 162 p_source_name = ""; 163 p_source_ptr = null; 164 p_source_bit_count = 0; 165 166 call expand_pathname_$component_add_suffix (p_pathname, p_suffix, dir_name, entry_name, component_name, p_code); 167 if p_code ^= 0 then return; /* bad input */ 168 169 if component_name ^= "" then p_source_name = component_name; 170 else p_source_name = entry_name; 171 end COMMON_INIT; 172 173 174 /* INCLUDE FILES start next page */ 175 1 1 /* BEGIN INCLUDE FILE ... access_mode_values.incl.pl1 1 2* 1 3* Values for the "access mode" argument so often used in hardcore 1 4* James R. Davis 26 Jan 81 MCR 4844 1 5* Added constants for SM access 4/28/82 Jay Pattin 1 6* Added text strings 03/19/85 Chris Jones 1 7**/ 1 8 1 9 1 10 /* format: style4,delnl,insnl,indattr,ifthen,dclind10 */ 1 11 dcl ( 1 12 N_ACCESS init ("000"b), 1 13 R_ACCESS init ("100"b), 1 14 E_ACCESS init ("010"b), 1 15 W_ACCESS init ("001"b), 1 16 RE_ACCESS init ("110"b), 1 17 REW_ACCESS init ("111"b), 1 18 RW_ACCESS init ("101"b), 1 19 S_ACCESS init ("100"b), 1 20 M_ACCESS init ("010"b), 1 21 A_ACCESS init ("001"b), 1 22 SA_ACCESS init ("101"b), 1 23 SM_ACCESS init ("110"b), 1 24 SMA_ACCESS init ("111"b) 1 25 ) bit (3) internal static options (constant); 1 26 1 27 /* The following arrays are meant to be accessed by doing either 1) bin (bit_value) or 1 28* 2) divide (bin_value, 2) to come up with an index into the array. */ 1 29 1 30 dcl SEG_ACCESS_MODE_NAMES (0:7) init ("null", "W", "E", "EW", "R", "RW", "RE", "REW") char (4) internal 1 31 static options (constant); 1 32 1 33 dcl DIR_ACCESS_MODE_NAMES (0:7) init ("null", "A", "M", "MA", "S", "SA", "SM", "SMA") char (4) internal 1 34 static options (constant); 1 35 1 36 dcl ( 1 37 N_ACCESS_BIN init (00000b), 1 38 R_ACCESS_BIN init (01000b), 1 39 E_ACCESS_BIN init (00100b), 1 40 W_ACCESS_BIN init (00010b), 1 41 RW_ACCESS_BIN init (01010b), 1 42 RE_ACCESS_BIN init (01100b), 1 43 REW_ACCESS_BIN init (01110b), 1 44 S_ACCESS_BIN init (01000b), 1 45 M_ACCESS_BIN init (00010b), 1 46 A_ACCESS_BIN init (00001b), 1 47 SA_ACCESS_BIN init (01001b), 1 48 SM_ACCESS_BIN init (01010b), 1 49 SMA_ACCESS_BIN init (01011b) 1 50 ) fixed bin (5) internal static options (constant); 1 51 1 52 /* END INCLUDE FILE ... access_mode_values.incl.pl1 */ 176 177 178 179 end find_source_file_; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 06/09/89 0808.5 find_source_file_.pl1 >spec>install>1055>find_source_file_.pl1 176 1 04/11/85 1452.6 access_mode_values.incl.pl1 >ldd>include>access_mode_values.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. R_ACCESS 000000 constant bit(3) initial packed unaligned dcl 1-11 set ref 88* 103* 110* 114* 135* 146* component_name 000100 automatic char(32) packed unaligned dcl 60 set ref 88* 103* 110* 114 114* 135* 140 143* 146* 166* 169 169 dir_name 000110 automatic char(528) packed unaligned dcl 60 set ref 88* 103* 109 132 133* 135* 143* 146* 166* entry_name 000314 automatic char(32) packed unaligned dcl 60 set ref 88* 103* 110* 133* 135* 166* 170 expand_pathname_$component_add_suffix 000010 constant entry external dcl 73 ref 166 get_wdir_ 000012 constant entry external dcl 73 ref 108 initiate_file_$component 000014 constant entry external dcl 73 ref 88 103 110 114 135 146 null builtin function dcl 70 ref 133 133 143 143 163 p_code parameter fixed bin(35,0) dcl 49 set ref 20 86 88* 94 101 103* 104 110* 111 114* 121 128 133* 134 135* 137 143* 144 146* 166* 167 p_pathname parameter char packed unaligned dcl 49 set ref 20 94 121 166* p_search_list_name parameter char packed unaligned dcl 49 set ref 121 133* 143* p_source_bit_count parameter fixed bin(24,0) dcl 49 set ref 20 88* 94 103* 110* 114* 121 135* 146* 164* p_source_name parameter char packed unaligned dcl 49 set ref 20 94 121 162* 169* 170* p_source_ptr parameter pointer dcl 49 set ref 20 88* 94 103* 110* 114* 121 135* 146* 163* p_suffix parameter char packed unaligned dcl 49 set ref 20 94 121 166* ref_dir 000324 automatic char(528) packed unaligned dcl 60 set ref 132* 133* 143* search_paths_$find_dir 000016 constant entry external dcl 73 ref 133 143 working_dir_name 000530 automatic char(528) packed unaligned dcl 60 set ref 108* 109 110* 114* NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. A_ACCESS internal static bit(3) initial packed unaligned dcl 1-11 A_ACCESS_BIN internal static fixed bin(5,0) initial dcl 1-36 DIR_ACCESS_MODE_NAMES internal static char(4) initial array packed unaligned dcl 1-33 E_ACCESS internal static bit(3) initial packed unaligned dcl 1-11 E_ACCESS_BIN internal static fixed bin(5,0) initial dcl 1-36 M_ACCESS internal static bit(3) initial packed unaligned dcl 1-11 M_ACCESS_BIN internal static fixed bin(5,0) initial dcl 1-36 N_ACCESS internal static bit(3) initial packed unaligned dcl 1-11 N_ACCESS_BIN internal static fixed bin(5,0) initial dcl 1-36 REW_ACCESS internal static bit(3) initial packed unaligned dcl 1-11 REW_ACCESS_BIN internal static fixed bin(5,0) initial dcl 1-36 RE_ACCESS internal static bit(3) initial packed unaligned dcl 1-11 RE_ACCESS_BIN internal static fixed bin(5,0) initial dcl 1-36 RW_ACCESS internal static bit(3) initial packed unaligned dcl 1-11 RW_ACCESS_BIN internal static fixed bin(5,0) initial dcl 1-36 R_ACCESS_BIN internal static fixed bin(5,0) initial dcl 1-36 SA_ACCESS internal static bit(3) initial packed unaligned dcl 1-11 SA_ACCESS_BIN internal static fixed bin(5,0) initial dcl 1-36 SEG_ACCESS_MODE_NAMES internal static char(4) initial array packed unaligned dcl 1-30 SMA_ACCESS internal static bit(3) initial packed unaligned dcl 1-11 SMA_ACCESS_BIN internal static fixed bin(5,0) initial dcl 1-36 SM_ACCESS internal static bit(3) initial packed unaligned dcl 1-11 SM_ACCESS_BIN internal static fixed bin(5,0) initial dcl 1-36 S_ACCESS internal static bit(3) initial packed unaligned dcl 1-11 S_ACCESS_BIN internal static fixed bin(5,0) initial dcl 1-36 W_ACCESS internal static bit(3) initial packed unaligned dcl 1-11 W_ACCESS_BIN internal static fixed bin(5,0) initial dcl 1-36 NAMES DECLARED BY EXPLICIT CONTEXT. COMMON_INIT 000641 constant entry internal dcl 154 ref 85 100 127 find_source_file_ 000022 constant entry external dcl 20 look_in_wdir 000123 constant entry external dcl 94 search_path 000357 constant entry external dcl 121 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 1052 1072 737 1062 Length 1272 737 20 163 113 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME find_source_file_ 598 external procedure is an external procedure. COMMON_INIT internal procedure shares stack frame of external procedure find_source_file_. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME find_source_file_ 000100 component_name find_source_file_ 000110 dir_name find_source_file_ 000314 entry_name find_source_file_ 000324 ref_dir find_source_file_ 000530 working_dir_name find_source_file_ THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. call_ext_out_desc call_ext_out return_mac ext_entry_desc THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. expand_pathname_$component_add_suffix get_wdir_ initiate_file_$component search_paths_$find_dir NO EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 20 000014 85 000055 86 000056 88 000060 89 000120 94 000121 100 000156 101 000157 103 000161 104 000221 108 000223 109 000235 110 000241 111 000301 114 000303 117 000350 121 000351 127 000417 128 000420 132 000422 133 000425 134 000465 135 000467 137 000527 140 000531 143 000535 144 000575 146 000577 147 000640 154 000641 162 000642 163 000652 164 000655 166 000656 167 000714 169 000717 170 000731 171 000736 ----------------------------------------------------------- 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