COMPILATION LISTING OF SEGMENT login_parse_ Compiled by: Multics PL/I Compiler, Release 27d, of October 11, 1982 Compiled at: Honeywell LISD Phoenix, System M Compiled on: 11/12/82 1230.7 mst Fri 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 /* format: style4 */ 12 login_parse_: proc (a_lp, a_ll, a_arg, a_lng, a_used, a_code); 13 14 /* LOGIN_PARSE_ - this parsing routine is used by parse_login_line_ and 15* several other Answering Service programs. It returns the first argument 16* from the line, and tells how many characters were used up. 17* Repeated calls should trim off a_used characters from the front of the line. */ 18 19 /* rewritten 12/28/81 E. N. Kittlitz. added support for quoted arguments, $password entry. */ 20 21 dcl a_lp ptr; /* ptr to input line */ 22 dcl a_ll fixed bin; /* length of input line */ 23 dcl a_arg char (*); /* output argument */ 24 dcl a_lng fixed bin; /* length of output argument */ 25 dcl a_used fixed bin; /* number of characters eaten */ 26 dcl a_code fixed bin (35); /* error code */ 27 28 29 dcl argp fixed bin; /* position in output argument */ 30 dcl arg_rm fixed bin; /* amount of space left in a_arg */ 31 dcl cursor fixed bin; /* logical start of line */ 32 dcl had_quote bit (1) aligned; /* ever see a quotation mark? */ 33 dcl have_quote bit (1) aligned; /* looking at a quoted string, even as we speak */ 34 dcl ll fixed bin; /* line length */ 35 dcl lp ptr; /* pointer to input line */ 36 dcl scan_inc fixed bin; /* used to delete illegal characters */ 37 dcl scan_ln fixed bin; /* used to delete illegal characters */ 38 39 dcl line char (ll) based (lp); 40 41 dcl LEGAL char (93) int static options (constant) init /* Printables except blank, PAD, quote, semicolon, but with BS */ 42 ("!#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~"); 43 dcl PW_LEGAL char (94) int static options (constant) init /* Printables except blank, PAD, semicolon, but with BS */ 44 ("!#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~"""); 45 dcl PW_LEGAL_TRAIL char (3) int static options (constant) init /* space, NL, CR */ 46 (" 47 "); 48 dcl NL char (1) int static options (constant) init (" 49 "); 50 51 dcl error_table_$bad_arg fixed bin (35) ext static; 52 dcl error_table_$noarg fixed bin (35) ext static; 53 dcl error_table_$unbalanced_quotes fixed bin (35) ext static; 54 55 a_lng = 0; /* initialize length */ 56 a_arg = ""; /* initialize output argument */ 57 a_used = 0; /* initialize characters used count */ 58 a_code = 0; /* no errors */ 59 60 lp = a_lp; /* local copy of parameter */ 61 ll = a_ll; /* local copy of parameter */ 62 arg_rm = length (a_arg); /* number of output characters allowed */ 63 64 had_quote, have_quote = ""b; /* never had a quotation mark */ 65 argp = 1; 66 cursor = 1; /* position in line */ 67 68 if ll <= 0 then do; 69 a_code = error_table_$noarg; 70 return; 71 end; 72 73 cursor = verify (line, " "); /* space and TAB */ 74 if cursor = 0 then do; 75 a_used = ll; 76 a_code = error_table_$noarg; 77 return; 78 end; 79 80 if substr (line, cursor, 1) = ";" | /* first thing we get is the end */ 81 substr (line, cursor, 1) = NL then do; 82 a_used = cursor; 83 a_code = error_table_$noarg; 84 end; 85 86 loop: if have_quote then do; 87 scan_ln = search (substr (line, cursor, ll - cursor + 1), """") - 1; 88 if scan_ln < 0 then do; /* unbalanced quotation marks */ 89 unbalanced_quotes: a_code = error_table_$unbalanced_quotes; 90 a_arg = ""; 91 a_used = ll; 92 return; 93 end; 94 end; 95 else do; 96 scan_ln = verify (substr (line, cursor, ll - cursor + 1), LEGAL) - 1; 97 if scan_ln < 0 then scan_ln = ll - cursor + 1; 98 end; 99 substr (a_arg, argp, min (arg_rm, scan_ln)) = substr (line, cursor, scan_ln); /* copy to output argument */ 100 argp = argp + scan_ln; /* bump output index */ 101 arg_rm = max (0, arg_rm - scan_ln); /* decrement output space left */ 102 cursor = cursor + scan_ln; /* skip over those characters */ 103 if cursor > ll then go to done; 104 if substr (line, cursor, 1) = """" then do; 105 cursor = cursor + 1; 106 if ^have_quote then had_quote, have_quote = "1"b; 107 else if cursor > ll then have_quote = ""b; /* end of string */ 108 else if substr (line, cursor, 1) = """" then do; 109 cursor = cursor + 1; 110 substr (a_arg, argp, min (arg_rm, 1)) = """"; /* put a quote into the output */ 111 argp = argp + 1; 112 end; 113 else have_quote = ""b; /* end of quoted string */ 114 end; 115 if cursor <= ll then 116 if have_quote then go to loop; 117 else if index (LEGAL, substr (line, cursor, 1)) > 0 | 118 substr (line, cursor, 1) = """" then go to loop; 119 120 done: 121 if have_quote then go to unbalanced_quotes; 122 123 if argp = 1 then 124 if had_quote then a_lng = 0; 125 else 126 a_code = error_table_$noarg; 127 else a_lng = argp - 1; 128 a_used = min (cursor, ll); 129 130 return; 131 132 133 password: entry (a_lp, a_ll, a_arg, a_lng, a_used, a_code); 134 135 a_lng = 0; /* setup output args */ 136 a_arg = ""; 137 a_used = 0; 138 a_code = 0; 139 140 lp = a_lp; /* initialize */ 141 ll = a_ll; 142 143 if ll <= 0 then do; 144 a_code = error_table_$noarg; 145 return; 146 end; 147 148 cursor = verify (line, " "); /* space and TAB */ 149 if cursor = 0 then do; 150 a_used = ll; 151 a_code = error_table_$noarg; 152 return; 153 end; 154 155 scan_ln = verify (substr (line, cursor, ll - cursor + 1), PW_LEGAL) - 1; 156 if scan_ln < 0 then scan_ln = ll - cursor + 1; 157 else if scan_ln = 0 then do; 158 a_code = error_table_$noarg; 159 a_used = cursor; 160 return; 161 end; 162 substr (a_arg, 1, min (length (a_arg), scan_ln)) = substr (line, cursor, scan_ln); 163 a_used = cursor + scan_ln; 164 a_lng = scan_ln; 165 cursor = cursor + scan_ln; 166 if verify (substr (line, cursor, ll - cursor + 1), PW_LEGAL_TRAIL) > 0 then 167 a_code = error_table_$bad_arg; 168 169 170 end login_parse_; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/12/82 1043.5 login_parse_.pl1 >spec>on>11/12/82>login_parse_.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. LEGAL 000031 constant char(93) initial unaligned dcl 41 ref 96 117 NL constant char(1) initial unaligned dcl 48 ref 80 PW_LEGAL 000001 constant char(94) initial unaligned dcl 43 ref 155 PW_LEGAL_TRAIL 000000 constant char(3) initial unaligned dcl 45 ref 166 a_arg parameter char unaligned dcl 23 set ref 12 56* 62 90* 99* 110* 133 136* 162 162* a_code parameter fixed bin(35,0) dcl 26 set ref 12 58* 69* 76* 83* 89* 125* 133 138* 144* 151* 158* 166* a_ll parameter fixed bin(17,0) dcl 22 ref 12 61 133 141 a_lng parameter fixed bin(17,0) dcl 24 set ref 12 55* 123* 127* 133 135* 164* a_lp parameter pointer dcl 21 ref 12 60 133 140 a_used parameter fixed bin(17,0) dcl 25 set ref 12 57* 75* 82* 91* 128* 133 137* 150* 159* 163* arg_rm 000101 automatic fixed bin(17,0) dcl 30 set ref 62* 99 101* 101 110 argp 000100 automatic fixed bin(17,0) dcl 29 set ref 65* 99 100* 100 110 111* 111 123 127 cursor 000102 automatic fixed bin(17,0) dcl 31 set ref 66* 73* 74 80 80 82 87 87 96 96 97 99 102* 102 103 104 105* 105 107 108 109* 109 115 117 117 128 148* 149 155 155 156 159 162 163 165* 165 166 166 error_table_$bad_arg 000010 external static fixed bin(35,0) dcl 51 ref 166 error_table_$noarg 000012 external static fixed bin(35,0) dcl 52 ref 69 76 83 125 144 151 158 error_table_$unbalanced_quotes 000014 external static fixed bin(35,0) dcl 53 ref 89 had_quote 000103 automatic bit(1) dcl 32 set ref 64* 106* 123 have_quote 000104 automatic bit(1) dcl 33 set ref 64* 86 106 106* 107* 113* 115 120 line based char unaligned dcl 39 ref 73 80 80 87 96 99 104 108 117 117 148 155 162 166 ll 000105 automatic fixed bin(17,0) dcl 34 set ref 61* 68 73 75 80 80 87 87 91 96 96 97 99 103 104 107 108 115 117 117 128 141* 143 148 150 155 155 156 162 166 166 lp 000106 automatic pointer dcl 35 set ref 60* 73 80 80 87 96 99 104 108 117 117 140* 148 155 162 166 scan_ln 000110 automatic fixed bin(17,0) dcl 37 set ref 87* 88 96* 97 97* 99 99 100 101 102 155* 156 156* 157 162 162 163 164 165 NAME DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. scan_inc automatic fixed bin(17,0) dcl 36 NAMES DECLARED BY EXPLICIT CONTEXT. done 000371 constant label dcl 120 ref 103 login_parse_ 000073 constant entry external dcl 12 loop 000172 constant label dcl 86 ref 115 117 password 000420 constant entry external dcl 133 unbalanced_quotes 000213 constant label dcl 89 ref 120 NAMES DECLARED BY CONTEXT OR IMPLICATION. index builtin function ref 117 length builtin function ref 62 162 max builtin function ref 101 min builtin function ref 99 110 128 162 search builtin function ref 87 substr builtin function set ref 80 80 87 96 99* 99 104 108 110* 117 117 155 162* 162 166 verify builtin function ref 73 96 148 155 166 STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 2052 2070 1771 2062 Length 2244 1771 16 137 61 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME login_parse_ 75 external procedure is an external procedure. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME login_parse_ 000100 argp login_parse_ 000101 arg_rm login_parse_ 000102 cursor login_parse_ 000103 had_quote login_parse_ 000104 have_quote login_parse_ 000105 ll login_parse_ 000106 lp login_parse_ 000110 scan_ln login_parse_ THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. return ext_entry_desc NO EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. error_table_$bad_arg error_table_$noarg error_table_$unbalanced_quotes LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 12 000065 55 000106 56 000110 57 000114 58 000115 60 000116 61 000121 62 000123 64 000125 65 000127 66 000131 68 000132 69 000134 70 000136 73 000137 74 000151 75 000152 76 000154 77 000156 80 000157 82 000167 83 000170 86 000172 87 000174 88 000212 89 000213 90 000217 91 000224 92 000226 94 000227 96 000230 97 000247 99 000253 100 000270 101 000272 102 000300 103 000302 104 000305 105 000311 106 000312 107 000320 108 000325 109 000331 110 000332 111 000342 112 000343 113 000344 115 000345 117 000352 120 000371 123 000373 125 000402 127 000406 128 000410 130 000415 133 000416 135 000433 136 000435 137 000442 138 000443 140 000444 141 000447 143 000451 144 000452 145 000455 148 000456 149 000470 150 000471 151 000473 152 000476 155 000477 156 000515 157 000522 158 000523 159 000526 160 000530 162 000531 163 000540 164 000543 165 000545 166 000546 170 000567 ----------------------------------------------------------- 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