COMPILATION LISTING OF SEGMENT process_dir Compiled by: Multics PL/I Compiler, Release 30, of February 16, 1988 Compiled at: Honeywell Bull, Phoenix AZ, SysM Compiled on: 07/05/88 1403.0 mst Tue Options: optimize map 1 /****^ *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Bull Inc., 1988 * 4* * * 5* * Copyright, (C) Honeywell Information Systems Inc., 1982 * 6* * * 7* * Copyright (c) 1972 by Massachusetts Institute of * 8* * Technology and Honeywell Information Systems, Inc. * 9* * * 10* *********************************************************** */ 11 12 13 14 15 /****^ HISTORY COMMENTS: 16* 1) change(88-04-28,TLNguyen), approve(88-04-28,MCR7839), 17* audit(88-05-04,Lippard), install(88-07-05,MR12.2-1054): 18* Remove the working_dir entry from the source, process_dir.pl1. This entry 19* is combined with the print_wdir entry for the purpose of identical 20* operation. For more details, see MTB 775. 21* END HISTORY COMMENTS */ 22 23 24 process_dir: 25 pd: procedure options (variable); 26 27 /* initially coded in February 1970 by V Voydock */ 28 /* Modified 12/15/75 by Steve Herbst to be callable as a command */ 29 /* Modified 06/09/78 by W. Olin Sibert to add dwd function */ 30 /* Modified 06/07/80, W. Olin Sibert, to reject arguments, and for wd to treat no wdir as error. */ 31 /* Modified 10/15/82, Linda Pugh, to requote return arg, in case directory 32* name contains a space. */ 33 34 dcl dirname char (168) aligned; 35 dcl return_arg char (rl) varying based (rp); 36 dcl rp ptr; 37 dcl (argcount, lng, rl) fixed bin; 38 dcl af_sw bit (1) aligned; 39 dcl complain entry variable options (variable); 40 dcl code fixed bin (35); 41 dcl whoami char (32); 42 43 dcl active_fnc_err_ entry options (variable); 44 dcl com_err_ entry options (variable); 45 dcl cu_$af_return_arg entry (fixed bin, ptr, fixed bin, fixed bin (35)); 46 dcl get_pdir_ entry () returns (char (168)); 47 dcl get_default_wdir_ entry () returns (char (168)); 48 dcl hcs_$fs_search_get_wdir entry (ptr, fixed bin); 49 dcl ioa_ entry options (variable); 50 dcl requote_string_ entry (char(*)) returns (char(*)); 51 dcl user_info_$homedir entry (char (*) aligned); 52 53 dcl (error_table_$not_act_fnc, 54 error_table_$no_wdir, 55 error_table_$too_many_args) fixed bin (35) external static; 56 57 dcl (PROCESS_DIR init ("process_dir"), 58 WORKING_DIR init ("working_dir"), 59 HOME_DIR init ("home_dir"), 60 DEFAULT_WDIR init ("default_wdir")) char (32) internal static options (constant); 61 62 dcl (addr, reverse, substr, verify) builtin; 63 64 /* */ 65 66 /* process_dir: pd: entry options (variable); */ 67 68 whoami = PROCESS_DIR; 69 goto COMMON; 70 71 72 home_dir: 73 hd: entry options (variable); 74 75 whoami = HOME_DIR; 76 goto COMMON; 77 78 79 default_wdir: 80 dwd: entry options (variable); 81 82 whoami = DEFAULT_WDIR; 83 goto COMMON; 84 85 86 COMMON: call cu_$af_return_arg (argcount, rp, rl, code); 87 if code = error_table_$not_act_fnc then do; 88 af_sw = "0"b; 89 complain = com_err_; 90 end; 91 else do; 92 af_sw = "1"b; 93 complain = active_fnc_err_; 94 return_arg = ""; 95 end; 96 97 if argcount ^= 0 then do; 98 call complain (error_table_$too_many_args, whoami, "No arguments are permitted."); 99 return; 100 end; 101 102 dirname = ""; 103 104 if whoami = PROCESS_DIR then 105 dirname = get_pdir_ (); 106 107 else if whoami = HOME_DIR then 108 call user_info_$homedir (dirname); 109 110 else if whoami = DEFAULT_WDIR then 111 dirname = get_default_wdir_ (); 112 113 else do; /* only one left is WORKING_DIR */ 114 call hcs_$fs_search_get_wdir (addr (dirname), lng); 115 if lng = 0 then do; /* no wdir.... */ 116 call complain (error_table_$no_wdir, whoami); 117 return; 118 end; 119 120 else if lng < maxlength (dirname) then /* trim off spaces */ 121 substr (dirname, lng + 1) = ""; 122 end; 123 124 if af_sw then 125 return_arg = requote_string_ (rtrim(dirname)); 126 127 else call ioa_ ("^a", dirname); 128 129 return; 130 end process_dir; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 07/05/88 1358.6 process_dir.pl1 >special_ldd>install>MR12.2-1054>process_dir.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. DEFAULT_WDIR 000000 constant char(32) initial packed unaligned dcl 57 ref 82 110 HOME_DIR 000010 constant char(32) initial packed unaligned dcl 57 ref 75 107 PROCESS_DIR 000020 constant char(32) initial packed unaligned dcl 57 ref 68 104 active_fnc_err_ 000010 constant entry external dcl 43 ref 93 addr builtin function dcl 62 ref 114 114 af_sw 000157 automatic bit(1) dcl 38 set ref 88* 92* 124 argcount 000154 automatic fixed bin(17,0) dcl 37 set ref 86* 97 code 000164 automatic fixed bin(35,0) dcl 40 set ref 86* 87 com_err_ 000012 constant entry external dcl 44 ref 89 complain 000160 automatic entry variable dcl 39 set ref 89* 93* 98 116 cu_$af_return_arg 000014 constant entry external dcl 45 ref 86 dirname 000100 automatic char(168) dcl 34 set ref 102* 104* 107* 110* 114 114 120 120* 124 124 127* error_table_$no_wdir 000034 external static fixed bin(35,0) dcl 53 set ref 116* error_table_$not_act_fnc 000032 external static fixed bin(35,0) dcl 53 ref 87 error_table_$too_many_args 000036 external static fixed bin(35,0) dcl 53 set ref 98* get_default_wdir_ 000020 constant entry external dcl 47 ref 110 get_pdir_ 000016 constant entry external dcl 46 ref 104 hcs_$fs_search_get_wdir 000022 constant entry external dcl 48 ref 114 ioa_ 000024 constant entry external dcl 49 ref 127 lng 000155 automatic fixed bin(17,0) dcl 37 set ref 114* 115 120 120 requote_string_ 000026 constant entry external dcl 50 ref 124 return_arg based varying char dcl 35 set ref 94* 124* rl 000156 automatic fixed bin(17,0) dcl 37 set ref 86* 94 124 rp 000152 automatic pointer dcl 36 set ref 86* 94 124 substr builtin function dcl 62 set ref 120* user_info_$homedir 000030 constant entry external dcl 51 ref 107 whoami 000165 automatic char(32) packed unaligned dcl 41 set ref 68* 75* 82* 98* 104 107 110 116* NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. WORKING_DIR internal static char(32) initial packed unaligned dcl 57 reverse builtin function dcl 62 verify builtin function dcl 62 NAMES DECLARED BY EXPLICIT CONTEXT. COMMON 000131 constant label dcl 86 ref 69 76 83 default_wdir 000120 constant entry external dcl 79 dwd 000111 constant entry external dcl 79 hd 000070 constant entry external dcl 72 home_dir 000077 constant entry external dcl 72 pd 000047 constant entry external dcl 24 process_dir 000056 constant entry external dcl 24 NAMES DECLARED BY CONTEXT OR IMPLICATION. maxlength builtin function ref 120 rtrim builtin function ref 124 124 STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 640 700 434 650 Length 1074 434 40 157 204 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME pd 200 external procedure is an external procedure. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME pd 000100 dirname pd 000152 rp pd 000154 argcount pd 000155 lng pd 000156 rl pd 000157 af_sw pd 000160 complain pd 000164 code pd 000165 whoami pd THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. alloc_char_temp call_ent_var_desc call_ext_out_desc call_ext_out return_mac shorten_stack ext_entry THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. active_fnc_err_ com_err_ cu_$af_return_arg get_default_wdir_ get_pdir_ hcs_$fs_search_get_wdir ioa_ requote_string_ user_info_$homedir THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. error_table_$no_wdir error_table_$not_act_fnc error_table_$too_many_args LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 24 000046 68 000063 69 000066 72 000067 75 000104 76 000107 79 000110 82 000125 83 000130 86 000131 87 000146 88 000152 89 000153 90 000157 92 000160 93 000162 94 000166 97 000167 98 000171 99 000214 102 000215 104 000220 107 000236 110 000253 114 000271 115 000303 116 000305 117 000322 120 000323 124 000333 127 000410 129 000430 ----------------------------------------------------------- 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