COMPILATION LISTING OF SEGMENT encode_access_class Compiled by: Multics PL/I Compiler, Release 28d, of October 4, 1983 Compiled at: Honeywell Multics Op. - System M Compiled on: 02/13/85 0850.9 mst Wed Options: optimize map 1 /* *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Information Systems Inc., 1985 * 4* * * 5* *********************************************************** */ 6 7 /* DESCRIPTION: 8* 9* encode_access_class & decode_access_class 10* 11* Encode_access_class is an interface to the subroutine 12* convert_access_class_$encode. It either returns or prints an encoded 13* version of an access class. At the time of this writing, its 14* main use is for an administrator setting up a data management 15* to run at a particular AIM classification or someone looking in 16* the pool_manager_ directories. 17* 18* USAGE: eac STR {-ctl_arg} 19* or [eac STR {-ctl_arg}] 20* where STR is the access class to be encoded and the allowed control 21* argument is -access_class (or -acc) which takes a STR value. Only 22* STR or -acc may be used, not both, and not more than once. 23* 24* Decode_access_class takes an encoded access class string and 25* returns or prints the class in a readable form. It calls 26* convert_access_class_$decode to get the binary form of the class and 27* then uses convert_access_class_$to_string to get the string to return 28* to the user. 29* 30* USAGE: dac STR 31* or [dac STR] 32**/ 33 34 /* HISTORY: 35* 36*Written by Lee A. Newcomb, 01/18/85. 37*Modified: 38*01/23/85 by Lee A. Newcomb: Fixed to use long names of commands in error 39* messages and correct to call ERROR_RETURN instead of com_err_ in 40* when no arg is present. 41**/ 42 43 /* format: style2,ll79,ind3,^indprocbody,ifthendo,ifthen,^indnoniterdo,^inddcls,dclind5,idind35,linecom */ 44 encode_access_class: 45 eac: 46 proc () options (variable); 47 48 /* START OF DECLARATIONS */ 49 /* Automatic */ 50 dcl ( 51 access_class bit (72) aligned init (""b), 52 access_class_string char (256) init (""), 53 arg_idx fixed bin init (0), 54 arg_len fixed bin (21) init (0), 55 arg_list_ptr ptr init (null), 56 arg_ptr ptr init (null), 57 code fixed bin (35) init (0), 58 encoded_access_class char (15) init (""), 59 is_active_function bit (1) aligned init ("0"b), 60 myname char (19) init ("*code_access_class"), 61 number_of_args fixed bin init (-1), 62 return_arg_len fixed bin (21) init (0), 63 return_arg_ptr ptr init (null), 64 sci_ptr ptr init (null) 65 ) automatic; 66 67 /* Based */ 68 dcl arg char (arg_len) based (arg_ptr), 69 return_arg char (return_arg_len) varying 70 based (return_arg_ptr); 71 72 /* Builtin */ 73 dcl (null, rtrim) builtin; 74 75 /* Condition */ 76 dcl cleanup condition; 77 78 /* Constant */ 79 dcl ( 80 ACC_CTL_ARG_LONG char (13) init ("-access_class"), 81 ACC_CTL_ARG_SHORT char (4) init ("-acc"), 82 DAC_NAME char (19) init ("decode_access_class"), 83 DAC_USAGE_MSG char (23) 84 init ("decode_access_class STR"), 85 EAC_NAME char (19) init ("encode_access_class"), 86 EAC_USAGE_MSG char (34) 87 init ( 88 "encode_access_class STR {-ctl_arg}"), 89 OPTIONAL_IOA_STRING_NOT_USED bit (1) aligned init ("0"b), 90 OPTIONAL_IOA_STRING_USED bit (1) aligned init ("1"b), 91 SSU_INVOCATION_ERR_MSG char (49) 92 init ( 93 "Cannot establish standalone subsystem invocation." 94 ) 95 ) internal static options (constant); 96 97 /* Entry */ 98 dcl ( 99 com_err_ entry options (variable), 100 convert_access_class_$decode entry (bit (72) aligned, char (*)), 101 convert_access_class_$encode entry (bit (72) aligned, char (*)), 102 convert_access_class_$from_string entry (bit (72) aligned, char (*), 103 fixed bin (35)), 104 convert_access_class_$to_string entry (bit (72) aligned, char (*), 105 fixed bin (35)), 106 cu_$arg_list_ptr entry (ptr), 107 get_authorization_ entry () returns (bit (72) aligned), 108 ioa_ entry () options (variable), 109 requote_string_ entry (char (*)) returns (char (*)), 110 ssu_$abort_line entry () options (variable), 111 ssu_$arg_ptr entry (ptr, fixed bin, ptr, 112 fixed bin (21)), 113 ssu_$destroy_invocation entry (ptr), 114 ssu_$return_arg entry (ptr, fixed bin, bit (1) aligned, 115 ptr, fixed bin (21)), 116 ssu_$standalone_invocation entry (ptr, char (*), char (*), ptr, 117 entry, fixed bin (35)) 118 ) external; 119 120 /* External */ 121 122 dcl ( 123 error_table_$noarg, 124 error_table_$too_many_args 125 ) fixed bin (35) external; 126 127 /* END OF DECLARATIONS */ 128 129 /* encode_access_class: repeat for reader */ 130 /* eac: */ 131 /* proc options (variable); */ 132 133 SETUP_EAC_INVOCATION: 134 do; 135 myname = EAC_NAME; 136 on cleanup call FINISH (); 137 138 call cu_$arg_list_ptr (arg_list_ptr); 139 call ssu_$standalone_invocation (sci_ptr, myname, "", arg_list_ptr, 140 ABORT_ENTRY, code); 141 if code ^= 0 then /* should be very rare */ 142 call ERROR_RETURN_FROM_SSU_SETUP (code, myname); 143 end SETUP_EAC_INVOCATION; 144 145 call ssu_$return_arg (sci_ptr, number_of_args, is_active_function, 146 return_arg_ptr, return_arg_len); 147 148 GET_ACCESS_CLASS_TO_ENCODE: 149 do; 150 if number_of_args = 0 then 151 access_class = get_authorization_ (); /* process' access class */ 152 else 153 INTERPRET_ARGS: 154 do; 155 arg_idx = 1; 156 call ssu_$arg_ptr (sci_ptr, arg_idx, arg_ptr, arg_len); 157 if arg = ACC_CTL_ARG_LONG | arg = ACC_CTL_ARG_SHORT then 158 GET_REAL_ACCESS_CLASS_ARG: 159 do; 160 arg_idx = arg_idx + 1; 161 if arg_idx > number_of_args then 162 call ERROR_RETURN (error_table_$noarg, EAC_USAGE_MSG, 163 OPTIONAL_IOA_STRING_NOT_USED, ""); 164 if arg_idx < number_of_args then 165 call ERROR_RETURN (error_table_$too_many_args, EAC_USAGE_MSG, 166 OPTIONAL_IOA_STRING_NOT_USED, ""); 167 call ssu_$arg_ptr (sci_ptr, arg_idx, arg_ptr, arg_len); 168 end GET_REAL_ACCESS_CLASS_ARG; 169 call convert_access_class_$from_string (access_class, arg, code); 170 if code ^= 0 then 171 call ERROR_RETURN (code, "Access class string provided: ^a", 172 OPTIONAL_IOA_STRING_USED, arg); 173 174 end INTERPRET_ARGS; 175 end GET_ACCESS_CLASS_TO_ENCODE; 176 177 call convert_access_class_$encode (access_class, encoded_access_class); 178 179 GET_EAC_RESULT_TO_USER: 180 if is_active_function then 181 return_arg = encoded_access_class; 182 else call ioa_ ("^a", encoded_access_class); 183 184 call RETURN (); 185 186 /* end encode_access_class; */ 187 188 decode_access_class: 189 dac: 190 entry options (variable); 191 192 SETUP_DAC_INVOCATION: 193 do; 194 myname = DAC_NAME; 195 on cleanup call FINISH (); 196 197 call cu_$arg_list_ptr (arg_list_ptr); 198 call ssu_$standalone_invocation (sci_ptr, myname, "", arg_list_ptr, 199 ABORT_ENTRY, code); 200 if code ^= 0 then /* should be very rare */ 201 call ERROR_RETURN_FROM_SSU_SETUP (code, myname); 202 end SETUP_DAC_INVOCATION; 203 204 GET_ENCODED_ACCESS_CLASS_STRING: 205 do; 206 call ssu_$return_arg (sci_ptr, number_of_args, is_active_function, 207 return_arg_ptr, return_arg_len); 208 209 if number_of_args = 0 then 210 call ERROR_RETURN (error_table_$noarg, DAC_USAGE_MSG, 211 OPTIONAL_IOA_STRING_NOT_USED, ""); 212 if number_of_args > 1 then 213 call ERROR_RETURN (error_table_$too_many_args, DAC_USAGE_MSG, 214 OPTIONAL_IOA_STRING_NOT_USED, ""); 215 call ssu_$arg_ptr (sci_ptr, 1 /* only one allowed */, arg_ptr, arg_len); 216 end GET_ENCODED_ACCESS_CLASS_STRING; 217 218 GET_DAC_RESULT: 219 do; 220 call convert_access_class_$decode (access_class, arg); 221 call convert_access_class_$to_string (access_class, access_class_string, 222 code); 223 if code ^= 0 then 224 call ERROR_RETURN (code, 225 "Provided access class string to decode: ^a.", 226 OPTIONAL_IOA_STRING_USED, arg); 227 end GET_DAC_RESULT; 228 229 GET_DAC_RESULT_TO_USER: 230 if is_active_function then 231 return_arg = requote_string_ (rtrim (access_class_string)); 232 else call ioa_ ("^a", access_class_string); 233 234 call RETURN (); 235 236 /* end decode_access_class; */ 237 238 MAIN_RETURN: 239 return; 240 241 242 243 244 RETURN: 245 proc (); 246 call FINISH (); 247 go to MAIN_RETURN; 248 end RETURN; 249 250 251 252 253 254 ABORT_ENTRY: 255 procedure (); 256 257 call FINISH (); 258 go to MAIN_RETURN; 259 260 end ABORT_ENTRY; 261 262 263 264 FINISH: 265 procedure (); 266 267 if sci_ptr ^= null () then 268 call ssu_$destroy_invocation (sci_ptr); 269 270 return; 271 end FINISH; 272 273 274 275 276 ERROR_RETURN: 277 proc (er_p_code, er_p_ioa_string, er_p_ioa_optional_arg_given, 278 er_p_ioa_optional_arg); 279 280 dcl ( 281 er_p_code fixed bin (35), 282 er_p_ioa_string char (*), 283 er_p_ioa_optional_arg_given bit (1) aligned, 284 er_p_ioa_optional_arg char (*) 285 ) parameter; 286 287 288 if er_p_ioa_optional_arg_given then 289 call ssu_$abort_line (sci_ptr, er_p_code, er_p_ioa_string, 290 er_p_ioa_optional_arg); 291 else call ssu_$abort_line (sci_ptr, er_p_code, er_p_ioa_string); 292 293 /* ssu_$abort_line does not return */ 294 295 end ERROR_RETURN; 296 297 298 299 300 ERROR_RETURN_FROM_SSU_SETUP: 301 proc (erfss_p_code, erfss_p_myname); 302 303 dcl ( 304 erfss_p_code fixed bin (35), 305 erfss_p_myname char (*) 306 ) parameter; 307 308 call com_err_ (erfss_p_code, erfss_p_myname, SSU_INVOCATION_ERR_MSG); 309 310 go to MAIN_RETURN; /* FINISH skipped since nothing to destroy */ 311 312 end ERROR_RETURN_FROM_SSU_SETUP; 313 314 end encode_access_class; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 02/13/85 0846.6 encode_access_class.pl1 >special_ldd>online>7116>encode_access_class.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. ACC_CTL_ARG_LONG 000047 constant char(13) initial unaligned dcl 79 ref 157 ACC_CTL_ARG_SHORT 000047 constant char(4) initial unaligned dcl 79 ref 157 DAC_NAME 000042 constant char(19) initial unaligned dcl 79 ref 194 DAC_USAGE_MSG 000034 constant char(23) initial unaligned dcl 79 set ref 209* 212* EAC_NAME 000027 constant char(19) initial unaligned dcl 79 ref 135 EAC_USAGE_MSG 000016 constant char(34) initial unaligned dcl 79 set ref 161* 164* OPTIONAL_IOA_STRING_NOT_USED 000076 constant bit(1) initial dcl 79 set ref 161* 164* 209* 212* OPTIONAL_IOA_STRING_USED 000015 constant bit(1) initial dcl 79 set ref 170* 223* SSU_INVOCATION_ERR_MSG 000000 constant char(49) initial unaligned dcl 79 set ref 308* access_class 000100 automatic bit(72) initial dcl 50 set ref 50* 150* 169* 177* 220* 221* access_class_string 000102 automatic char(256) initial unaligned dcl 50 set ref 50* 221* 229 229 232* arg based char unaligned dcl 68 set ref 157 157 169* 170* 220* 223* arg_idx 000202 automatic fixed bin(17,0) initial dcl 50 set ref 50* 155* 156* 160* 160 161 164 167* arg_len 000203 automatic fixed bin(21,0) initial dcl 50 set ref 50* 156* 157 157 167* 169 169 170 170 215* 220 220 223 223 arg_list_ptr 000204 automatic pointer initial dcl 50 set ref 50* 138* 139* 197* 198* arg_ptr 000206 automatic pointer initial dcl 50 set ref 50* 156* 157 157 167* 169 170 215* 220 223 cleanup 000232 stack reference condition dcl 76 ref 136 195 code 000210 automatic fixed bin(35,0) initial dcl 50 set ref 50* 139* 141 141* 169* 170 170* 198* 200 200* 221* 223 223* com_err_ 000010 constant entry external dcl 98 ref 308 convert_access_class_$decode 000012 constant entry external dcl 98 ref 220 convert_access_class_$encode 000014 constant entry external dcl 98 ref 177 convert_access_class_$from_string 000016 constant entry external dcl 98 ref 169 convert_access_class_$to_string 000020 constant entry external dcl 98 ref 221 cu_$arg_list_ptr 000022 constant entry external dcl 98 ref 138 197 encoded_access_class 000211 automatic char(15) initial unaligned dcl 50 set ref 50* 177* 179 182* er_p_code parameter fixed bin(35,0) dcl 280 set ref 276 288* 291* er_p_ioa_optional_arg parameter char unaligned dcl 280 set ref 276 288* er_p_ioa_optional_arg_given parameter bit(1) dcl 280 ref 276 288 er_p_ioa_string parameter char unaligned dcl 280 set ref 276 288* 291* erfss_p_code parameter fixed bin(35,0) dcl 303 set ref 300 308* erfss_p_myname parameter char unaligned dcl 303 set ref 300 308* error_table_$noarg 000044 external static fixed bin(35,0) dcl 122 set ref 161* 209* error_table_$too_many_args 000046 external static fixed bin(35,0) dcl 122 set ref 164* 212* get_authorization_ 000024 constant entry external dcl 98 ref 150 ioa_ 000026 constant entry external dcl 98 ref 182 232 is_active_function 000215 automatic bit(1) initial dcl 50 set ref 50* 145* 179 206* 229 myname 000216 automatic char(19) initial unaligned dcl 50 set ref 50* 135* 139* 141* 194* 198* 200* null builtin function dcl 73 ref 50 50 50 50 267 number_of_args 000223 automatic fixed bin(17,0) initial dcl 50 set ref 50* 145* 150 161 164 206* 209 212 requote_string_ 000030 constant entry external dcl 98 ref 229 return_arg based varying char dcl 68 set ref 179* 229* return_arg_len 000224 automatic fixed bin(21,0) initial dcl 50 set ref 50* 145* 179 206* 229 return_arg_ptr 000226 automatic pointer initial dcl 50 set ref 50* 145* 179 206* 229 rtrim builtin function dcl 73 ref 229 229 sci_ptr 000230 automatic pointer initial dcl 50 set ref 50* 139* 145* 156* 167* 198* 206* 215* 267 267* 288* 291* ssu_$abort_line 000032 constant entry external dcl 98 ref 288 291 ssu_$arg_ptr 000034 constant entry external dcl 98 ref 156 167 215 ssu_$destroy_invocation 000036 constant entry external dcl 98 ref 267 ssu_$return_arg 000040 constant entry external dcl 98 ref 145 206 ssu_$standalone_invocation 000042 constant entry external dcl 98 ref 139 198 NAMES DECLARED BY EXPLICIT CONTEXT. ABORT_ENTRY 001257 constant entry internal dcl 254 ref 139 139 198 198 ERROR_RETURN 001316 constant entry internal dcl 276 ref 161 164 170 209 212 223 ERROR_RETURN_FROM_SSU_SETUP 001412 constant entry internal dcl 300 ref 141 200 FINISH 001275 constant entry internal dcl 264 ref 136 195 246 257 GET_ACCESS_CLASS_TO_ENCODE 000323 constant label dcl 148 GET_DAC_RESULT 001053 constant label dcl 218 GET_DAC_RESULT_TO_USER 001150 constant label dcl 229 GET_EAC_RESULT_TO_USER 000561 constant label dcl 179 GET_ENCODED_ACCESS_CLASS_STRING 000736 constant label dcl 204 GET_REAL_ACCESS_CLASS_ARG 000366 constant label dcl 157 INTERPRET_ARGS 000335 constant label dcl 152 MAIN_RETURN 001247 constant label dcl 238 ref 247 258 310 RETURN 001250 constant entry internal dcl 244 ref 184 234 SETUP_DAC_INVOCATION 000636 constant label dcl 192 SETUP_EAC_INVOCATION 000204 constant label dcl 133 dac 000620 constant entry external dcl 188 decode_access_class 000630 constant entry external dcl 188 eac 000166 constant entry external dcl 44 encode_access_class 000176 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 1742 2012 1462 1752 Length 2226 1462 50 200 257 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME eac 272 external procedure is an external procedure. on unit on line 136 64 on unit on unit on line 195 64 on unit RETURN internal procedure shares stack frame of external procedure eac. ABORT_ENTRY 64 internal procedure is assigned to an entry variable. FINISH 68 internal procedure is called by several nonquick procedures. ERROR_RETURN internal procedure shares stack frame of external procedure eac. ERROR_RETURN_FROM_SSU_SETUP internal procedure shares stack frame of external procedure eac. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME eac 000100 access_class eac 000102 access_class_string eac 000202 arg_idx eac 000203 arg_len eac 000204 arg_list_ptr eac 000206 arg_ptr eac 000210 code eac 000211 encoded_access_class eac 000215 is_active_function eac 000216 myname eac 000223 number_of_args eac 000224 return_arg_len eac 000226 return_arg_ptr eac 000230 sci_ptr eac THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. alloc_cs call_ext_out_desc call_ext_out call_int_this call_int_other return tra_ext enable shorten_stack ext_entry int_entry THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. com_err_ convert_access_class_$decode convert_access_class_$encode convert_access_class_$from_string convert_access_class_$to_string cu_$arg_list_ptr get_authorization_ ioa_ requote_string_ ssu_$abort_line ssu_$arg_ptr ssu_$destroy_invocation ssu_$return_arg ssu_$standalone_invocation THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. error_table_$noarg error_table_$too_many_args LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 50 000133 44 000165 135 000204 136 000207 138 000231 139 000240 141 000277 145 000304 150 000323 155 000335 156 000337 157 000354 160 000366 161 000367 164 000417 167 000447 169 000464 170 000510 177 000544 179 000561 182 000576 184 000615 188 000616 194 000636 195 000641 197 000663 198 000672 200 000731 206 000736 209 000755 212 001004 215 001034 220 001053 221 001073 223 001114 229 001150 232 001226 234 001246 238 001247 244 001250 246 001251 247 001255 254 001256 257 001264 258 001271 264 001274 267 001302 270 001315 276 001316 288 001334 291 001367 295 001411 300 001412 308 001423 310 001446 ----------------------------------------------------------- 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