COMPILATION LISTING OF SEGMENT string Compiled by: Multics PL/I Compiler, Release 27d, of October 11, 1982 Compiled at: Honeywell LISD Phoenix, System M Compiled on: 11/04/82 1834.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 12 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 13 /* */ 14 /* string an active function which returns its input arguments, strung together */ 15 /* in a quoted character string and separated by blanks. An arbitrary */ 16 /* number of input arguments can be handled (0 to infinite). The only */ 17 /* bound on their number of length is the maximum command line size. */ 18 /* When invoked as a command, string has the effect of: */ 19 /* ioa_ [string ...] */ 20 /* */ 21 /* U__s_a_g_e */ 22 /* */ 23 /* [string arg1_ ... arg_n] */ 24 /* or string arg1_ ... arg_n */ 25 /* */ 26 /* 1) arg_i are optional input arguments which are returned as a single quoted */ 27 /* string. */ 28 /* */ 29 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 30 /* TR7417, call iox_$put_chars only once for command invocation 10/31/80 S. Herbst */ 31 32 /* * * * * * * * * * * * * * * * * ** * * * * * * * * * * * * * * * * * * */ 33 34 35 string: procedure; /* active function which returns its input args, */ 36 /* separated by blanks, as a quoted string. */ 37 38 dcl /* automatic variables */ 39 Larg fixed bin (21), /* length of an input arg. */ 40 Lmax fixed bin (21), /* max estimate for string to print */ 41 Lret fixed bin (21), /* maximum length of our return value. */ 42 Nargs fixed bin, /* number of arguments we were passed. */ 43 Parg ptr, /* ptr to an input argument. */ 44 Parg_list ptr, /* ptr to the argument list */ 45 Pret ptr, /* ptr to our return value. */ 46 code fixed bin (35), /* an error code value. */ 47 i fixed bin; /* a do-group index. */ 48 49 50 dcl /* based variables */ 51 arg char(Larg) based (Parg), 52 /* an input argument. */ 53 ret char(Lret) varying based (Pret); 54 /* overlay for portions of our return value. */ 55 56 57 dcl (addr, addrel, length, search) builtin; 58 59 60 dcl /* entries */ 61 cu_$af_return_arg entry (fixed bin, ptr, fixed bin (21), fixed bin(35)), 62 (cu_$af_arg_ptr, 63 cu_$arg_ptr) entry (fixed bin, ptr, fixed bin (21), fixed bin(35)), 64 cu_$arg_list_ptr entry (ptr), 65 cu_$arg_ptr_rel entry (fixed bin, ptr, fixed bin (21), fixed bin (35), ptr), 66 iox_$put_chars entry (ptr, ptr, fixed bin, fixed bin(35)); 67 68 69 dcl /* static variables */ 70 NL char(1) int static init (" 71 "), 72 SPACE char(1) int static init (" "), 73 iox_$user_output ptr ext static; 74 75 /* * * * * * * * * * * * * * * * * ** * * * * * * * * * * * * * * * * * * */ 76 77 78 call cu_$af_return_arg (Nargs, Pret, Lret, code); /* see how we were called. */ 79 if code = 0 then do; /* as an active function. */ 80 if Nargs = 0 then do; /* no input args. Return a null string. */ 81 ret = """"""; 82 return; 83 end; 84 ret = """"; 85 call cu_$af_arg_ptr (1, Parg, Larg, code); /* add first argument to return string. */ 86 if search (arg, """") > 0 then 87 ret = ret || double_quotes (arg); 88 else ret = ret || arg; 89 do i = 2 to Nargs; /* add remaining args to return string. */ 90 ret = ret || " "; 91 call cu_$af_arg_ptr (i, Parg, Larg, code); 92 if search (arg, """") > 0 then 93 ret = ret || double_quotes (arg); 94 else ret = ret || arg; 95 end; 96 ret = ret || """"; 97 end; 98 else do; /* command merely output's its args, separated by */ 99 Lmax = 1; /* allow for NL always */ 100 do i = 1 to Nargs; 101 call cu_$arg_ptr (i, Parg, Larg, code); 102 Lmax = Lmax + Larg + 1; 103 end; 104 105 call cu_$arg_list_ptr (Parg_list); 106 begin; 107 108 dcl the_string char (Lmax) varying; 109 dcl i fixed bin; 110 111 the_string = ""; 112 do i = 1 to Nargs; 113 call cu_$arg_ptr_rel (i, Parg, Larg, code, Parg_list); 114 if i ^= 1 then the_string = the_string || SPACE; 115 the_string = the_string || arg; 116 end; 117 the_string = the_string || NL; 118 call iox_$put_chars (iox_$user_output, addrel (addr (the_string), 1), length (the_string), code); 119 end; 120 end; 121 122 double_quotes: procedure (string) returns (char(*) varying); 123 /* internal procedure to double all quotes in */ 124 /* a "to be quoted" string. */ 125 126 dcl string char(*); 127 128 dcl (i, j) fixed bin; 129 130 131 dcl copied_string char(length(string)*2) varying; 132 133 dcl string_begin char(i-1) based (addr(string_array(j))), 134 string_end char(length(string)-(j-1)) based(addr(string_array(j))), 135 string_array (length(string)) char(1) based (addr(string)); 136 137 i = search(string,""""); 138 if i = 0 then return(string); 139 j = 1; 140 copied_string = ""; 141 do while (i > 0); 142 copied_string = copied_string || string_begin; 143 copied_string = copied_string || """"""; 144 j = i+j; 145 i = search (string_end, """"); 146 end; 147 copied_string = copied_string || string_end; 148 return (copied_string); 149 150 151 end double_quotes; 152 153 154 end string; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/04/82 1630.9 string.pl1 >dumps>old>recomp>string.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. Larg 000100 automatic fixed bin(21,0) dcl 38 set ref 85* 86 86 86 88 91* 92 92 92 94 101* 102 113* 115 Lmax 000101 automatic fixed bin(21,0) dcl 38 set ref 99* 102* 102 108 Lret 000102 automatic fixed bin(21,0) dcl 38 set ref 78* 81 84 86 88 90 92 94 96 NL 001104 constant char(1) initial unaligned dcl 69 ref 117 Nargs 000103 automatic fixed bin(17,0) dcl 38 set ref 78* 80 89 100 112 Parg 000104 automatic pointer dcl 38 set ref 85* 86 86 88 91* 92 92 94 101* 113* 115 Parg_list 000106 automatic pointer dcl 38 set ref 105* 113* Pret 000110 automatic pointer dcl 38 set ref 78* 81 84 86 86 88 88 90 90 92 92 94 94 96 96 SPACE 001103 constant char(1) initial unaligned dcl 69 ref 114 addr builtin function dcl 57 ref 118 118 142 142 145 145 147 147 addrel builtin function dcl 57 ref 118 118 arg based char unaligned dcl 50 set ref 86 86* 88 92 92* 94 115 code 000112 automatic fixed bin(35,0) dcl 38 set ref 78* 79 85* 91* 101* 113* 118* copied_string 000102 automatic varying char dcl 131 set ref 140* 142* 142 143* 143 147* 147 148 cu_$af_arg_ptr 000012 constant entry external dcl 60 ref 85 91 cu_$af_return_arg 000010 constant entry external dcl 60 ref 78 cu_$arg_list_ptr 000016 constant entry external dcl 60 ref 105 cu_$arg_ptr 000014 constant entry external dcl 60 ref 101 cu_$arg_ptr_rel 000020 constant entry external dcl 60 ref 113 i 000100 automatic fixed bin(17,0) dcl 128 in procedure "double_quotes" set ref 137* 138 141 142 144 145* i 000100 automatic fixed bin(17,0) dcl 109 in begin block on line 106 set ref 112* 113* 114* i 000113 automatic fixed bin(17,0) dcl 38 in procedure "string" set ref 89* 91* 100* 101* iox_$put_chars 000022 constant entry external dcl 60 ref 118 iox_$user_output 000024 external static pointer dcl 69 set ref 118* j 000101 automatic fixed bin(17,0) dcl 128 set ref 139* 142 144* 144 145 145 147 147 length builtin function dcl 57 ref 118 118 131 145 147 ret based varying char dcl 50 set ref 81* 84* 86* 86 88* 88 90* 90 92* 92 94* 94 96* 96 search builtin function dcl 57 ref 86 92 137 145 string parameter char unaligned dcl 126 set ref 122 131 137 138 142 145 145 147 147 string_array based char(1) array unaligned dcl 133 set ref 142 145 147 string_begin based char unaligned dcl 133 ref 142 string_end based char unaligned dcl 133 ref 145 147 the_string 000100 automatic varying char dcl 108 set ref 111* 114* 114 115* 115 117* 117 118 118 118 118 NAMES DECLARED BY EXPLICIT CONTEXT. double_quotes 000513 constant entry internal dcl 122 ref 86 92 string 000005 constant entry external dcl 35 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 1220 1246 1107 1230 Length 1416 1107 26 134 110 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME string 104 external procedure is an external procedure. begin block on line 106 86 begin block uses auto adjustable storage. double_quotes 76 internal procedure uses auto adjustable storage, and uses returns(char(*)) or returns(bit(*)). STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME begin block on line 106 000100 i begin block on line 106 000100 the_string begin block on line 106 double_quotes 000100 i double_quotes 000101 j double_quotes 000102 copied_string double_quotes string 000100 Larg string 000101 Lmax string 000102 Lret string 000103 Nargs string 000104 Parg string 000106 Parg_list string 000110 Pret string 000112 code string 000113 i string THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. enter_begin leave_begin call_ext_out call_int_this_desc return alloc_auto_adj shorten_stack ext_entry int_entry_desc return_chars_eis THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. cu_$af_arg_ptr cu_$af_return_arg cu_$arg_list_ptr cu_$arg_ptr cu_$arg_ptr_rel iox_$put_chars THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. iox_$user_output LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 35 000004 78 000012 79 000026 80 000030 81 000032 82 000043 84 000044 85 000055 86 000074 88 000144 89 000160 90 000167 91 000177 92 000214 94 000264 95 000300 96 000302 97 000312 99 000313 100 000315 101 000324 102 000341 103 000345 105 000347 106 000356 108 000361 111 000372 112 000373 113 000402 114 000422 115 000435 116 000452 117 000454 118 000464 119 000510 154 000511 122 000512 131 000526 137 000536 138 000553 139 000563 140 000565 141 000566 142 000570 143 000611 144 000623 145 000625 146 000645 147 000646 148 000673 ----------------------------------------------------------- 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