COMPILATION LISTING OF SEGMENT card_util_ Compiled by: Multics PL/I Compiler, Release 27d, of October 11, 1982 Compiled at: Honeywell LISD Phoenix, System M Compiled on: 11/15/82 1558.6 mst Mon 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 card_util_: proc; 12 13 /* This procedure implements the mapping of mode names to a compact bit string. */ 14 /* The bit string is used when calling the translate entry to set the operations which are performed. */ 15 16 /* Created by DRV in 1977 */ 17 /* Modified by J. C. Whitmore, Feb 1980, to remove the punch_nl and binary modes (unused) and to increase the */ 18 /* size of the orig_string variable to 2000 chars for HASP records */ 19 20 21 dcl test_mode char (*); 22 dcl new_modes char (*); 23 dcl old_modes char (*); 24 dcl mode_bits bit (36); 25 dcl a_code fixed bin (35); 26 dcl string char (*) var; 27 28 dcl last_char fixed bin; 29 dcl char char (1); 30 dcl orig_len fixed bin; 31 dcl orig_string char (2000) aligned; /* our copy of the card image */ 32 dcl pos fixed bin; 33 dcl i fixed bin; 34 dcl n fixed bin; 35 dcl mode_len fixed bin; 36 dcl val bit (1); 37 dcl mode char (32) var; 38 dcl ret_modes char (256) var; 39 40 dcl 1 modes based (addr (mode_bits)), 41 2 trim bit (1) unal, 42 2 lower_case bit (1) unal, 43 2 add_nl bit (1) unal, 44 2 contin bit (1) unal, 45 2 pad bit (30) unal; 46 47 dcl space char (1) int static init (" "); 48 dcl lower_case char (26) int static init ("abcdefghijklmnopqrstuvwxyz"); 49 dcl upper_case char (26) int static init ("ABCDEFGHIJKLMNOPQRSTUVWXYZ"); 50 dcl NL char (1) int static init (" 51 "); 52 53 dcl error_table_$bad_mode ext fixed bin (35); 54 55 dcl (substr, rtrim, ltrim, search, verify, reverse, length, translate, copy) builtin; 56 57 58 modes: entry (new_modes, mode_bits, old_modes, a_code); 59 60 a_code = 0; 61 62 if modes.lower_case then ret_modes = "lower_case,"; 63 else ret_modes = "^lower_case,"; 64 if modes.add_nl then ret_modes = ret_modes || "add_nl,"; 65 else ret_modes = ret_modes || "^add_nl,"; 66 if modes.contin then ret_modes = ret_modes || "contin,"; 67 else ret_modes = ret_modes || "^contin,"; 68 if modes.trim then ret_modes = ret_modes || "trim."; 69 else ret_modes = ret_modes || "^trim."; 70 old_modes = ret_modes; 71 72 73 n = verify (reverse (new_modes), " .,;"); /* any thing there? */ 74 if n = 0 then return; /* guess not */ 75 mode_len = length (new_modes) - n + 1; 76 77 do i = 1 repeat i + n while (i < mode_len); 78 n = search (substr (new_modes, i), ",;."); 79 if n = 0 then n = mode_len - i + 2; /* no breaks, take remaining */ 80 mode = ltrim (rtrim (substr (new_modes, i, n - 1))); /* get mode */ 81 if substr (mode, 1, 1) = "^" then do; 82 val = "0"b; 83 pos = 2; 84 end; 85 else do; 86 val = "1"b; 87 pos = 1; 88 end; 89 if substr (mode, pos) = "trim" then modes.trim = val; 90 else if substr (mode, pos) = "lower_case" then modes.lower_case = val; 91 else if substr (mode, pos) = "add_nl" then modes.add_nl = val; 92 else if substr (mode, pos) = "contin" then modes.contin = val; 93 94 else a_code = error_table_$bad_mode; 95 end; 96 return; 97 98 translate: entry (mode_bits, string); 99 100 orig_len = length (string); /* save the original string length */ 101 last_char = length (rtrim (string)); /* find last non-blank */ 102 if modes.lower_case & last_char > 0 then do; 103 orig_string = string; /* copy the string */ 104 string = ""; /* we will rebuild it */ 105 do i = 1 to last_char; /* look at each char given */ 106 char = substr (orig_string, i, 1); /* get the next char */ 107 if char = "\" & i < last_char then do; /* don't convert a trailing \ */ 108 i = i + 1; 109 char = substr (orig_string, i, 1); /* skip the escape char */ 110 if char = "<" then char = "["; 111 else if char = ">" then char = "]"; 112 else if char = "(" then char = "{"; 113 else if char = ")" then char = "}"; 114 end; 115 else char = translate (char, lower_case, upper_case); 116 string = string || char; /* add to the input string */ 117 end; 118 string = string || copy (" ", orig_len - length (string)); /* pad out to orig length */ 119 end; 120 if modes.trim then string = rtrim (string); 121 if modes.contin then do; 122 i = length (rtrim (string)); /* find last non-blank char */ 123 if i > 0 then do; 124 if substr (string, i, 1) ^= "\" & modes.add_nl then string = string || NL; 125 else if substr (string, i, 1) = "\" then string = substr (string, 1, i - 1); /* drop contin mark */ 126 end; 127 else if modes.add_nl then string = string || NL; 128 end; 129 else if modes.add_nl then string = string || NL; 130 return; 131 132 test_mode: entry (mode_bits, test_mode) returns (bit (1)); 133 134 return ("0"b); 135 136 end card_util_; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/15/82 1458.6 card_util_.pl1 >dumps>old>recomp>card_util_.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. NL 001724 constant char(1) initial unaligned dcl 50 ref 124 127 129 a_code parameter fixed bin(35,0) dcl 25 set ref 58 60* 94* add_nl 0(02) based bit(1) level 2 packed unaligned dcl 40 set ref 64 91* 124 127 129 char 000101 automatic char(1) unaligned dcl 29 set ref 106* 107 109* 110 110* 111 111* 112 112* 113 113* 115* 115 116 contin 0(03) based bit(1) level 2 packed unaligned dcl 40 set ref 66 92* 121 copy builtin function dcl 55 ref 118 error_table_$bad_mode 000010 external static fixed bin(35,0) dcl 53 ref 94 i 001070 automatic fixed bin(17,0) dcl 33 set ref 77* 77* 78 79 80* 95 105* 106 107 108* 108 109* 122* 123 124 125 125 last_char 000100 automatic fixed bin(17,0) dcl 28 set ref 101* 102 105 107 length builtin function dcl 55 ref 75 100 101 118 122 lower_case 0(01) based bit(1) level 2 in structure "modes" packed unaligned dcl 40 in procedure "card_util_" set ref 62 90* 102 lower_case 000007 constant char(26) initial unaligned dcl 48 in procedure "card_util_" ref 115 ltrim builtin function dcl 55 ref 80 mode 001074 automatic varying char(32) dcl 37 set ref 80* 81 89 90 91 92 mode_bits parameter bit(36) unaligned dcl 24 set ref 58 62 64 66 68 89 90 91 92 98 102 120 121 124 127 129 132 mode_len 001072 automatic fixed bin(17,0) dcl 35 set ref 75* 77 79 modes based structure level 1 packed unaligned dcl 40 n 001071 automatic fixed bin(17,0) dcl 34 set ref 73* 74 75 78* 79 79* 80 95 new_modes parameter char unaligned dcl 22 ref 58 73 75 78 80 old_modes parameter char unaligned dcl 23 set ref 58 70* orig_len 000102 automatic fixed bin(17,0) dcl 30 set ref 100* 118 orig_string 000103 automatic char(2000) dcl 31 set ref 103* 106 109 pos 001067 automatic fixed bin(17,0) dcl 32 set ref 83* 87* 89 90 91 92 ret_modes 001105 automatic varying char(256) dcl 38 set ref 62* 63* 64* 64 65* 65 66* 66 67* 67 68* 68 69* 69 70 reverse builtin function dcl 55 ref 73 rtrim builtin function dcl 55 ref 80 101 120 122 search builtin function dcl 55 ref 78 string parameter varying char dcl 26 set ref 98 100 101 103 104* 116* 116 118* 118 118 120* 120 122 124 124* 124 125 125* 125 127* 127 129* 129 substr builtin function dcl 55 ref 78 80 81 89 90 91 92 106 109 124 125 125 test_mode parameter char unaligned dcl 21 ref 132 translate builtin function dcl 55 ref 115 trim based bit(1) level 2 packed unaligned dcl 40 set ref 68 89* 120 upper_case 000000 constant char(26) initial unaligned dcl 49 ref 115 val 001073 automatic bit(1) unaligned dcl 36 set ref 82* 86* 89 90 91 92 verify builtin function dcl 55 ref 73 NAME DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. space internal static char(1) initial unaligned dcl 47 NAMES DECLARED BY EXPLICIT CONTEXT. card_util_ 000066 constant entry external dcl 11 modes 000103 constant entry external dcl 58 test_mode 001071 constant entry external dcl 132 translate 000534 constant entry external dcl 98 NAME DECLARED BY CONTEXT OR IMPLICATION. addr builtin function ref 62 64 66 68 89 90 91 92 102 120 121 124 127 129 STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 2004 2016 1725 2014 Length 2164 1725 12 131 57 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME card_util_ 658 external procedure is an external procedure. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME card_util_ 000100 last_char card_util_ 000101 char card_util_ 000102 orig_len card_util_ 000103 orig_string card_util_ 001067 pos card_util_ 001070 i card_util_ 001071 n card_util_ 001072 mode_len card_util_ 001073 val card_util_ 001074 mode card_util_ 001105 ret_modes card_util_ THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. alloc_cs return signal shorten_stack ext_entry ext_entry_desc NO EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. error_table_$bad_mode LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 11 000065 58 000075 60 000130 62 000132 63 000146 64 000153 65 000172 66 000204 67 000223 68 000235 69 000255 70 000267 73 000275 74 000311 75 000321 77 000325 78 000332 79 000353 80 000360 81 000422 82 000426 83 000427 84 000431 86 000432 87 000434 89 000436 90 000455 91 000467 92 000501 94 000513 95 000516 96 000521 98 000530 100 000554 101 000560 102 000573 103 000603 104 000607 105 000610 106 000616 107 000622 108 000627 109 000630 110 000635 111 000643 112 000650 113 000655 114 000661 115 000662 116 000671 117 000702 118 000704 119 000727 120 000730 121 000753 122 000761 123 000774 124 000775 125 001017 126 001026 127 001027 128 001042 129 001043 130 001056 132 001065 134 001110 ----------------------------------------------------------- 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