COMPILATION LISTING OF SEGMENT xforum_find_path_ Compiled by: Multics PL/I Compiler, Release 29, of July 28, 1986 Compiled at: Honeywell Bull, Phoenix AZ, SysM Compiled on: 02/16/88 1414.6 mst Tue Options: optimize map 1 /****^ *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Bull Inc., 1987 * 4* * * 5* * Copyright, (C) Honeywell Information Systems Inc., 1983 * 6* * * 7* *********************************************************** */ 8 9 10 11 /****^ HISTORY COMMENTS: 12* 1) change(85-06-17,Davids), approve(86-02-04,MCR7350), 13* audit(86-04-24,Gilcrease), install(86-04-24,MR12.0-1048): 14* Updated header comments. Removed reference to unused sl_control_s 15* include file. CChanged order of parameters so that the output 16* forum_dir comes after the input forum_version instead of the other 17* way around. 18* 2) change(87-07-21,LJAdams), approve(87-07-21,MCR7684), 19* audit(87-07-24,Blair), install(87-08-06,MR12.1-1065): 20* Declared constant MIN_NAME_LEN to get rid of magic number 1. 21* END HISTORY COMMENTS */ 22 23 24 xforum_find_path_: proc (forum_name, forum_version, forum_dir, forum_control_entry, code); 25 26 /* 27* BEGIN DESCRIPTION 28* 29* function: 30* This module is used to determine if a given name is the name of a 31* forum meeting. The name does not include the forum or control suffix. 32* The meeting list structure has already been searched and the name 33* does not appear in the list. The current forum search rules are used 34* to search for the name. The version of the meeting is input to this 35* module, so first it is called with version 1 and if not meeting is 36* found it is called again with version 2. If a meeting is located the 37* The directory, and name of the forum meeting are returned. The output 38* name includes either the .forum or .control suffix. If the name does 39* not correspond to a meeting found by the search paths the error 40* forum_error_$not_in_search_list is returned. 41* 42* description of entry points: 43* xforum_find_path: 44* input: char (*) name of meeting to find (suffix is NOT included) 45* fixed bin version of meeting being looked for 46* output: char (*) directory meeting is in or "" if not found 47* char (*) primary name on the meeting, includes suffix 48* fixed bin (35) standard error code 49* Version specific information, i.e. meeting name suffix and maximum 50* name lengths have been isolated in the variables MAX_NAME_LEN 51* and NAME_SUFFIX. The module search_paths_$find_all will search 52* the current forum search paths for any occurance of a branch 53* with the input name concatinated with the appropriate suffix and 54* return a list of those paths. For each path returned a call is made to 55* forum_$get_forum_path to determine if the branch is really a forum 56* meeting and to determine the real directory and entry name (it will 57* follow links). The array of paths is allocated in the system free are 58* so a cleanup handler is used to be sure that the space is freed up. 59* 60* description of internal procedures: 61* 62* known bugs: 63* 64* notes: 65* 66* history: 67* 83-??-?? Deryk Barker: written. 68* 69* 84-03-27 Davids: added forum_version parameter and tests of forum_verson 70* to see if the .control or .forum suffix is to be used. 71* 72* 84-09-04 Davids: Added code = 0 as the first executable statement. 73* code was not being set to zero which was causing problems. 74* 75* 84-11-06 Davids: Auditing changes: 1) improved functional description, 76* 2) isolated version specific constants into the MAX_NAME_LEN and 77* NAME_SUFFIX arrays, 3) change the call to search_paths_$get to 78* search_paths_$find_all, and 4) replaced references to status with 79* references to code. Also deleted code at the end of the module which 80* set the value of forum_name_len based on the name returned by 81* forum_$get_forum_path, why set an automatic variable right before 82* exiting the module? And redid the declaration so that they are separated 83* by type. 84* END DESCRIPTION 85**/ 86 87 /* PARAMETERS */ 88 89 dcl forum_name char (*); /* (input) name of meeting to find (suffix is NOT included) */ 90 dcl forum_version fixed bin; /* (input) version of meeting being looked for */ 91 dcl forum_dir char (*); /* (output) directory meeting is in or "" if not found */ 92 dcl forum_control_entry char (*); /* (output) primary name on the meeting, includes suffix */ 93 dcl code fixed bin (35); /* (output) standard error code */ 94 95 /* EXTERNAL STATIC */ 96 97 dcl error_table_$noentry fixed bin (35) ext static; 98 dcl forum_error_table_$long_forum_name fixed bin (35) ext static; 99 dcl forum_error_table_$blank_forum_name fixed bin (35) ext static; 100 dcl forum_error_table_$not_in_search_list fixed bin (35) ext static; 101 102 /* ENTRIES */ 103 dcl forum_$get_forum_path entry (char (*), char (*), char (*), char (*), fixed bin (35)); 104 dcl get_system_free_area_ entry () returns (ptr); 105 dcl search_paths_$find_all entry (char (*), ptr, char (*), char (*), ptr, fixed bin, ptr, fixed bin (35)); 106 107 108 109 /* CONDITIONS */ 110 111 dcl cleanup condition; 112 113 /* INTERNAL AUTOMATIC */ 114 115 dcl forum_name_len fixed bin; /* length of the input meeting name */ 116 dcl idx fixed bin; /* index into the search paths array */ 117 dcl real_dir char (168); /* directory meeting is in if found */ 118 dcl real_entry char (32); /* primary name of meeting if found */ 119 120 /* INTERNAL STATIC */ 121 122 /* CONSTANTS */ 123 124 dcl ( 125 MIN_NAME_LEN fixed bin init (2), 126 MAX_NAME_LEN (2) fixed bin init (24, 26), 127 /* max length of meeting name not including suffix */ 128 /* for version 1 and version 2 meeting names */ 129 NAME_SUFFIX (2) char (8) varying init (".control", ".forum") 130 /* meeting name suffixes for version 1 and version 2 names */ 131 ) internal static options (constant); 132 133 /* BUILTINS */ 134 135 dcl ( 136 length, 137 null, 138 rtrim 139 ) builtin; 140 141 /* BASED */ 142 143 /* INCLUDE FILES */ 144 1 1 /* BEGIN INCLUDE FILE . . . sl_info.incl.pl1 */ 1 2 1 3 1 4 1 5 /****^ HISTORY COMMENTS: 1 6* 1) change(87-11-16,Lippard), approve(87-12-21,MCR7822), 1 7* audit(88-02-09,Blair), install(88-02-16,MR12.2-1023): 1 8* Modified to add INITIATED_SEGS type. 1 9* 2) change(87-11-19,Lippard), approve(87-12-21,MCR7822), 1 10* audit(88-02-09,Blair), install(88-02-16,MR12.2-1023): 1 11* Added uid to sl_info structure. 1 12* END HISTORY COMMENTS */ 1 13 1 14 1 15 declare 1 sl_info aligned based (sl_info_p), 1 16 2 version fixed binary, /* Must be 1 */ 1 17 2 num_paths fixed binary, /* Number of search paths */ 1 18 2 change_index_p pointer, /* Pointer to search list's update count */ 1 19 2 change_index fixed binary (71), /* This search list's update count */ 1 20 2 pad1 (6) bit (36), /* Must be zero */ 1 21 2 paths (sl_info_num_paths refer (sl_info.num_paths)), 1 22 3 type fixed binary, /* Type of search path */ 1 23 3 code fixed binary (35), /* Standard status code of search path */ 1 24 3 uid bit (36), /* Unique ID */ 1 25 3 pathname char (168) unaligned; /* Search pathname */ 1 26 1 27 declare sl_info_num_paths fixed binary; 1 28 declare sl_info_p pointer; 1 29 declare sl_info_version_1 fixed binary internal static options (constant) initial (1); 1 30 1 31 /* Keyword Types */ 1 32 1 33 declare ABSOLUTE_PATH fixed binary internal static options (constant) initial (0); 1 34 declare UNEXPANDED_PATH fixed binary internal static options (constant) initial (1); 1 35 declare REFERENCING_DIR fixed binary internal static options (constant) initial (3); 1 36 declare WORKING_DIR fixed binary internal static options (constant) initial (4); 1 37 declare PROCESS_DIR fixed binary internal static options (constant) initial (5); 1 38 declare HOME_DIR fixed binary internal static options (constant) initial (6); 1 39 declare INITIATED_SEGS fixed binary internal static options (constant) initial (7); 1 40 1 41 /* END INCLUDE FILE . . . sl_info.incl.pl1 */ 145 146 147 code = 0; 148 149 forum_name_len = length (rtrim (forum_name)); 150 151 if forum_name_len < MIN_NAME_LEN 152 then do; 153 code = forum_error_table_$blank_forum_name; 154 return; 155 end; 156 157 if forum_name_len > MAX_NAME_LEN (forum_version) 158 then do; 159 code = forum_error_table_$long_forum_name; 160 return; 161 end; 162 163 forum_control_entry = rtrim (forum_name) || NAME_SUFFIX (forum_version); 164 165 sl_info_p = null (); 166 on cleanup 167 begin; 168 if sl_info_p ^= null () 169 then free sl_info; 170 end; 171 172 call search_paths_$find_all ("forum", null (), forum_control_entry, "", 173 get_system_free_area_ (), sl_info_version_1, sl_info_p, code); 174 if code ^= 0 175 then return; 176 177 forum_dir = ""; 178 code = 1; 179 do idx = 1 to sl_info.num_paths while (code ^= 0); 180 if sl_info.paths (idx).code = 0 181 then call forum_$get_forum_path (sl_info.pathname (idx), 182 forum_control_entry, real_dir, real_entry, code); 183 end; 184 free sl_info; 185 186 if code ^= 0 187 then do; 188 if code = error_table_$noentry 189 then do; 190 code = forum_error_table_$not_in_search_list; 191 return; 192 end; 193 else return; 194 end; 195 196 forum_dir = real_dir; 197 forum_control_entry = real_entry; 198 199 return; 200 201 end xforum_find_path_; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 02/16/88 1411.9 xforum_find_path_.pl1 >spec>install>MR12.2-1023>xforum_find_path_.pl1 145 1 02/16/88 1407.4 sl_info.incl.pl1 >spec>install>MR12.2-1023>sl_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. MAX_NAME_LEN 000006 constant fixed bin(17,0) initial array dcl 124 ref 157 MIN_NAME_LEN constant fixed bin(17,0) initial dcl 124 ref 151 NAME_SUFFIX 000000 constant varying char(8) initial array dcl 124 ref 163 cleanup 000100 stack reference condition dcl 111 ref 166 code 15 based fixed bin(35,0) array level 3 in structure "sl_info" dcl 1-15 in procedure "xforum_find_path_" ref 180 code parameter fixed bin(35,0) dcl 93 in procedure "xforum_find_path_" set ref 24 147* 153* 159* 172* 174 178* 179 180* 186 188 190* error_table_$noentry 000010 external static fixed bin(35,0) dcl 97 ref 188 forum_$get_forum_path 000020 constant entry external dcl 103 ref 180 forum_control_entry parameter char unaligned dcl 92 set ref 24 163* 172* 180* 197* forum_dir parameter char unaligned dcl 91 set ref 24 177* 196* forum_error_table_$blank_forum_name 000014 external static fixed bin(35,0) dcl 99 ref 153 forum_error_table_$long_forum_name 000012 external static fixed bin(35,0) dcl 98 ref 159 forum_error_table_$not_in_search_list 000016 external static fixed bin(35,0) dcl 100 ref 190 forum_name parameter char unaligned dcl 89 ref 24 149 163 forum_name_len 000106 automatic fixed bin(17,0) dcl 115 set ref 149* 151 157 forum_version parameter fixed bin(17,0) dcl 90 ref 24 157 163 get_system_free_area_ 000022 constant entry external dcl 104 ref 172 172 idx 000107 automatic fixed bin(17,0) dcl 116 set ref 179* 180 180* length builtin function dcl 135 ref 149 null builtin function dcl 135 ref 165 168 172 172 num_paths 1 based fixed bin(17,0) level 2 dcl 1-15 ref 168 179 184 pathname 17 based char(168) array level 3 packed unaligned dcl 1-15 set ref 180* paths 14 based structure array level 2 dcl 1-15 real_dir 000110 automatic char(168) unaligned dcl 117 set ref 180* 196 real_entry 000162 automatic char(32) unaligned dcl 118 set ref 180* 197 rtrim builtin function dcl 135 ref 149 163 search_paths_$find_all 000024 constant entry external dcl 105 ref 172 sl_info based structure level 1 dcl 1-15 set ref 168 184 sl_info_p 000172 automatic pointer dcl 1-28 set ref 165* 168 168 172* 179 180 180 184 sl_info_version_1 000020 constant fixed bin(17,0) initial dcl 1-29 set ref 172* NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. ABSOLUTE_PATH internal static fixed bin(17,0) initial dcl 1-33 HOME_DIR internal static fixed bin(17,0) initial dcl 1-38 INITIATED_SEGS internal static fixed bin(17,0) initial dcl 1-39 PROCESS_DIR internal static fixed bin(17,0) initial dcl 1-37 REFERENCING_DIR internal static fixed bin(17,0) initial dcl 1-35 UNEXPANDED_PATH internal static fixed bin(17,0) initial dcl 1-34 WORKING_DIR internal static fixed bin(17,0) initial dcl 1-36 sl_info_num_paths automatic fixed bin(17,0) dcl 1-27 NAME DECLARED BY EXPLICIT CONTEXT. xforum_find_path_ 000035 constant entry external dcl 24 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 540 566 402 550 Length 770 402 26 165 135 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME xforum_find_path_ 174 external procedure is an external procedure. on unit on line 166 64 on unit STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME xforum_find_path_ 000106 forum_name_len xforum_find_path_ 000107 idx xforum_find_path_ 000110 real_dir xforum_find_path_ 000162 real_entry xforum_find_path_ 000172 sl_info_p xforum_find_path_ THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. alloc_char_temp call_ext_out_desc call_ext_out return_mac enable_op shorten_stack ext_entry_desc int_entry op_freen_ THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. forum_$get_forum_path get_system_free_area_ search_paths_$find_all THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. error_table_$noentry forum_error_table_$blank_forum_name forum_error_table_$long_forum_name forum_error_table_$not_in_search_list LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 24 000030 147 000062 149 000064 151 000100 153 000102 154 000104 157 000105 159 000110 160 000112 163 000113 165 000141 166 000144 168 000160 170 000173 172 000174 174 000254 177 000257 178 000264 179 000266 180 000302 183 000345 184 000347 186 000355 188 000360 190 000363 191 000365 193 000366 196 000367 197 000374 199 000401 ----------------------------------------------------------- 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