COMPILATION LISTING OF SEGMENT login_args Compiled by: Multics PL/I Compiler, Release 27d, of October 11, 1982 Compiled at: Honeywell LISD Phoenix, System M Compiled on: 11/04/82 1833.1 mst Thu 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 /* format: style4 */ 12 13 /* Written 81-12-03 E. N. Kittlitz. */ 14 /* Modified 82-06-04 E. N. Kittlitz. make [login_args -ct] return "0", not "". */ 15 16 login_arg: 17 login_args: 18 proc; 19 20 21 /* command/active-function to return login arguments, specified either 22* to enter_abs_request (absentee processes) or to the login request (daemon 23* or interactive processes) using the -arguments control argument. 24* 25* Syntax: login_arg {argument_number} {-control_args} 26* 27* where: 28* 29* argument_number 30* may be a postive non-zero decimal number, 31* the number of the argument whose value is required. 32* 33* CONTROL ARGUMENTS: 34* 35* -count, -ct 36* count of login arguments supplied to login request or enter_abs_request. 37* 38* -from argument_number, -fm argument_number 39* number of first argument to return. All succeeding defined arguments 40* are also returned. (one per line if this is a command invocation, 41* or separated by a space for active function use.) 42* 43* -no_requote 44* prevents the requoting of each argument. 45* 46* -quote 47* causes each quote in the argument to be doubled. The same as -requote 48* except that the string is not enclosed in quotation marks. 49* 50* -requote 51* causes each argument to be requoted. This is the default. 52**/ 53 54 dcl ME char (10) init ("login_args") static options (constant); 55 dcl NO_REQUOTE fixed bin init (0) static options (constant); 56 57 dcl FORMAT char (14) int static options (constant) init ("^[^d) ^;^s^]^a"); 58 dcl QUOTE fixed bin init (1) static options (constant); 59 dcl REQUOTE fixed bin init (2) static options (constant); 60 61 dcl argn fixed bin; /* current command argument number */ 62 dcl argp ptr; /* ptr to command argument */ 63 dcl argument_number fixed bin (35); /* which argument the user wants */ 64 dcl count_sw bit (1) aligned; /* true if -count specified */ 65 dcl from_sw bit (1) aligned; /* true if -from specified */ 66 dcl i fixed bin; 67 dcl quote_option fixed bin; 68 69 dcl (null, substr, ltrim, char) builtin; 70 71 dcl error_proc entry options (variable) variable; /* procedure called to indicate an error */ 72 dcl arg_proc entry (fixed bin, ptr, fixed bin (21), fixed bin (35)) variable; 73 /* procedure called to obtain a command argument */ 74 dcl argc fixed bin; /* number of command arguments */ 75 dcl arg char (argl) based (argp); /* command argument */ 76 dcl argl fixed bin (21); /* length of command argument */ 77 dcl lg_argp ptr; /* ptr to login argument */ 78 dcl lg_argc fixed bin; /* number of login arguments */ 79 dcl lg_arg char (lg_argl) based (lg_argp); /* login argument */ 80 dcl lg_argl fixed bin (21); /* length of login argument */ 81 dcl af_sw bit (1) aligned; /* "1"b if invoked as active function */ 82 dcl af_argp ptr; /* pointer to af return argument */ 83 dcl af_argl fixed bin (21); /* max length of af return argument */ 84 dcl af_arg char (af_argl) based (af_argp) varying; /* af return argument */ 85 dcl code fixed bin (35); 86 87 dcl cu_$arg_ptr entry (fixed bin, ptr, fixed bin, fixed bin (35)); 88 dcl cu_$af_arg_ptr entry (fixed bin, ptr, fixed bin, fixed bin (35)); 89 dcl cu_$af_return_arg entry (fixed bin, ptr, fixed bin (21), fixed bin (35)); 90 dcl active_fnc_err_ entry options (variable); 91 dcl com_err_ entry options (variable); 92 dcl ioa_ entry options (variable); 93 dcl requote_string_ entry (char (*)) returns (char (*)); 94 dcl requote_string_$quote_string entry (char (*)) returns (char (*)); 95 dcl user_info_$login_arg_count entry (fixed bin, fixed bin (21), fixed bin (21)); 96 dcl user_info_$login_arg_ptr entry (fixed bin, ptr, fixed bin (21), fixed bin (35)); 97 dcl cv_dec_check_ entry (char (*), fixed bin (35)) returns (fixed bin (35)); 98 99 dcl error_table_$not_act_fnc fixed bin (35) ext static; 100 dcl error_table_$badopt fixed bin (35) ext static; 101 dcl error_table_$inconsistent fixed bin (35) ext static; 102 103 104 call cu_$af_return_arg (argc, af_argp, af_argl, code); 105 if code = 0 then do; 106 arg_proc = cu_$af_arg_ptr; 107 error_proc = active_fnc_err_; 108 af_sw = "1"b; 109 af_arg = ""; /* initialize output string */ 110 end; 111 else do; 112 error_proc = com_err_; 113 arg_proc = cu_$arg_ptr; 114 af_sw = "0"b; 115 af_argp = null; 116 af_argl = 0; 117 if code ^= error_table_$not_act_fnc then go to no_info_error; 118 end; 119 120 argument_number = -1; /* defaults for any case */ 121 from_sw = "0"b; /* not explicit or implicit -from */ 122 quote_option = REQUOTE; /* default quoting */ 123 count_sw = "0"b; /* -count not specified */ 124 125 process_arguments: 126 do argn = 1 to argc; /* one by one */ 127 call arg_proc (argn, argp, argl, code); 128 if code ^= 0 then go to no_info_error; /* couldn't get that argument */ 129 if arg = "-count" | arg = "-ct" then do; 130 if argc ^= 1 then do; 131 call error_proc (error_table_$inconsistent, ME, 132 "-count may not be specified with any other control argument."); 133 return; 134 end; 135 count_sw = "1"b; 136 end; 137 else if arg = "-from" | arg = "-fm" then do; 138 from_sw = "1"b; 139 argn = argn + 1; 140 call arg_proc (argn, argp, argl, code); 141 if code ^= 0 then do; 142 call error_proc (code, ME, "argument_number expected following -from."); 143 return; 144 end; 145 try_for_argument_number: 146 if argument_number > 0 then do; 147 call error_proc (0, ME, "argument_number specified more than once."); 148 return; 149 end; 150 argument_number = cv_dec_check_ (arg, code); 151 if code ^= 0 | argument_number < 1 then do; 152 call error_proc (0, ME, "^a must be an integer number greater than zero.", arg); 153 return; 154 end; 155 end; 156 else if arg = "-no_requote" then quote_option = NO_REQUOTE; 157 else if arg = "-quote" then quote_option = QUOTE; 158 else if arg = "-requote" then quote_option = REQUOTE; 159 else if substr (arg, 1, 1) = "-" then do; 160 call error_proc (error_table_$badopt, ME, "^a", arg); 161 return; 162 end; 163 else go to try_for_argument_number; 164 end process_arguments; 165 166 call user_info_$login_arg_count (lg_argc, (0), (0)); /* first, get number of login arguments */ 167 168 if lg_argc = 0 then do; 169 if ^af_sw then 170 call error_proc (0, ME, "There are no login arguments."); 171 else if count_sw then 172 af_arg = "0"; /* -count: return a number */ 173 return; 174 end; 175 176 if count_sw then do; /* only want the count? */ 177 if af_sw then 178 af_arg = ltrim (char (lg_argc)); 179 else call ioa_ (ltrim (char (lg_argc))); 180 return; 181 end; 182 183 if argument_number < 0 then do; 184 argument_number = 1; /* use default if we must */ 185 from_sw = "1"b; 186 end; 187 188 if argument_number > lg_argc then do; /* we don't go as high as user asked */ 189 if ^af_sw then 190 call error_proc (0, ME, 191 "argument_number ^d exceeds the number of login arguments (^d).", 192 argument_number, lg_argc); 193 return; 194 end; 195 196 make_result: 197 do i = argument_number to lg_argc while (from_sw | i = argument_number); 198 call user_info_$login_arg_ptr (i, lg_argp, lg_argl, code); 199 if code ^= 0 then do; 200 call error_proc (code, ME, "While obtaining login argument ^d.", i); 201 return; 202 end; 203 if af_sw then 204 if i > argument_number then af_arg = af_arg || " "; 205 if quote_option = REQUOTE then 206 if af_sw then 207 af_arg = af_arg || requote_string_ (lg_arg); 208 else call ioa_ (FORMAT, from_sw, i, requote_string_ (lg_arg)); 209 else if quote_option = QUOTE then 210 if af_sw then 211 af_arg = af_arg || requote_string_$quote_string (lg_arg); 212 else call ioa_ (FORMAT, from_sw, i, requote_string_$quote_string (lg_arg)); 213 else if af_sw then 214 af_arg = af_arg || lg_arg; 215 else call ioa_ (FORMAT, from_sw, i, lg_arg); 216 end make_result; 217 218 return; 219 220 221 no_info_error: 222 call error_proc (code, ME); 223 return; 224 225 end login_args; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/04/82 1610.0 login_args.pl1 >dumps>old>recomp>login_args.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. FORMAT 000000 constant char(14) initial unaligned dcl 57 set ref 208* 212* 215* ME 000004 constant char(10) initial unaligned dcl 54 set ref 131* 142* 147* 152* 160* 169* 189* 200* 221* NO_REQUOTE constant fixed bin(17,0) initial dcl 55 ref 156 QUOTE constant fixed bin(17,0) initial dcl 58 ref 157 209 REQUOTE constant fixed bin(17,0) initial dcl 59 ref 122 158 205 active_fnc_err_ 000016 constant entry external dcl 90 ref 107 af_arg based varying char dcl 84 set ref 109* 171* 177* 203* 203 205* 205 209* 209 213* 213 af_argl 000134 automatic fixed bin(21,0) dcl 83 set ref 104* 109 116* 171 177 203 205 209 213 af_argp 000132 automatic pointer dcl 82 set ref 104* 109 115* 171 177 203 203 205 205 209 209 213 213 af_sw 000130 automatic bit(1) dcl 81 set ref 108* 114* 169 177 189 203 205 209 213 arg based char unaligned dcl 75 set ref 129 129 137 137 150* 152* 156 157 158 159 160* arg_proc 000116 automatic entry variable dcl 72 set ref 106* 113* 127 140 argc 000122 automatic fixed bin(17,0) dcl 74 set ref 104* 125 130 argl 000123 automatic fixed bin(21,0) dcl 76 set ref 127* 129 129 137 137 140* 150 150 152 152 156 157 158 159 160 160 argn 000100 automatic fixed bin(17,0) dcl 61 set ref 125* 127* 139* 139 140* argp 000102 automatic pointer dcl 62 set ref 127* 129 129 137 137 140* 150 152 156 157 158 159 160 argument_number 000104 automatic fixed bin(35,0) dcl 63 set ref 120* 145 150* 151 183 184* 188 189* 196 196 203 char builtin function dcl 69 ref 177 179 179 code 000135 automatic fixed bin(35,0) dcl 85 set ref 104* 105 117 127* 128 140* 141 142* 150* 151 198* 199 200* 221* com_err_ 000020 constant entry external dcl 91 ref 112 count_sw 000105 automatic bit(1) dcl 64 set ref 123* 135* 171 176 cu_$af_arg_ptr 000012 constant entry external dcl 88 ref 106 cu_$af_return_arg 000014 constant entry external dcl 89 ref 104 cu_$arg_ptr 000010 constant entry external dcl 87 ref 113 cv_dec_check_ 000034 constant entry external dcl 97 ref 150 error_proc 000112 automatic entry variable dcl 71 set ref 107* 112* 131 142 147 152 160 169 189 200 221 error_table_$badopt 000040 external static fixed bin(35,0) dcl 100 set ref 160* error_table_$inconsistent 000042 external static fixed bin(35,0) dcl 101 set ref 131* error_table_$not_act_fnc 000036 external static fixed bin(35,0) dcl 99 ref 117 from_sw 000106 automatic bit(1) dcl 65 set ref 121* 138* 185* 196 208* 212* 215* i 000107 automatic fixed bin(17,0) dcl 66 set ref 196* 196* 198* 200* 203 208* 212* 215* ioa_ 000022 constant entry external dcl 92 ref 179 208 212 215 lg_arg based char unaligned dcl 79 set ref 205* 208* 209* 212* 213 215* lg_argc 000126 automatic fixed bin(17,0) dcl 78 set ref 166* 168 177 179 179 188 189* 196 lg_argl 000127 automatic fixed bin(21,0) dcl 80 set ref 198* 205 205 208 208 209 209 212 212 213 215 215 lg_argp 000124 automatic pointer dcl 77 set ref 198* 205 208 209 212 213 215 ltrim builtin function dcl 69 ref 177 179 179 null builtin function dcl 69 ref 115 quote_option 000110 automatic fixed bin(17,0) dcl 67 set ref 122* 156* 157* 158* 205 209 requote_string_ 000024 constant entry external dcl 93 ref 205 208 requote_string_$quote_string 000026 constant entry external dcl 94 ref 209 212 substr builtin function dcl 69 ref 159 user_info_$login_arg_count 000030 constant entry external dcl 95 ref 166 user_info_$login_arg_ptr 000032 constant entry external dcl 96 ref 198 NAMES DECLARED BY EXPLICIT CONTEXT. login_arg 000177 constant entry external dcl 16 login_args 000170 constant entry external dcl 16 make_result 001067 constant label dcl 196 no_info_error 001476 constant label dcl 221 ref 117 128 process_arguments 000263 constant label dcl 125 try_for_argument_number 000432 constant label dcl 145 ref 159 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 1716 1762 1523 1726 Length 2152 1523 44 154 173 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME login_args 198 external procedure is an external procedure. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME login_args 000100 argn login_args 000102 argp login_args 000104 argument_number login_args 000105 count_sw login_args 000106 from_sw login_args 000107 i login_args 000110 quote_option login_args 000112 error_proc login_args 000116 arg_proc login_args 000122 argc login_args 000123 argl login_args 000124 lg_argp login_args 000126 lg_argc login_args 000127 lg_argl login_args 000130 af_sw login_args 000132 af_argp login_args 000134 af_argl login_args 000135 code login_args THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. alloc_cs call_var_desc call_var call_ext_out_desc call_ext_out return shorten_stack ext_entry THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. active_fnc_err_ com_err_ cu_$af_arg_ptr cu_$af_return_arg cu_$arg_ptr cv_dec_check_ ioa_ requote_string_ requote_string_$quote_string user_info_$login_arg_count user_info_$login_arg_ptr THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. error_table_$badopt error_table_$inconsistent error_table_$not_act_fnc LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 16 000167 104 000204 105 000220 106 000222 107 000227 108 000232 109 000234 110 000235 112 000236 113 000243 114 000246 115 000247 116 000251 117 000252 120 000255 121 000257 122 000260 123 000262 125 000263 127 000272 128 000306 129 000310 130 000322 131 000325 133 000351 135 000352 136 000354 137 000355 138 000365 139 000367 140 000370 141 000404 142 000406 143 000431 145 000432 147 000434 148 000460 150 000461 151 000504 152 000511 153 000544 155 000545 156 000546 157 000555 158 000564 159 000573 160 000577 161 000631 164 000632 166 000634 168 000651 169 000653 171 000702 173 000715 176 000716 177 000720 179 000754 180 001016 183 001020 184 001022 185 001024 188 001026 189 001030 193 001066 196 001067 198 001103 199 001120 200 001122 201 001151 203 001152 205 001167 208 001236 209 001305 212 001354 213 001423 215 001443 216 001473 218 001475 221 001476 223 001512 ----------------------------------------------------------- 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