COMPILATION LISTING OF SEGMENT mu_trim_descriptor Compiled by: Multics PL/I Compiler, Release 28e, of February 14, 1985 Compiled at: Honeywell Multics Op. - System M Compiled on: 04/18/85 1050.9 mst Thu Options: optimize map 1 /* *********************************************************** 2* * * 3* * * 4* * Copyright, (C) Honeywell Information Systems Inc., 1981 * 5* * * 6* * * 7* *********************************************************** */ 8 9 /* ****************************************************** 10* * * 11* * * 12* * Copyright (c) 1972 by Massachusetts Institute of * 13* * Technology and Honeywell Information Systems, Inc. * 14* * * 15* * * 16* ****************************************************** */ 17 18 /* HISTORY: 19* 20* Originally written by Jim Gray - - January 1980 21* 22**/ 23 24 mu_trim_descriptor: trim_descriptor: procedure (character_descriptor) returns (char (*)); 25 26 /* DESCRIPTION: 27* 28* this routine takes the character form of the descriptor as returned 29* from mu_display_descriptor, and puts it in it's shortest possible form, 30* by trimming comments, using short forms of keywords, and omitting 31* keywords when defaults apply. 32* NOTE: without array dimensions, the maximum input length from mu_display_descriptor 33* is about 77 characters, the maximum output from this routine is about 29 characters 34* 35**/ 36 37 /* PARAMETERS: 38* 39* character_descriptor - - (input) char(120) varying, the output from mu_display_descriptor, 40* the character form of the descriptor declaration attributes 41* 42* trimmed_descriptor - - (output) char(*), the reduced, shorted form of the character form of the 43* descriptor in terms of declaration attributes. 44* 45**/ 46 47 /* get local version of declaration attributes */ 48 49 desc = character_descriptor; 50 51 /* determine data catagory */ 52 53 i = index (desc, "char"); 54 j = index (desc, "bit"); 55 h = index (desc, "/*"); /* start of comment, possibly containing "bit" */ 56 57 /* do strings if char or bit keyword found */ 58 59 if i ^= 0 | (j ^= 0 & h = 0) then do; /* string data types */ 60 61 /* check for long character keyword */ 62 63 g = index (desc, "character"); 64 if g = 0 then ; 65 else substr (desc, g + 4) = substr (desc, g + 9); /* replace character with char */ 66 67 /* check for varying attributes */ 68 k = index (desc, "var"); 69 l = index (desc, "nonvar"); 70 m = index (desc, "ying"); 71 72 if k = 0 then ; /* no varying attribute present */ 73 else if l ^= 0 then do; /* nonvarying attribute present, remove it since default */ 74 if m = 0 then /* short form nonvar removed */ 75 substr (desc, l) = substr (desc, l + 6); 76 else substr (desc, l) = substr (desc, l + 10); /* long form nonvarying removed */ 77 end; 78 else do; /* varying attribute present, shorten it */ 79 if m = 0 then ; /* already short */ 80 else substr (desc, k + 3) = substr (desc, k + 7); /* shorten varying to var */ 81 end; 82 83 /* check for alignment attribute */ 84 85 n = index (desc, "aligned"); 86 o = index (desc, "unal"); 87 88 if n = 0 then ; /* no alignment attribute */ 89 else if o = 0 then do; /* aligned, leave alone, unless varying */ 90 if k = 0 | l ^= 0 then ; /* varying not present */ 91 else substr (desc, n) = substr (desc, n + 7); /* remove varying default of aligned */ 92 end; 93 else substr (desc, o) = substr (desc, o + 9); /* unaligned, remove since default */ 94 95 end; 96 else do; 97 98 /* do numbers if real or complex keyword found */ 99 100 p = index (desc, "real"); 101 q = index (desc, "complex"); 102 103 if p + q = 0 then ; /* already shortened, or not a number */ 104 else do; /* number types */ 105 106 /* get rid of default real attribute */ 107 108 if p = 0 then ; 109 else substr (desc, p) = substr (desc, p + 4); 110 111 /* shorten complex keyword */ 112 113 if q = 0 then ; 114 else substr (desc, q) = "cplx" || substr (desc, q + 7); 115 116 /* use short forms of decimal/binary keywords */ 117 118 r = index (desc, "binary"); 119 s = index (desc, "decimal"); 120 121 if r = 0 then ; 122 else substr (desc, r + 3) = substr (desc, r + 6); /* use bin for binary */ 123 124 if s = 0 then ; 125 else substr (desc, s + 3) = substr (desc, s + 7); /* use dec for decimal */ 126 127 /* get rid of default 0 scale */ 128 129 t = index (desc, ",0)"); 130 if t = 0 then ; 131 else substr (desc, t) = substr (desc, t + 2); 132 133 /* check for alignment attribute */ 134 135 v = index (desc, "aligned"); 136 w = index (desc, "unal"); 137 138 if v = 0 then ; /* nothing to be done */ 139 else if w ^= 0 then 140 substr (desc, w + 4) = substr (desc, w + 9); /* shorten unaligned to unal */ 141 else substr (desc, v) = substr (desc, v + 7); /* remove default aligned */ 142 143 /* strip off any comments */ 144 145 h = index (desc, "/*"); 146 u = index (desc, "*/"); 147 if h = 0 | u = 0 then ; 148 else substr (desc, h - 1) = substr (desc, u + 2); 149 150 end; 151 152 end; 153 154 /* return the modified descriptor string */ 155 156 desc = rtrim (ltrim (desc)); 157 158 return (desc); 159 160 declare (g, h, i, j, k, l, m, n, o, 161 p, q, r, s, t, u, v, w) fixed bin (24); /* indexes into descriptor string */ 162 declare desc char (120) varying;/* local version of descriptor string */ 163 declare character_descriptor char (120) varying;/* input descriptor string */ 164 declare index builtin; 165 declare ltrim builtin; 166 declare substr builtin; 167 declare rtrim builtin; 168 169 end; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 04/18/85 0908.9 mu_trim_descriptor.pl1 >special_ldd>online>mrds.pbf-04/18/85>mu_trim_descriptor.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. character_descriptor parameter varying char(120) dcl 163 ref 24 24 49 desc 000121 automatic varying char(120) dcl 162 set ref 49* 53 54 55 63 65* 65 68 69 70 74* 74 76* 76 80* 80 85 86 91* 91 93* 93 100 101 109* 109 114* 114 118 119 122* 122 125* 125 129 131* 131 135 136 139* 139 141* 141 145 146 148* 148 156* 156 158 g 000100 automatic fixed bin(24,0) dcl 160 set ref 63* 64 65 65 h 000101 automatic fixed bin(24,0) dcl 160 set ref 55* 59 145* 147 148 i 000102 automatic fixed bin(24,0) dcl 160 set ref 53* 59 index builtin function dcl 164 ref 53 54 55 63 68 69 70 85 86 100 101 118 119 129 135 136 145 146 j 000103 automatic fixed bin(24,0) dcl 160 set ref 54* 59 k 000104 automatic fixed bin(24,0) dcl 160 set ref 68* 72 80 80 90 l 000105 automatic fixed bin(24,0) dcl 160 set ref 69* 73 74 74 76 76 90 ltrim builtin function dcl 165 ref 156 m 000106 automatic fixed bin(24,0) dcl 160 set ref 70* 74 79 n 000107 automatic fixed bin(24,0) dcl 160 set ref 85* 88 91 91 o 000110 automatic fixed bin(24,0) dcl 160 set ref 86* 89 93 93 p 000111 automatic fixed bin(24,0) dcl 160 set ref 100* 103 108 109 109 q 000112 automatic fixed bin(24,0) dcl 160 set ref 101* 103 113 114 114 r 000113 automatic fixed bin(24,0) dcl 160 set ref 118* 121 122 122 rtrim builtin function dcl 167 ref 156 s 000114 automatic fixed bin(24,0) dcl 160 set ref 119* 124 125 125 substr builtin function dcl 166 set ref 65* 65 74* 74 76* 76 80* 80 91* 91 93* 93 109* 109 114* 114 122* 122 125* 125 131* 131 139* 139 141* 141 148* 148 t 000115 automatic fixed bin(24,0) dcl 160 set ref 129* 130 131 131 u 000116 automatic fixed bin(24,0) dcl 160 set ref 146* 147 148 v 000117 automatic fixed bin(24,0) dcl 160 set ref 135* 138 141 141 w 000120 automatic fixed bin(24,0) dcl 160 set ref 136* 139 139 139 NAMES DECLARED BY EXPLICIT CONTEXT. mu_trim_descriptor 000045 constant entry external dcl 24 trim_descriptor 000035 constant entry external dcl 24 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 1014 1024 756 1024 Length 1176 756 10 135 35 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME trim_descriptor 115 external procedure is an external procedure. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME trim_descriptor 000100 g trim_descriptor 000101 h trim_descriptor 000102 i trim_descriptor 000103 j trim_descriptor 000104 k trim_descriptor 000105 l trim_descriptor 000106 m trim_descriptor 000107 n trim_descriptor 000110 o trim_descriptor 000111 p trim_descriptor 000112 q trim_descriptor 000113 r trim_descriptor 000114 s trim_descriptor 000115 t trim_descriptor 000116 u trim_descriptor 000117 v trim_descriptor 000120 w trim_descriptor 000121 desc trim_descriptor THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. alloc_cs shorten_stack ext_entry_desc set_cs_eis index_cs_eis return_chars_eis NO EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. NO EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 24 000031 49 000052 53 000061 54 000070 55 000077 59 000111 63 000117 64 000126 65 000130 68 000146 69 000155 70 000164 72 000173 73 000176 74 000200 76 000222 77 000241 79 000242 80 000245 85 000264 86 000273 88 000302 89 000305 90 000307 91 000314 92 000333 93 000334 95 000352 100 000353 101 000362 103 000371 108 000374 109 000377 113 000415 114 000420 118 000447 119 000457 121 000466 122 000471 124 000507 125 000512 129 000530 130 000537 131 000541 135 000557 136 000566 138 000575 139 000600 141 000621 145 000640 146 000652 147 000664 148 000671 156 000712 158 000746 ----------------------------------------------------------- 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