COMPILATION LISTING OF SEGMENT ted_tabin_ Compiled by: Multics PL/I Compiler, Release 27d, of October 11, 1982 Compiled at: Honeywell LISD Phoenix, System M Compiled on: 11/23/82 1458.4 mst Tue Options: optimize map 1 /* *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Information Systems Inc., 1982 * 4* * * 5* *********************************************************** */ 6 /**** format: ind3,ll80,initcol6,indattr,^inddcls,dclind4,idind16 */ 7 /**** format: struclvlind2,^ifthenstmt,^ifthendo,^ifthen,^indnoniterdo */ 8 /**** format: ^inditerdo,^indnoniterend,^indthenelse,case,^indproc,^indend */ 9 /**** format: ^delnl,^insnl,comcol41,^indcom,^indblkcom,linecom,^indcomtxt */ 10 11 ted_tabin_: /* convert SPs to HTs, rtrim */ 12 proc (ted_support_p, msg, code); 13 14 dcl msg char (168) var, 15 code fixed bin (35); 16 17 if (ted_support.version ^= ted_support_version_2) 18 then do; 19 code = error_table_$unimplemented_version; 20 return; 21 end; 22 req.nc = req.cc; /* any request data after be used */ 23 SPct, HTct, vis = 0; /* assumes starting at beg-of-line */ 24 do i = inp.sb to inp.se; /* step thru all chars addressed */ 25 ch = ichr (i); /* get next char */ 26 ochr (out.de + 1) = ch; /* and put it */ 27 out.de = out.de + 1; /* ..to output segment */ 28 if (ch = SP) 29 then do; /* we have a space */ 30 SPct = SPct + 1; /* count the space string */ 31 vis = vis + 1; /* count the visible location */ 32 if (mod (vis, 10) = 0) 33 then do; /* if reached a tabstop.. */ 34 if (SPct > 1) 35 then do; /* ..and more than one space here */ 36 out.de = out.de - SPct; 37 ochr (out.de + 1) = HT; /* replace the spaces with an HT */ 38 out.de = out.de + 1; 39 HTct = HTct + 1; /* (count how HTs here) */ 40 end; 41 SPct = 0; /* no spaces left over here */ 42 end; 43 end; 44 else if (ch = HT) 45 then do; /* we have a tab */ 46 if (SPct > 0) 47 then do; /* ..and there were spaces before */ 48 out.de = out.de - SPct; 49 ochr (out.de + 1) = HT; /* strip 'em out */ 50 out.de = out.de + 1; 51 end; 52 SPct = 0; 53 vis = vis + mod (vis, 10); /* keep track of visual position */ 54 HTct = HTct + 1; 55 end; 56 else if (ch = NL) 57 then do; /* we have hit end of line */ 58 out.de = out.de - SPct - HTct - 1; /* strip trailing HT,SPs */ 59 ochr (out.de + 1) = NL; 60 out.de = out.de + 1; 61 SPct, HTct, vis = 0; /* reset for next line beginning */ 62 end; 63 else do; /* "ordinary" char, it stays */ 64 SPct, HTct = 0; /* no SP,HTs pending */ 65 if (ch = BSP) /* don't let BSPs foul up the */ 66 then vis = vis - 1; /* ..visual position */ 67 else vis = vis + 1; 68 end; 69 end; 70 current = out.de; 71 code = tederror_table_$Copy_Set; 72 return; 1 1 /* BEGIN INCLUDE FILE ..... ted_support.incl.pl1 ..... 03/16/81 */ 1 2 1 3 /* more information may be found in ted_support.gi.info */ 1 4 1 5 dcl ted_support_p ptr; 1 6 dcl ted_support_version_2 fixed bin int static init(2); 1 7 dcl 1 ted_support based(ted_support_p), 1 8 2 version fixed bin, /* 1 */ 1 9 2 addr_ct fixed bin, /* number of addresses given: 0,1,2 (IN) */ 1 10 2 checkpoint entry ( /* routine to update "safe" status (IN) */ 1 11 fixed bin(21), /* amount of input used up */ 1 12 fixed bin(21)), /* amount of output used up */ 1 13 1 14 2 inp, /***** input string parameters */ 1 15 /* The input data may NOT be modified. */ 1 16 3 pt ptr, /* pointer to base of data string (IN) */ 1 17 3 sb fixed bin(21), /* index of addressed string begin (IN) */ 1 18 3 lno fixed bin(21), /* linenumber in data string of sb (IN) */ 1 19 3 se fixed bin(21), /* index of addressed string end (IN/OUT) */ 1 20 3 de fixed bin(21), /* index of data end (IN) */ 1 21 1 22 2 out, /***** output string parameters */ 1 23 3 pt ptr, /* pointer to base of output string (IN) */ 1 24 3 de fixed bin(21), /* index of data end (already copied) (IN/OUT) */ 1 25 3 ml fixed bin(21), /* max length of output string (IN) */ 1 26 1 27 2 req, /***** request string parameters */ 1 28 3 pt ptr, /* pointer to base of request string (IN) */ 1 29 3 cc fixed bin(21), /* index of current character (IN) */ 1 30 3 nc fixed bin(21), /* index of next character (IN/OUT) */ 1 31 3 de fixed bin(21), /* index of data end (IN/OUT) */ 1 32 3 ml fixed bin(21), /* max length of requsest buffer (IN) */ 1 33 1 34 /* req.nc is initialized to req.de, i.e. request line used-up. A routine */ 1 35 /* can set req.nc to 1, put some data into req and set req.de */ 1 36 /* appropriately. The data will be the next ted requests executed after */ 1 37 /* the routine returns. */ 1 38 1 39 /* Or if req.nc is set equal to req.cc then the rest of the request line */ 1 40 /* will be executed after return. */ 1 41 1 42 2 string_mode bit(1), /* 0- line mode, 1- string mode (IN) */ 1 43 2 current fixed bin(21), /* current location (IN/OUT) */ 1 44 /* current is initialized to "undefined" */ 1 45 2 get_req entry (), /* fill the request string with the next line */ 1 46 /* from ted's input stream. req.de will be */ 1 47 /* updated to reflect the new length. */ 1 48 /* req.cc and req.nc are not changed. */ 1 49 2 proc_expr entry /* process the expression for global execution */ 1 50 (ptr, /* -> ted_support structure [IN] */ 1 51 char (168) var, /* message text [OUT] */ 1 52 fixed bin (35)), /* completion code [OUT] */ 1 53 2 do_global entry /* globally execute some action */ 1 54 (entry (), /* worker procedure [IN] */ 1 55 char (1), /* which action, "g" or "v" [IN] */ 1 56 ptr, /* -> ted_support structure [IN] */ 1 57 char (168) var, /* message text [OUT] */ 1 58 fixed bin (35)), /* completion code [OUT] */ 1 59 2 reg_exp_p ptr, /* -> the remembered regular expression area */ 1 60 2 bcb_p ptr; /* -> buffer control block */ 1 61 /* _________________________________________________________________________ */ 1 62 /* ENTRY CONDITIONS */ 1 63 /* _________________________________________________________________________ */ 1 64 /* Upon entering, three substructures describe the environment in which the */ 1 65 /* request is to operate. (Refer to the INPUT diagram) Note that the */ 1 66 /* "normal" operational steps are: */ 1 67 /* 1) ted copies the string from 1:inp.sb-1 to the output string */ 1 68 /* 2) ted_xyz_ takes care of the data from inp.sb:inp.se */ 1 69 /* 3) ted copies the string from inp.se+1:inp.de to the output string */ 1 70 /* The following 3 diagrams represent conditions upon entering ted_xyz_: */ 1 71 /* _________________________________________________________________________ */ 1 72 /* inp.pt (\ represents NL) */ 1 73 /* | */ 1 74 /* [INPUT] now is\the time\for all\good men\to come.\..... */ 1 75 /* | | | */ 1 76 /* inp.sb inp.se inp.de */ 1 77 /* _________________________________________________________________________ */ 1 78 /* out.pt (\ represents NL) */ 1 79 /* | */ 1 80 /* [OUTPUT] ? now is\........................................ */ 1 81 /* | | | */ 1 82 /* current out.de out.ml */ 1 83 /* _________________________________________________________________________ */ 1 84 /* req.pt (\ represents NL) */ 1 85 /* | */ 1 86 /* [REQUEST] x 2,3|req /farfle/ 1,$P\....................... */ 1 87 /* | | | */ 1 88 /* req.cc req.de req.ml */ 1 89 /* req.nc */ 1 90 1 91 /* _________________________________________________________________________ */ 1 92 /* EXIT CONDITIONS */ 1 93 /* _________________________________________________________________________ */ 1 94 /* Assume a request replaces the addressed lines with the string following */ 1 95 /* it, (in this case "farfle") and leaves "." at the beginning of the range. */ 1 96 /* out.pt (\ represents NL) */ 1 97 /* | */ 1 98 /* [OUTPUT] now is\farfle\farfle\.......................... */ 1 99 /* | | | */ 1 100 /* current out.de out.ml */ 1 101 /* _________________________________________________________________________ */ 1 102 /* 1) If the data after the string are to be treated as more ted requests, */ 1 103 /* the request data would be left like this. */ 1 104 /* req.pt (\ represents NL) */ 1 105 /* | */ 1 106 /* [REQUEST] x 2,3|req /farfle/ 1,$P\....................... */ 1 107 /* | | | */ 1 108 /* req.nc req.de req.ml */ 1 109 /* _________________________________________________________________________ */ 1 110 /* 2) If the request is going to return a string to be executed, the request */ 1 111 /* data (and buffer) would be left like this: */ 1 112 /* req.pt (\ represents NL) */ 1 113 /* | */ 1 114 /* [REQUEST] -1,.1p w\ /farfle/ 1,$P\....................... */ 1 115 /* | | | */ 1 116 /* req.nc req.de req.ml */ 1 117 1 118 /* These return codes are expected */ 1 119 dcl (tederror_table_$Copy_Set,/* copy rest of input to output, */ 1 120 /* and set "." from current */ 1 121 /* "rest of input" is the string which begins */ 1 122 /* at char inp.se+1 and extends to inp.de. */ 1 123 /* If the input has all been processed, then */ 1 124 /* inp.se should be set to inp.de+1. */ 1 125 tederror_table_$NoChange,/* dont copy, dont set current */ 1 126 tederror_table_$Set, /* dont copy, just set current */ 1 127 /* (in input buffer) */ 1 128 tederror_table_$Error_Msg,/* msg is being returned. */ 1 129 /* no copy or set is done */ 1 130 tederror_table_$No_Delim1,/* missing 1st delimiter */ 1 131 tederror_table_$No_Delim2,/* missing 2nd delimiter */ 1 132 tederror_table_$No_Delim3)/* missing 3nd delimiter */ 1 133 fixed bin(35)ext static; 1 134 dcl error_table_$unimplemented_version fixed bin(35) ext static; 1 135 1 136 dcl istr char(inp.de) based(inp.pt); /* the input string */ 1 137 dcl ichr(inp.de) char(1) based(inp.pt); 1 138 dcl ostr char(out.ml) based(out.pt); /* the output string */ 1 139 dcl ochr(out.ml) char(1) based(out.pt); 1 140 dcl rstr char(req.ml) based(req.pt); /* the request string */ 1 141 dcl rchr(req.ml) char(1) based(req.pt); 1 142 1 143 /* These declarations are used if the expression search is needed by the */ 1 144 /* request. There are 2 parts to getting an expression search done: */ 1 145 /* 1) compiling 2) searching */ 1 146 /* If a function uses the remembered expression, it does this: */ 1 147 /* call tedsrch_$search (ted_support.reg_exp_p, */ 1 148 /* ted_support.bcbp, string_begin, string_end, match_begin, */ 1 149 /* match_end, search_end, msg, code); */ 1 150 1 151 /* If a function utilizes an expression the user supplies, it must first be */ 1 152 /* compiled: 1 153*/* if (expression_length > 0) */ 1 154 /* then call tedsrch_$compile (addr (ichr (expression_begin)), */ 1 155 /* expression_length, ted_support.reg_exp_p, */ 1 156 /* ted_support.string_mode, ""b, msg, code); */ 1 157 /* This results in the remembered expression being changed to the one just */ 1 158 /* compiled. */ 1 159 1 160 /* If a function wishes to utilize a function without it being remembered */ 1 161 /* by ted, it may declare an area of its own and compile into it. It first */ 1 162 /* must be initialized: */ 1 163 /* dcl expr_area (200) bit (36); */ 1 164 /* call tedsrch_$init_exp (addr (expr_area), size (expr_area)); */ 2 1 /* BEGIN INCLUDE FILE ..... tedsrch_.incl.pl1 ..... 10/21/82 J Falksen */ 2 2 2 3 dcl tedsrch_$init_exp entry ( /* initialize an expression area */ 2 4 ptr, /* -> compiled expression area [IN] */ 2 5 fixed bin (21)); /* length of area in words */ 2 6 2 7 dcl tedsrch_$compile entry ( /* compile a regular expression */ 2 8 ptr, /* -> regular expression to search */ 2 9 fixed bin (21), /* length thereof */ 2 10 ptr, /* -> compiled expression area [IN] */ 2 11 bit (1)aligned, /* 0- line mode 1- string mode */ 2 12 bit (1)aligned, /* 0- reg expr 1- literal expr */ 2 13 char (168) var, /* error message [OUT] */ 2 14 fixed bin (35) /* error status code [OUT] */ 2 15 ); 2 16 2 17 dcl tedsrch_$search entry ( /* search for expression */ 2 18 ptr, /* -> compiled expression */ 2 19 ptr, /* -> buffer ctl block for file */ 2 20 fixed bin (21), /* beginning of string to search */ 2 21 fixed bin (21), /* end of string to search */ 2 22 fixed bin (21), /* beginning of match */ 2 23 fixed bin (21), /* end of match */ 2 24 fixed bin (21), /* end of string used for match */ 2 25 char (168)var, /* error message return [OUT] */ 2 26 fixed bin (35) /* error status code [OUT] */ 2 27 ); 2 28 2 29 2 30 /* END INCLUDE FILE ..... tedsrch_.incl.pl1 ..... */ 1 165 1 166 1 167 /* END INCLUDE FILE ..... ted_support.incl.pl1 ..... */ 73 74 75 76 dcl lb fixed bin (24), /* first character to process */ 77 le fixed bin (24); /* last character to process */ 78 79 dcl HTct fixed bin (24); 80 dcl i fixed bin (24); 81 dcl SPct fixed bin (24); 82 dcl ch char (1); 83 dcl vis fixed bin (24); 84 dcl SP char (1) int static init (" "); 85 dcl HT char (1) int static init (" "); 86 dcl BSP char (1) int static init (""); 87 dcl NL char (1) int static init (" 88 "); 89 90 end ted_tabin_; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/23/82 1458.4 ted_tabin_.pl1 >spec>on>ted_fix>ted_tabin_.pl1 73 1 11/23/82 1324.6 ted_support.incl.pl1 >ldd>include>ted_support.incl.pl1 1-165 2 11/23/82 1324.7 tedsrch_.incl.pl1 >ldd>include>tedsrch_.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. BSP constant char(1) initial unaligned dcl 86 ref 65 HT constant char(1) initial unaligned dcl 85 ref 37 44 49 HTct 000100 automatic fixed bin(24,0) dcl 79 set ref 23* 39* 39 54* 54 58 61* 64* NL constant char(1) initial unaligned dcl 87 ref 56 59 SP constant char(1) initial unaligned dcl 84 ref 28 SPct 000102 automatic fixed bin(24,0) dcl 81 set ref 23* 30* 30 34 36 41* 46 48 52* 58 61* 64* cc 22 based fixed bin(21,0) level 3 dcl 1-7 ref 22 ch 000103 automatic char(1) unaligned dcl 82 set ref 25* 26 28 44 56 65 code parameter fixed bin(35,0) dcl 14 set ref 11 19* 71* current 27 based fixed bin(21,0) level 2 dcl 1-7 set ref 70* de 16 based fixed bin(21,0) level 3 dcl 1-7 set ref 26 27* 27 36* 36 37 38* 38 48* 48 49 50* 50 58* 58 59 60* 60 70 error_table_$unimplemented_version 000012 external static fixed bin(35,0) dcl 1-134 ref 19 i 000101 automatic fixed bin(24,0) dcl 80 set ref 24* 25* ichr based char(1) array unaligned dcl 1-137 ref 25 inp 6 based structure level 2 unaligned dcl 1-7 msg parameter varying char(168) dcl 14 ref 11 nc 23 based fixed bin(21,0) level 3 dcl 1-7 set ref 22* ochr based char(1) array unaligned dcl 1-139 set ref 26* 37* 49* 59* out 14 based structure level 2 unaligned dcl 1-7 pt 14 based pointer level 3 in structure "ted_support" dcl 1-7 in procedure "ted_tabin_" ref 26 37 49 59 pt 6 based pointer level 3 in structure "ted_support" dcl 1-7 in procedure "ted_tabin_" ref 25 req 20 based structure level 2 unaligned dcl 1-7 sb 10 based fixed bin(21,0) level 3 dcl 1-7 ref 24 se 12 based fixed bin(21,0) level 3 dcl 1-7 ref 24 ted_support based structure level 1 unaligned dcl 1-7 ted_support_p parameter pointer dcl 1-5 ref 11 17 22 22 24 24 25 26 26 27 27 36 36 37 37 38 38 48 48 49 49 50 50 58 58 59 59 60 60 70 70 ted_support_version_2 constant fixed bin(17,0) initial dcl 1-6 ref 17 tederror_table_$Copy_Set 000010 external static fixed bin(35,0) dcl 1-119 ref 71 version based fixed bin(17,0) level 2 dcl 1-7 ref 17 vis 000104 automatic fixed bin(24,0) dcl 83 set ref 23* 31* 31 32 53* 53 53 61* 65* 65 67* 67 NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. istr based char unaligned dcl 1-136 lb automatic fixed bin(24,0) dcl 76 le automatic fixed bin(24,0) dcl 76 ostr based char unaligned dcl 1-138 rchr based char(1) array unaligned dcl 1-141 rstr based char unaligned dcl 1-140 tederror_table_$Error_Msg external static fixed bin(35,0) dcl 1-119 tederror_table_$NoChange external static fixed bin(35,0) dcl 1-119 tederror_table_$No_Delim1 external static fixed bin(35,0) dcl 1-119 tederror_table_$No_Delim2 external static fixed bin(35,0) dcl 1-119 tederror_table_$No_Delim3 external static fixed bin(35,0) dcl 1-119 tederror_table_$Set external static fixed bin(35,0) dcl 1-119 tedsrch_$compile 000000 constant entry external dcl 2-7 tedsrch_$init_exp 000000 constant entry external dcl 2-3 tedsrch_$search 000000 constant entry external dcl 2-17 NAME DECLARED BY EXPLICIT CONTEXT. ted_tabin_ 000007 constant entry external dcl 11 NAME DECLARED BY CONTEXT OR IMPLICATION. mod builtin function ref 32 53 STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 246 262 172 256 Length 456 172 14 157 53 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME ted_tabin_ 70 external procedure is an external procedure. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME ted_tabin_ 000100 HTct ted_tabin_ 000101 i ted_tabin_ 000102 SPct ted_tabin_ 000103 ch ted_tabin_ 000104 vis ted_tabin_ THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. return mod_fx1 ext_entry NO EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. error_table_$unimplemented_version tederror_table_$Copy_Set LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 11 000003 17 000014 19 000021 20 000023 22 000024 23 000027 24 000032 25 000041 26 000051 27 000056 28 000057 30 000062 31 000063 32 000064 34 000070 36 000073 37 000075 38 000101 39 000102 41 000103 43 000104 44 000105 46 000107 48 000111 49 000113 50 000117 52 000120 53 000121 54 000125 55 000126 56 000127 58 000131 59 000136 60 000141 61 000142 62 000145 64 000146 65 000150 67 000155 69 000156 70 000160 71 000165 72 000170 ----------------------------------------------------------- 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