COMPILATION LISTING OF SEGMENT get_pathname Compiled by: Multics PL/I Compiler, Release 33a, of May 30, 1990 Compiled at: ACTC Technologies Inc. Compiled on: 09/04/90 1202.8 mdt Tue Options: optimize map 1 /****^ *********************************************************** 2* * * 3* * Copyright, (C) BULL HN Information Systems Inc., 1990 * 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 16 /****^ HISTORY COMMENTS: 17* 1) change(90-01-25,Vu), approve(90-01-25,MCR8153), audit(90-06-21,Huen), 18* install(90-09-04,MR12.4-1032): 19* The active function for get_pathname will now return quoted string. 20* END HISTORY COMMENTS */ 21 22 23 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 24 /* */ 25 /* N__a_m_e: get_pathname, gpn */ 26 /* */ 27 /* This active function, given a reference name or an octal segment number, returns */ 28 /* the full path name of the segment identified by this reference name or segment number. */ 29 /* */ 30 /* U__s_a_g_e */ 31 /* */ 32 /* [get_pathname ref_name] */ 33 /* */ 34 /* or */ 35 /* */ 36 /* [get_pathname octal_segment_no] */ 37 /* */ 38 /* To input a reference name which looks like an octal segment number: */ 39 /* */ 40 /* [get_pathname -name octal_reference_name] */ 41 /* */ 42 /* or */ 43 /* */ 44 /* [get_pathname -nm octal_reference_name] */ 45 /* */ 46 /* S__t_a_t_u_s */ 47 /* */ 48 /* 1) Created: Feb, 1970 by V. L. Voydock. */ 49 /* 2) Modified: Apr, 1973 by G. C. Dixon; accept octal segment numbers, add -name arg. */ 50 /* 3) Modified: 12/15/75 by Steve Herbst to be called as a command. */ 51 /* */ 52 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 53 54 /* */ 55 56 /* * * * * * * * * * * * * * * * * ** * * * * * * * * * * * * * * * * * * */ 57 58 59 get_pathname: gpn: procedure; 60 61 dcl /* automatic variables */ 62 Larg fixed bin, /* length of an input argument. */ 63 Ldirectory fixed bin, /* length of directory part of path name. */ 64 Lentry fixed bin, /* length of entry part of path name. */ 65 Lret fixed bin, /* maximum length of return argument. */ 66 Nargs fixed bin, /* number of input arguments. */ 67 Parg ptr, /* ptr to input argument. */ 68 Pret ptr, /* ptr to return argument. */ 69 Pseg ptr, /* ptr to segment whose path name to be returned */ 70 code fixed bin(35), /* status code. */ 71 command bit(1) aligned, /* ON if called as a command. */ 72 directory char(168) aligned, /* directory part of path name. */ 73 entry char(32) aligned, /* entry part of path name. */ 74 path char(168) aligned, /* path name. */ 75 segno fixed bin(35); /* octal segment number. */ 76 77 dcl /* based variables */ 78 arg char(Larg) based (Parg), 79 /* an input argument. */ 80 ret char(Lret) varying based (Pret); 81 /* our return argument. */ 82 83 dcl /* builtin functions */ 84 (addr, baseptr, index, mod, rtrim, substr) builtin; 85 86 87 dcl gripe entry variable options(variable); /* either active_fnc_err_ or com_err_ */ 88 89 dcl /* entries */ 90 active_fnc_err_ entry options (variable), 91 com_err_ entry options(variable), 92 cu_$af_return_arg entry (fixed bin, ptr, fixed bin, fixed bin(35)), 93 cu_$arg_count entry (fixed bin, fixed bin(35)), 94 cu_$arg_ptr entry (fixed bin, ptr, fixed bin, fixed bin(35)), 95 cv_oct_check_ entry (char(*), fixed bin(35)) returns (fixed bin(35)), 96 hcs_$fs_get_path_name entry (ptr, char(*) aligned, fixed bin, char(*) aligned, fixed bin(35)), 97 hcs_$fs_get_seg_ptr entry (char(*), ptr, fixed bin(35)), 98 ioa_ entry options(variable), 99 requote_string_ entry (char (*)) returns (char (*)); 100 101 dcl /* static variables */ 102 (error_table_$badopt, 103 error_table_$bigarg, 104 error_table_$invalidsegno, 105 error_table_$not_act_fnc, 106 error_table_$seg_unknown, 107 error_table_$smallarg, 108 error_table_$wrong_no_of_args) 109 fixed bin(35) ext static, 110 proc char(12) aligned int static init ("get_pathname"); 111 /* */ 112 113 /* * * * * * * * * * * * * * * * * ** * * * * * * * * * * * * * * * * * * */ 114 115 116 call cu_$af_return_arg (Nargs, Pret, Lret, code); /* get input arg count; get ptr/lng of return arg */ 117 if code=error_table_$not_act_fnc then do; /* called as a command */ 118 command = "1"b; 119 gripe = com_err_; 120 call cu_$arg_count(Nargs,code); 121 code = 0; 122 end; 123 else do; 124 command = "0"b; 125 gripe = active_fnc_err_; 126 end; 127 if code ^= 0 then 128 go to error; 129 130 if Nargs = 0 then /* make sure we were passed 1 or 2 input args */ 131 go to wnoa; 132 if Nargs > 2 then 133 go to wnoa; 134 135 if Nargs = 2 then do; /* if 2 input args, then first must be a control */ 136 call cu_$arg_ptr (1, Parg, Larg, code); /* arg, either "-name" or "-nm". */ 137 if arg ^= "-nm" then /* otherwise, an error has occurred. */ 138 if arg ^= "-name" then 139 go to badopt; 140 call cu_$arg_ptr (2, Parg, Larg, code); /* get second argument, and treat it as a */ 141 go to get_ptr; /* reference name, even tho it may look like a */ 142 end; /* segment number. */ 143 144 /* Only 1 argument, a reference name or segment */ 145 call cu_$arg_ptr (1, Parg, Larg, code); /* number. Access this argument. */ 146 if Larg = 0 then /* make sure its not a null string. */ 147 go to smallarg; 148 segno = cv_oct_check_ (arg, code); /* see if it is an octal segment number. */ 149 if code = 0 then do; /* if so, convert segment number to a ptr, and */ 150 Pseg = baseptr (segno); /* assume this points to desired segment. */ 151 go to get_path; 152 end; 153 else do; /* arg not an octal number, so assume it is a */ 154 get_ptr: if Larg > 32 then /* reference name, and convert it to a segment ptr*/ 155 go to bigarg; 156 call hcs_$fs_get_seg_ptr (arg, Pseg, code); 157 if code ^= 0 then 158 go to seg_unknown; 159 end; 160 161 get_path: call hcs_$fs_get_path_name (Pseg, directory, Ldirectory, entry, code); 162 if code ^= 0 then /* Convert segment ptr to a path name. If a */ 163 go to invalidsegno; /* reference name was supplied as the argument, */ 164 Lentry = mod (index (entry, " ")+32, 33); /* then this conversion must work. Therefore, */ 165 /* any errors indicate that a segno was supplied */ 166 /* and that there is no segment with that number. */ 167 path = substr(directory,1,Ldirectory) || ">" || substr(entry,1,Lentry); 168 169 if command then call ioa_("^a",path); 170 else ret = requote_string_ (rtrim (path)); 171 return; /* return the path name as the value of the */ 172 /* active function. */ 173 174 /* * * * * * * * * * * * * * * * * ** * * * * * * * * * * * * * * * * * * */ 175 176 177 wnoa: code = error_table_$wrong_no_of_args; /* report errors to user. */ 178 error: Parg = addr (entry); 179 Larg = 0; 180 printerr: call gripe (code, (proc), 181 " ^a^/^a:^-[^a ref_name]^/or:^3-[^a octal_segment_no]^/or:^3-[^a -name octal_ref_name]", 182 arg, "Calling sequence is", (proc), (proc), (proc)); 183 return; 184 185 badopt: code = error_table_$badopt; 186 go to printerr; 187 188 smallarg: code = error_table_$smallarg; 189 go to argerr; 190 191 bigarg: code = error_table_$bigarg; 192 argerr: call gripe (code, (proc), " ""^a"" cannot be a reference name.", arg); 193 return; 194 195 seg_unknown: 196 call gripe (error_table_$seg_unknown, (proc), " ^a is not a known reference name.", arg); 197 return; 198 199 invalidsegno: 200 call gripe (error_table_$invalidsegno, (proc), " ^o", segno); 201 return; 202 203 end get_pathname; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 09/04/90 1202.8 get_pathname.pl1 >spec>install>1032>get_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. Larg 000100 automatic fixed bin(17,0) dcl 61 set ref 136* 137 137 140* 145* 146 148 148 154 156 156 179* 180 180 192 192 195 195 Ldirectory 000101 automatic fixed bin(17,0) dcl 61 set ref 161* 167 Lentry 000102 automatic fixed bin(17,0) dcl 61 set ref 164* 167 Lret 000103 automatic fixed bin(17,0) dcl 61 set ref 116* 170 Nargs 000104 automatic fixed bin(17,0) dcl 61 set ref 116* 120* 130 132 135 Parg 000106 automatic pointer dcl 61 set ref 136* 137 137 140* 145* 148 156 178* 180 192 195 Pret 000110 automatic pointer dcl 61 set ref 116* 170 Pseg 000112 automatic pointer dcl 61 set ref 150* 156* 161* active_fnc_err_ 000010 constant entry external dcl 89 ref 125 addr builtin function dcl 83 ref 178 arg based char packed unaligned dcl 77 set ref 137 137 148* 156* 180* 192* 195* baseptr builtin function dcl 83 ref 150 code 000114 automatic fixed bin(35,0) dcl 61 set ref 116* 117 120* 121* 127 136* 140* 145* 148* 149 156* 157 161* 162 177* 180* 185* 188* 191* 192* com_err_ 000012 constant entry external dcl 89 ref 119 command 000115 automatic bit(1) dcl 61 set ref 118* 124* 169 cu_$af_return_arg 000014 constant entry external dcl 89 ref 116 cu_$arg_count 000016 constant entry external dcl 89 ref 120 cu_$arg_ptr 000020 constant entry external dcl 89 ref 136 140 145 cv_oct_check_ 000022 constant entry external dcl 89 ref 148 directory 000116 automatic char(168) dcl 61 set ref 161* 167 entry 000170 automatic char(32) dcl 61 set ref 161* 164 167 178 error_table_$badopt 000034 external static fixed bin(35,0) dcl 101 ref 185 error_table_$bigarg 000036 external static fixed bin(35,0) dcl 101 ref 191 error_table_$invalidsegno 000040 external static fixed bin(35,0) dcl 101 set ref 199* error_table_$not_act_fnc 000042 external static fixed bin(35,0) dcl 101 ref 117 error_table_$seg_unknown 000044 external static fixed bin(35,0) dcl 101 set ref 195* error_table_$smallarg 000046 external static fixed bin(35,0) dcl 101 ref 188 error_table_$wrong_no_of_args 000050 external static fixed bin(35,0) dcl 101 ref 177 gripe 000254 automatic entry variable dcl 87 set ref 119* 125* 180 192 195 199 hcs_$fs_get_path_name 000024 constant entry external dcl 89 ref 161 hcs_$fs_get_seg_ptr 000026 constant entry external dcl 89 ref 156 index builtin function dcl 83 ref 164 ioa_ 000030 constant entry external dcl 89 ref 169 mod builtin function dcl 83 ref 164 path 000200 automatic char(168) dcl 61 set ref 167* 169* 170 170 proc 000000 constant char(12) initial dcl 101 ref 180 180 180 180 192 195 199 requote_string_ 000032 constant entry external dcl 89 ref 170 ret based varying char dcl 77 set ref 170* rtrim builtin function dcl 83 ref 170 170 segno 000252 automatic fixed bin(35,0) dcl 61 set ref 148* 150 199* substr builtin function dcl 83 ref 167 167 NAMES DECLARED BY EXPLICIT CONTEXT. argerr 000662 constant label dcl 192 ref 189 badopt 000647 constant label dcl 185 ref 137 bigarg 000657 constant label dcl 191 ref 154 error 000546 constant label dcl 178 set ref 127 get_path 000347 constant label dcl 161 ref 151 get_pathname 000113 constant entry external dcl 59 get_ptr 000317 constant label dcl 154 ref 141 gpn 000104 constant entry external dcl 59 invalidsegno 000761 constant label dcl 199 ref 162 printerr 000551 constant label dcl 180 ref 186 seg_unknown 000721 constant label dcl 195 ref 157 smallarg 000653 constant label dcl 188 ref 146 wnoa 000543 constant label dcl 177 ref 130 132 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 1234 1306 1020 1244 Length 1500 1020 52 155 214 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME gpn 278 external procedure is an external procedure. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME gpn 000100 Larg gpn 000101 Ldirectory gpn 000102 Lentry gpn 000103 Lret gpn 000104 Nargs gpn 000106 Parg gpn 000110 Pret gpn 000112 Pseg gpn 000114 code gpn 000115 command gpn 000116 directory gpn 000170 entry gpn 000200 path gpn 000252 segno gpn 000254 gripe gpn THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. alloc_char_temp cat_realloc_chars call_ent_var_desc call_ext_out_desc call_ext_out return_mac mdfx1 shorten_stack ext_entry THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. active_fnc_err_ com_err_ cu_$af_return_arg cu_$arg_count cu_$arg_ptr cv_oct_check_ hcs_$fs_get_path_name hcs_$fs_get_seg_ptr ioa_ requote_string_ THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. error_table_$badopt error_table_$bigarg error_table_$invalidsegno error_table_$not_act_fnc error_table_$seg_unknown error_table_$smallarg error_table_$wrong_no_of_args LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 59 000103 116 000120 117 000134 118 000140 119 000142 120 000146 121 000156 122 000157 124 000160 125 000161 127 000165 130 000167 132 000171 135 000173 136 000174 137 000213 140 000225 141 000244 145 000245 146 000264 148 000266 149 000310 150 000312 151 000316 154 000317 156 000322 157 000345 161 000347 162 000400 164 000402 167 000415 169 000444 170 000467 171 000541 177 000543 178 000546 179 000550 180 000551 183 000646 185 000647 186 000652 188 000653 189 000656 191 000657 192 000662 193 000720 195 000721 197 000760 199 000761 201 001013 ----------------------------------------------------------- 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