COMPILATION LISTING OF SEGMENT teco_get_macro_ Compiled by: Multics PL/I Compiler, Release 27d, of October 11, 1982 Compiled at: Honeywell LISD Phoenix, System M Compiled on: 11/15/82 1744.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 teco_get_macro_: procedure (macro_name, macro_address, macro_length, return_code); 12 13 /* This procedure implements teco's search rules. There are several entry points: 14* 15*teco_get_macro_ - This entry point is called by teco to get a pointer to an external macro 16* for an "em" command. 17* 18*teco_search - This entry point may be called using an "es" command and returns the full pathname 19* of an external macro. 20* 21*teco_ssd - This entry point may be invoked as a command to change the second directory searched. 22* If this entry point is not invoked or if the argument is a null string, the user's home directory 23* will be searched. 24* 25*The directories searched by teco_get_macro_ are: 26* 27* 1. the current working directory 28* 2. the user's directory, or any user specified directory 29* 3. the containing directory for teco (called the teco library directory) 30* 31* Date last modified and reasons: 32* 06/19/75 by David Levin to clean up and fix bugs 33* 04/18/75 by David Levin to remove imbedded pathnames 34* 04/21/72 by Peter Bishop to add teco_search and teco_ssd entries 35* 06/27/71 by Richard H. Gumpertz for initial implementation 36* */ 37 38 39 get_macro_entry_flag = "1"b; 40 arglen = length(macro_name); 41 goto start_work; 42 43 /* Secondary entry points. */ 44 teco_ssd: entry; 45 call cu_$arg_ptr(1, argptr, arglen, code); 46 if code ^= 0 47 then do; 48 call com_err_(code, "teco_ssd"); 49 return; 50 end; 51 dir_name(2) = search_dir; 52 return; 53 54 55 teco_search: entry (macro_name, arg1, arg2, current_expression); 56 get_macro_entry_flag = "0"b; 57 arglen = index(macro_name, " ") - 1; 58 59 /* Parameters - teco_get_macro_ */ 60 dcl 61 macro_name char(*) aligned, /* Macro name without "teco" suffix. (input) */ 62 macro_address pointer, /* Pointer to segment containing the macro. (output) */ 63 macro_length fixed bin(24), /* Character length of segment. (output) */ 64 return_code fixed bin(35); /* Error code. (output) */ 65 66 /* Parameters - teco_search */ 67 dcl 68 /* First argument declared above. (input/output) */ 69 /* Macro name without "teco" suffix. (input) */ 70 /* Full pathname of segment. (output) */ 71 (arg1, arg2) fixed bin(24), /* not used */ 72 current_expression fixed bin(24); /* Length of pathname. (output) */ 73 74 /* Based */ 75 dcl 76 search_dir char(arglen) based(argptr); 77 78 /* Automatic */ 79 dcl 80 arglen fixed bin, 81 argptr ptr, 82 bit_count fixed bin(24), 83 code fixed bin(35), 84 entry_name char(32) aligned, 85 get_macro_entry_flag bit(1) aligned, 86 i fixed bin, 87 temp_ptr ptr; 88 89 /* External Entries */ 90 dcl 91 com_err_ entry options(variable), 92 cu_$arg_ptr entry(fixed bin, ptr, fixed bin, fixed bin(35)), 93 get_seg_ptr_full_path_ entry(char(*), char(*) aligned, bit(6) aligned, fixed bin(24), ptr, fixed bin(35)), 94 get_wdir_ entry() returns(char(168)), 95 hcs_$fs_get_path_name entry(entry, char(*), fixed bin, char(*) aligned, fixed bin(35)), 96 ioa_$rsnnl entry options(variable), 97 user_info_$homedir entry(char(*)); 98 99 /* Internal Static */ 100 dcl 101 r_access bit(6) aligned initial("010000"b) internal static, 102 dir_name(3) char(168) initial((3) (168) " ") internal static; 103 104 dcl (divide, hbound, index, length, null, reverse, substr) builtin; 105 106 start_work: 107 dir_name(1) = get_wdir_(); 108 109 if substr(dir_name(2), 1, 4) = " " then call user_info_$homedir(dir_name(2)); 110 111 if substr(dir_name(3), 1, 4) = " " 112 then call hcs_$fs_get_path_name(teco_get_macro_, dir_name(3), i, entry_name, code); 113 114 entry_name = substr(macro_name, 1, arglen); 115 substr(entry_name, arglen+1, 5) = ".teco"; 116 117 do i = 1 to hbound(dir_name, 1); 118 call get_seg_ptr_full_path_ (dir_name (i), entry_name, r_access, bit_count, temp_ptr, code); 119 if temp_ptr ^= null 120 then if get_macro_entry_flag 121 then do; 122 macro_address = temp_ptr; 123 macro_length = divide(bit_count+8, 9, 17, 0); 124 return_code = code; 125 return; 126 end; 127 else do; 128 call ioa_$rsnnl("^a>^a", macro_name, current_expression, dir_name(i), entry_name); 129 return; 130 end; 131 end; 132 if get_macro_entry_flag then return_code = code; 133 end teco_get_macro_; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/15/82 1526.7 teco_get_macro_.pl1 >dumps>old>recomp>teco_get_macro_.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. arg1 parameter fixed bin(24,0) dcl 67 ref 55 arg2 parameter fixed bin(24,0) dcl 67 ref 55 arglen 000100 automatic fixed bin(17,0) dcl 79 set ref 40* 45* 51 57* 114 115 argptr 000102 automatic pointer dcl 79 set ref 45* 51 bit_count 000104 automatic fixed bin(24,0) dcl 79 set ref 118* 123 code 000105 automatic fixed bin(35,0) dcl 79 set ref 45* 46 48* 111* 118* 124 132 com_err_ 000210 constant entry external dcl 90 ref 48 cu_$arg_ptr 000212 constant entry external dcl 90 ref 45 current_expression parameter fixed bin(24,0) dcl 67 set ref 55 128* dir_name 000011 internal static char(168) initial array unaligned dcl 100 set ref 51* 106* 109 109* 111 111* 117 118* 128* divide builtin function dcl 104 ref 123 entry_name 000106 automatic char(32) dcl 79 set ref 111* 114* 115* 118* 128* get_macro_entry_flag 000116 automatic bit(1) dcl 79 set ref 39* 56* 119 132 get_seg_ptr_full_path_ 000214 constant entry external dcl 90 ref 118 get_wdir_ 000216 constant entry external dcl 90 ref 106 hbound builtin function dcl 104 ref 117 hcs_$fs_get_path_name 000220 constant entry external dcl 90 ref 111 i 000117 automatic fixed bin(17,0) dcl 79 set ref 111* 117* 118 128* index builtin function dcl 104 ref 57 ioa_$rsnnl 000222 constant entry external dcl 90 ref 128 length builtin function dcl 104 ref 40 macro_address parameter pointer dcl 60 set ref 11 122* macro_length parameter fixed bin(24,0) dcl 60 set ref 11 123* macro_name parameter char dcl 60 set ref 11 40 55 57 114 128* null builtin function dcl 104 ref 119 r_access 000010 internal static bit(6) initial dcl 100 set ref 118* return_code parameter fixed bin(35,0) dcl 60 set ref 11 124* 132* search_dir based char unaligned dcl 75 ref 51 substr builtin function dcl 104 set ref 109 111 114 115* temp_ptr 000120 automatic pointer dcl 79 set ref 118* 119 122 user_info_$homedir 000224 constant entry external dcl 90 ref 109 NAME DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. reverse builtin function dcl 104 NAMES DECLARED BY EXPLICIT CONTEXT. start_work 000162 constant label dcl 106 ref 41 teco_get_macro_ 000031 constant entry external dcl 11 ref 111 111 teco_search 000133 constant entry external dcl 55 teco_ssd 000051 constant entry external dcl 44 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 542 770 414 552 Length 1154 414 226 147 125 200 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME teco_get_macro_ 144 external procedure is an external procedure. STORAGE FOR INTERNAL STATIC VARIABLES. LOC IDENTIFIER BLOCK NAME 000010 r_access teco_get_macro_ 000011 dir_name teco_get_macro_ STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME teco_get_macro_ 000100 arglen teco_get_macro_ 000102 argptr teco_get_macro_ 000104 bit_count teco_get_macro_ 000105 code teco_get_macro_ 000106 entry_name teco_get_macro_ 000116 get_macro_entry_flag teco_get_macro_ 000117 i teco_get_macro_ 000120 temp_ptr teco_get_macro_ THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. call_ext_out_desc call_ext_out return ext_entry ext_entry_desc THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. com_err_ cu_$arg_ptr get_seg_ptr_full_path_ get_wdir_ hcs_$fs_get_path_name ioa_$rsnnl user_info_$homedir NO EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 11 000024 39 000044 40 000046 41 000047 44 000050 45 000056 46 000075 48 000077 49 000116 51 000117 52 000125 55 000126 56 000146 57 000147 106 000162 109 000171 111 000205 114 000245 115 000253 117 000256 118 000263 119 000322 122 000330 123 000333 124 000337 125 000341 128 000342 129 000400 131 000401 132 000403 133 000410 ----------------------------------------------------------- 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