COMPILATION LISTING OF SEGMENT log_expand_select_ Compiled by: Multics PL/I Compiler, Release 28d, of October 4, 1983 Compiled at: Honeywell Multics Op. - System M Compiled on: 01/17/85 0837.2 mst Thu Options: optimize map 1 /* *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Information Systems Inc., 1984 * 4* * * 5* *********************************************************** */ 6 log_expand_select_: 7 procedure (); 8 9 /* * LOG_EXPAND_SELECT_ 10* * 11* * This procedure is used to maintain the list of message classes and modes 12* * for expansion of log messages. The log perusal commands all accept 13* * an optional list of message classes to be expanded; each message class 14* * can additionally include a mode string controlling the format of the 15* * expansion (interpreted by the individual expansion procedure). 16* * 17* * 84-07-04, W. Olin Sibert 18* * 84-11-30, BIM: Added $print entrypoint 19* * 84-12-05, WOS: Removed octal_sw from the mechanism 20* */ 21 22 declare P_expand_select_ptr pointer parameter; 23 declare P_expand_mode char (*) parameter; 24 declare P_log_message_ptr pointer parameter; 25 declare P_expand_sw bit (1) aligned parameter; 26 declare P_mode_ptr pointer parameter; 27 declare P_code fixed bin (35) parameter; 28 declare P_iocb_ptr pointer; 29 declare P_indent fixed bin; 30 31 declare code fixed bin (35); 32 declare expand_select_ptr pointer; 33 declare alloc_expand_select_max_entries fixed bin; 34 declare expand_select_area area based (expand_select.area_ptr); 35 declare mode_string char (500); 36 37 declare 1 expand_select aligned based (expand_select_ptr), 38 2 max_entries fixed bin, 39 2 n_entries fixed bin, 40 2 area_ptr pointer, 41 2 array (alloc_expand_select_max_entries refer (expand_select.max_entries)), 42 3 class char (16) varying, 43 3 mode_ptr pointer; 44 45 declare data_class char (16) varying; 46 declare entry_found bit (1) aligned; 47 declare entry_idx fixed bin; 48 declare mode_string_delim fixed bin; 49 50 declare error_table_$log_message_invalid_type fixed bin (35) external static; 51 52 declare ioa_$ioa_switch entry() options(variable); 53 declare get_system_free_area_ entry () returns (pointer); 54 declare mode_string_$parse entry (char (*), pointer, pointer, fixed bin (35)); 55 declare mode_string_$get entry (pointer, character (*), fixed binary (35)); 56 57 declare ALPHANUMERIC char (37) internal static options (constant) init ("_0123456789abcdefghijklmnopqrstuvwxyz"); 58 59 declare (index, length, null, substr, verify) builtin; 60 61 /* */ 62 63 log_expand_select_$add: 64 entry (P_expand_select_ptr, P_expand_mode, P_code); 65 66 expand_select_ptr = P_expand_select_ptr; 67 68 mode_string_delim = index (P_expand_mode, ":"); /* Figure out where the mode string, if any, is located, */ 69 if (mode_string_delim = 0) then /* and extract the message type from before it */ 70 data_class = P_expand_mode; 71 else data_class = substr (P_expand_mode, 1, mode_string_delim - 1); 72 73 if (data_class = "") | (length (data_class) > 12) | (verify (data_class, ALPHANUMERIC) ^= 0) then do; 74 P_code = error_table_$log_message_invalid_type; 75 return; 76 end; 77 78 if (expand_select_ptr = null ()) then /* Allocate a new one even though we only *might* need it */ 79 expand_select_ptr = make_new_table (10); /* If we're replacing an existing entry, this will result */ 80 else if (expand_select.n_entries >= expand_select.max_entries) then /* in at most one extra entry */ 81 expand_select_ptr = make_new_table (10 + expand_select.max_entries); 82 83 entry_found = "0"b; 84 do entry_idx = 1 to expand_select.n_entries while (^entry_found); 85 if (expand_select.class (entry_idx) = data_class) then entry_found = "1"b; 86 end; 87 88 if (entry_idx > expand_select.n_entries) then do; /* A new entry is required. Initialize it */ 89 expand_select.class (entry_idx) = data_class; 90 expand_select.mode_ptr (entry_idx) = null (); /* This will be initialized later, as required */ 91 expand_select.n_entries = entry_idx; 92 end; 93 94 else do; /* Existing entry is being replaced */ 95 if (mode_string_delim > 0) then /* Flush the old mode string if a new one is provided */ 96 if (expand_select.mode_ptr (entry_idx) ^= null ()) then do; 97 mode_string_info_ptr = expand_select.mode_ptr (entry_idx); 98 expand_select.mode_ptr (entry_idx) = null (); 99 free mode_string_info_ptr -> mode_string_info in (expand_select_area); 100 end; 101 end; 102 103 if (mode_string_delim > 0) & (mode_string_delim < length (P_expand_mode)) then do; 104 call mode_string_$parse (substr (P_expand_mode, (mode_string_delim + 1)), 105 expand_select.area_ptr, mode_string_info_ptr, P_code); 106 if (P_code ^= 0) then return; /* Punt if any error occurs converting */ 107 expand_select.mode_ptr (entry_idx) = mode_string_info_ptr; 108 end; 109 110 P_expand_select_ptr = expand_select_ptr; /* All done. Tell caller where the structure is */ 111 P_code = 0; 112 return; 113 114 /* */ 115 116 log_expand_select_$free: 117 entry (P_expand_select_ptr); 118 119 expand_select_ptr = P_expand_select_ptr; 120 121 if (expand_select_ptr = null ()) then return; /* Nothing there */ 122 123 P_expand_select_ptr = null (); /* Don't call us again */ 124 125 do entry_idx = 1 to expand_select.n_entries; 126 mode_string_info_ptr = expand_select.mode_ptr (entry_idx); 127 expand_select.mode_ptr (entry_idx) = null (); 128 if (mode_string_info_ptr ^= null ()) then 129 free mode_string_info_ptr -> mode_string_info in (expand_select_area); 130 end; 131 132 free expand_select in (expand_select_area); 133 134 return; 135 136 /* */ 137 138 log_expand_select_$test: 139 entry (P_expand_select_ptr, P_log_message_ptr, P_expand_sw, P_mode_ptr); 140 141 expand_select_ptr = P_expand_select_ptr; 142 log_message_ptr = P_log_message_ptr; 143 144 P_expand_sw = "1"b; /* Set output argument to default values */ 145 P_mode_ptr = null (); 146 147 if (expand_select_ptr = null ()) then return; 148 if (expand_select.n_entries = 0) then return; 149 150 do entry_idx = 1 to expand_select.n_entries; /* See if it's one we were asked about */ 151 if (expand_select.class (entry_idx) = log_message.data_class) then do; 152 P_mode_ptr = expand_select.mode_ptr (entry_idx); 153 return; 154 end; 155 end; 156 157 P_expand_sw = "0"b; /* If we had some to try, and this wasn't one of them, */ 158 return; /* then it's not to be expanded. */ 159 160 /* */ 161 162 log_expand_select_$print: 163 entry (P_expand_select_ptr, P_iocb_ptr, P_indent); 164 165 expand_select_ptr = P_expand_select_ptr; 166 if expand_select_ptr = null () 167 then return; 168 169 if expand_select.n_entries = 0 then return; 170 call ioa_$ioa_switch (P_iocb_ptr, "^vxExpansion control:", P_indent); 171 do entry_idx = 1 to expand_select.n_entries; 172 if expand_select.array (entry_idx).mode_ptr = null () 173 then mode_string = ""; 174 else do; 175 call mode_string_$get (expand_select.array (entry_idx).mode_ptr, mode_string, code); 176 if code ^= 0 then mode_string = ""; 177 end; 178 call ioa_$ioa_switch (P_iocb_ptr, "^vx ^a^[ modes ^a^]", 179 P_indent, expand_select.array (entry_idx).class, 180 mode_string ^= "", 181 mode_string); 182 end; 183 return; 184 185 /* */ 186 187 make_new_table: 188 procedure (P_size) returns (pointer); 189 190 declare P_size fixed bin parameter; 191 192 declare new_ptr pointer; 193 declare system_area_ptr pointer; 194 declare system_area area based (system_area_ptr); 195 declare copy_idx fixed bin; 196 197 198 alloc_expand_select_max_entries = P_size; 199 if (expand_select_ptr = null ()) then 200 system_area_ptr = get_system_free_area_ (); 201 else system_area_ptr = expand_select.area_ptr; 202 203 allocate expand_select in (system_area) set (new_ptr); 204 new_ptr -> expand_select.area_ptr = system_area_ptr; /* used for all future allocations */ 205 206 if (expand_select_ptr ^= null ()) then do; 207 do copy_idx = 1 to expand_select.n_entries; 208 new_ptr -> expand_select.array (copy_idx) = expand_select.array (copy_idx); 209 end; 210 new_ptr -> expand_select.n_entries = expand_select.n_entries; 211 free expand_select in (system_area); 212 end; 213 214 else new_ptr -> expand_select.n_entries = 0; 215 216 return (new_ptr); 217 end make_new_table; 218 219 /* BEGIN INCLUDE FILE ... log_message.incl.pl1 ... 84-04-25 ... W. Olin Sibert */ 1 2 1 3 declare 1 log_message_header aligned based, /* Items marked "(SET)" are set by $create_message */ 1 4 2 sentinel bit (36) aligned, /* Proper value declared in log_segment.incl.pl1 */ 1 5 2 sequence fixed bin (35), /* Sequence number for this message (SET) */ 1 6 2 severity fixed bin (8) unaligned, /* Severity of message */ 1 7 2 data_class_lth fixed bin (9) unaligned unsigned, /* Length of data class-- 0 to 16 (SET) */ 1 8 2 time fixed bin (53) unaligned, /* Time message originated */ 1 9 2 text_lth fixed bin (17) unaligned, /* Length of message text. Must be nonzero (SET) */ 1 10 2 data_lth fixed bin (17) unaligned, /* Length of binary data. May be zero (SET) */ 1 11 2 process_id bit (36) aligned; /* Process id of process writing message */ 1 12 1 13 declare 1 log_message aligned based (log_message_ptr), 1 14 2 header aligned like log_message_header, 1 15 2 text char (log_message_text_lth refer (log_message.text_lth)) unaligned, 1 16 2 data_class char (log_message_data_class_lth refer (log_message.data_class_lth)) unaligned, 1 17 2 data dim (log_message_data_lth refer (log_message.data_lth)) bit (36) aligned; 1 18 1 19 declare log_message_ptr pointer; 1 20 declare log_message_text_lth fixed bin; 1 21 declare log_message_data_class_lth fixed bin; 1 22 declare log_message_data_lth fixed bin; 1 23 1 24 /* END INCLUDE FILE ... log_message.incl.pl1 */ 219 220 /* BEGIN INCLUDE FILE mode_string_info.incl.pl1 */ 2 2 2 3 /* Structure for parse_mode_string_ JRDavis 20 October 1980 2 4* Last modified 12 January 1981 by J. Spencer Love for version 2, make char_value varying string */ 2 5 2 6 declare mode_value_ptr ptr, 2 7 number_of_modes fixed bin; 2 8 2 9 declare 1 mode_string_info aligned based (mode_string_info_ptr), 2 10 2 version fixed bin, 2 11 2 number fixed bin, 2 12 2 modes (number_of_modes refer (mode_string_info.number)) like mode_value; 2 13 2 14 declare mode_string_info_ptr ptr; 2 15 2 16 declare 1 mode_value aligned based (mode_value_ptr), 2 17 2 version fixed bin, 2 18 2 mode_name char (32) unaligned, 2 19 2 flags, 2 20 3 boolean_valuep bit (1) unaligned, 2 21 3 numeric_valuep bit (1) unaligned, 2 22 3 char_valuep bit (1) unaligned, 2 23 3 boolean_value bit (1) unaligned, 2 24 3 pad1 bit (32) unaligned, 2 25 2 numeric_value fixed bin (35), 2 26 2 char_value char (32) varying, 2 27 2 code fixed bin (35), 2 28 2 pad2 bit (36); 2 29 2 30 declare mode_string_info_version_2 fixed bin static options (constant) initial (2), 2 31 mode_value_version_3 fixed bin static options (constant) initial (3); 2 32 2 33 /* END INCLUDE FILE mode_string_info.incl.pl1 */ 220 221 222 end log_expand_select_; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 01/17/85 0834.6 log_expand_select_.pl1 >special_ldd>online>41-4>log_expand_select_.pl1 219 1 01/10/85 1340.2 log_message.incl.pl1 >special_ldd>online>41-4>log_message.incl.pl1 220 2 03/19/81 1206.8 mode_string_info.incl.pl1 >ldd>include>mode_string_info.incl.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. ALPHANUMERIC 000000 constant char(37) initial unaligned dcl 57 ref 73 P_code parameter fixed bin(35,0) dcl 27 set ref 63 74* 104* 106 111* P_expand_mode parameter char unaligned dcl 23 ref 63 68 69 71 103 104 104 P_expand_select_ptr parameter pointer dcl 22 set ref 63 66 110* 116 119 123* 138 141 162 165 P_expand_sw parameter bit(1) dcl 25 set ref 138 144* 157* P_indent parameter fixed bin(17,0) dcl 29 set ref 162 170* 178* P_iocb_ptr parameter pointer dcl 28 set ref 162 170* 178* P_log_message_ptr parameter pointer dcl 24 ref 138 142 P_mode_ptr parameter pointer dcl 26 set ref 138 145* 152* P_size parameter fixed bin(17,0) dcl 190 ref 187 198 alloc_expand_select_max_entries 000104 automatic fixed bin(17,0) dcl 33 set ref 198* 203 203 area_ptr 2 based pointer level 2 dcl 37 set ref 99 104* 128 132 201 204* array 4 based structure array level 2 dcl 37 set ref 208* 208 class 4 based varying char(16) array level 3 dcl 37 set ref 85 89* 151 178* code 000100 automatic fixed bin(35,0) dcl 31 set ref 175* 176 copy_idx 000334 automatic fixed bin(17,0) dcl 195 set ref 207* 208 208* data_class based char level 2 in structure "log_message" packed unaligned dcl 1-13 in procedure "log_expand_select_" ref 151 data_class 000302 automatic varying char(16) dcl 45 in procedure "log_expand_select_" set ref 69* 71* 73 73 73 85 89 data_class_lth 2(09) based fixed bin(9,0) level 3 packed unsigned unaligned dcl 1-13 ref 151 entry_found 000307 automatic bit(1) dcl 46 set ref 83* 84 85* entry_idx 000310 automatic fixed bin(17,0) dcl 47 set ref 84* 85* 88 89 90 91 95 97 98 107 125* 126 127* 150* 151 152* 171* 172 175 178* error_table_$log_message_invalid_type 000010 external static fixed bin(35,0) dcl 50 ref 74 expand_select based structure level 1 dcl 37 set ref 132 203 211 expand_select_area based area(1024) dcl 34 ref 99 128 132 expand_select_ptr 000102 automatic pointer dcl 32 set ref 66* 78 78* 80 80 80* 80 84 85 88 89 90 91 95 97 98 99 104 107 110 119* 121 125 126 127 128 132 132 141* 147 148 150 151 152 165* 166 169 171 172 175 178 199 201 206 207 208 210 211 get_system_free_area_ 000014 constant entry external dcl 53 ref 199 header based structure level 2 dcl 1-13 index builtin function dcl 59 ref 68 ioa_$ioa_switch 000012 constant entry external dcl 52 ref 170 178 length builtin function dcl 59 ref 73 103 log_message based structure level 1 dcl 1-13 log_message_header based structure level 1 dcl 1-3 log_message_ptr 000312 automatic pointer dcl 1-19 set ref 142* 151 max_entries based fixed bin(17,0) level 2 dcl 37 set ref 80 80 132 203* 211 mode_ptr 12 based pointer array level 3 dcl 37 set ref 90* 95 97 98* 107* 126 127* 152 172 175* mode_string 000105 automatic char(500) unaligned dcl 35 set ref 172* 175* 176* 178 178* mode_string_$get 000020 constant entry external dcl 55 ref 175 mode_string_$parse 000016 constant entry external dcl 54 ref 104 mode_string_delim 000311 automatic fixed bin(17,0) dcl 48 set ref 68* 69 71 95 103 103 104 104 mode_string_info based structure level 1 dcl 2-9 ref 99 128 mode_string_info_ptr 000314 automatic pointer dcl 2-14 set ref 97* 99 104* 107 126* 128 128 mode_value based structure level 1 dcl 2-16 n_entries 1 based fixed bin(17,0) level 2 dcl 37 set ref 80 84 88 91* 125 148 150 169 171 207 210* 210 214* new_ptr 000330 automatic pointer dcl 192 set ref 203* 204 208 210 214 216 null builtin function dcl 59 ref 78 90 95 98 121 123 127 128 145 147 166 172 199 206 number 1 based fixed bin(17,0) level 2 dcl 2-9 ref 99 128 substr builtin function dcl 59 ref 71 104 104 system_area based area(1024) dcl 194 ref 203 211 system_area_ptr 000332 automatic pointer dcl 193 set ref 199* 201* 203 204 211 text_lth 4 based fixed bin(17,0) level 3 packed unaligned dcl 1-13 ref 151 verify builtin function dcl 59 ref 73 NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. log_message_data_class_lth automatic fixed bin(17,0) dcl 1-21 log_message_data_lth automatic fixed bin(17,0) dcl 1-22 log_message_text_lth automatic fixed bin(17,0) dcl 1-20 mode_string_info_version_2 internal static fixed bin(17,0) initial dcl 2-30 mode_value_ptr automatic pointer dcl 2-6 mode_value_version_3 internal static fixed bin(17,0) initial dcl 2-30 number_of_modes automatic fixed bin(17,0) dcl 2-6 NAMES DECLARED BY EXPLICIT CONTEXT. log_expand_select_ 000045 constant entry external dcl 6 log_expand_select_$add 000057 constant entry external dcl 63 log_expand_select_$free 000363 constant entry external dcl 116 log_expand_select_$print 000540 constant entry external dcl 162 log_expand_select_$test 000446 constant entry external dcl 138 make_new_table 000740 constant entry internal dcl 187 ref 78 80 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 1444 1466 1252 1454 Length 1716 1252 22 213 172 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME log_expand_select_ 290 external procedure is an external procedure. make_new_table internal procedure shares stack frame of external procedure log_expand_select_. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME log_expand_select_ 000100 code log_expand_select_ 000102 expand_select_ptr log_expand_select_ 000104 alloc_expand_select_max_entries log_expand_select_ 000105 mode_string log_expand_select_ 000302 data_class log_expand_select_ 000307 entry_found log_expand_select_ 000310 entry_idx log_expand_select_ 000311 mode_string_delim log_expand_select_ 000312 log_message_ptr log_expand_select_ 000314 mode_string_info_ptr log_expand_select_ 000330 new_ptr make_new_table 000332 system_area_ptr make_new_table 000334 copy_idx make_new_table THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. r_ne_as alloc_cs call_ext_out_desc call_ext_out return shorten_stack ext_entry ext_entry_desc alloc_based free_based THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. get_system_free_area_ ioa_$ioa_switch mode_string_$get mode_string_$parse THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. error_table_$log_message_invalid_type LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 6 000044 63 000052 66 000072 68 000076 69 000111 71 000123 73 000133 74 000156 75 000160 78 000161 80 000172 83 000202 84 000203 85 000215 86 000230 88 000232 89 000235 90 000245 91 000247 92 000251 95 000252 97 000263 98 000266 99 000270 103 000275 104 000301 106 000342 107 000346 110 000353 111 000356 112 000357 116 000360 119 000370 121 000374 123 000400 125 000402 126 000411 127 000415 128 000421 130 000431 132 000433 134 000440 138 000441 141 000453 142 000457 144 000462 145 000464 147 000466 148 000471 150 000473 151 000501 152 000522 153 000526 155 000527 157 000531 158 000533 162 000534 165 000545 166 000551 169 000555 170 000557 171 000606 172 000617 175 000632 176 000656 178 000663 182 000735 183 000737 187 000740 198 000742 199 000744 201 000760 203 000763 204 000774 206 000776 207 001002 208 001013 209 001023 210 001025 211 001031 212 001036 214 001037 216 001040 ----------------------------------------------------------- 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