COMPILATION LISTING OF SEGMENT mdc_parse_acct_ Compiled by: Multics PL/I Compiler, Release 32f, of October 9, 1989 Compiled at: Bull HN, Phoenix AZ, System-M Compiled on: 11/11/89 1020.9 mst Sat Options: optimize map 1 /****^ *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Bull Inc., 1987 * 4* * * 5* * Copyright, (C) Honeywell Information Systems Inc., 1982 * 6* * * 7* * Copyright (c) 1972 by Massachusetts Institute of * 8* * Technology and Honeywell Information Systems, Inc. * 9* * * 10* *********************************************************** */ 11 12 13 /* MDC_PARSE_ACCT_: Contains entries for parsing user.project.tag strings */ 14 15 /* Written April 1976 by Larry Johnson */ 16 17 mdc_parse_acct_: proc (arg_acct, arg_person, arg_project, arg_code); 18 19 dcl arg_acct char (*); /* Account name to parse */ 20 dcl arg_person char (*); /* Person will be returned here */ 21 dcl arg_project char (*); /* Project will be returned here */ 22 dcl arg_code fixed bin (35); 23 24 dcl acct char (32); 25 dcl person char (22); 26 dcl project char (9); 27 dcl tag char (1); 28 dcl i fixed bin; 29 dcl star_sw bit (1); /* Set if "*" should be substituted for "" */ 30 31 dcl check_ascii (4) bit (72) int static options (constant) init ((4) (8)"110000000"b); 32 33 dcl get_group_id_$tag_star entry returns (char (32)); 34 35 dcl error_table_$mdc_illegal_account ext fixed bin (35); 36 37 dcl (index, length, substr, unspec) builtin; 38 39 /* The normal entry starts here. Stars are not substituted for blank components */ 40 41 star_sw = "0"b; 42 go to start; 43 44 /* Enter here to have stars substituted for missing components */ 45 46 star: entry (arg_acct, arg_person, arg_project, arg_code); 47 48 star_sw = "1"b; 49 50 /* Now parse it */ 51 52 start: 53 if length (arg_acct) > length (acct) then /* If given long string, be sure it isn't truncated */ 54 if substr (arg_acct, length (acct) + 1) ^= "" then go to bad; 55 56 acct = arg_acct; 57 if acct = "" then acct = get_group_id_$tag_star (); /* A standard default */ 58 59 if unspec (acct) & unspec (check_ascii) then go to bad; /* Crude test for good ascii */ 60 61 i = index (acct, " "); /* Check for imbedded blanks */ 62 if i > 0 then if substr (acct, i) ^= "" then go to bad; 63 64 call next_component (person); /* Remove person */ 65 call next_component (project); /* Remove project */ 66 call next_component (tag); /* Remove tag */ 67 68 if acct ^= "" then go to bad; /* String should be exhausted by now */ 69 70 if star_sw then do; /* Substitute stars for blanks */ 71 if person = "" then person = "*"; 72 if project = "" then project = "*"; 73 end; 74 75 arg_person = person; /* Done */ 76 arg_project = project; 77 arg_code = 0; 78 return; 79 80 bad: arg_person, arg_project = ""; 81 arg_code = error_table_$mdc_illegal_account; 82 return; 83 84 /* This entry just returns the name of the default account */ 85 86 default: entry (arg_person, arg_project); 87 88 arg_person = "Initializer"; 89 arg_project = "SysDaemon"; 90 return; 91 92 /* Internal procedure that strips the next component off the input string */ 93 94 next_component: proc (s); 95 96 dcl s char (*); 97 98 if acct = "" then do; /* If string is exhausted */ 99 s = ""; 100 return; 101 end; 102 103 i = index (acct, "."); /* Find bounds of component */ 104 105 if i = 0 then do; /* No more points */ 106 i = index (acct, " "); /* Find end of word */ 107 if i = 0 then i = length (acct) + 1; 108 if i - 1 > length (s) then go to bad; /* Too long */ 109 s = acct; /* Use rest of string */ 110 acct = ""; /* String exhausted */ 111 end; 112 else if i = 1 then do; /* Point is first */ 113 s = ""; /* This component is null */ 114 acct = substr (acct, 2); /* Strip off point */ 115 end; 116 else do; /* Something before point */ 117 if i - 1 > length (s) then go to bad; /* Too much */ 118 s = substr (acct, 1, i - 1); /* Copy it */ 119 if i + 1 > length (acct) then acct = ""; /* Finished out string */ 120 else acct = substr (acct, i + 1); /* Save rest */ 121 end; 122 123 return; 124 125 end next_component; 126 127 end mdc_parse_acct_; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/11/89 0802.5 mdc_parse_acct_.pl1 >spec>install>1111>mdc_parse_acct_.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. acct 000100 automatic char(32) packed unaligned dcl 24 set ref 52 52 56* 57 57* 59 61 62 68 98 103 106 107 109 110* 114* 114 118 119 119* 120* 120 arg_acct parameter char packed unaligned dcl 19 ref 17 46 52 52 56 arg_code parameter fixed bin(35,0) dcl 22 set ref 17 46 77* 81* arg_person parameter char packed unaligned dcl 20 set ref 17 46 75* 80* 86 88* arg_project parameter char packed unaligned dcl 21 set ref 17 46 76* 80* 86 89* check_ascii 000000 constant bit(72) initial array packed unaligned dcl 31 ref 59 error_table_$mdc_illegal_account 000012 external static fixed bin(35,0) dcl 35 ref 81 get_group_id_$tag_star 000010 constant entry external dcl 33 ref 57 i 000122 automatic fixed bin(17,0) dcl 28 set ref 61* 62 62 103* 105 106* 107 107* 108 112 117 118 119 120 index builtin function dcl 37 ref 61 103 106 length builtin function dcl 37 ref 52 52 52 107 108 117 119 person 000110 automatic char(22) packed unaligned dcl 25 set ref 64* 71 71* 75 project 000116 automatic char(9) packed unaligned dcl 26 set ref 65* 72 72* 76 s parameter char packed unaligned dcl 96 set ref 94 99* 108 109* 113* 117 118* star_sw 000123 automatic bit(1) packed unaligned dcl 29 set ref 41* 48* 70 substr builtin function dcl 37 ref 52 62 114 118 120 tag 000121 automatic char(1) packed unaligned dcl 27 set ref 66* unspec builtin function dcl 37 ref 59 59 NAMES DECLARED BY EXPLICIT CONTEXT. bad 000251 constant label dcl 80 ref 52 59 62 68 108 117 default 000302 constant entry external dcl 86 mdc_parse_acct_ 000031 constant entry external dcl 17 next_component 000342 constant entry internal dcl 94 ref 64 65 66 star 000061 constant entry external dcl 46 start 000107 constant label dcl 52 ref 42 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 606 622 521 616 Length 774 521 14 136 65 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME mdc_parse_acct_ 105 external procedure is an external procedure. next_component internal procedure shares stack frame of external procedure mdc_parse_acct_. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME mdc_parse_acct_ 000100 acct mdc_parse_acct_ 000110 person mdc_parse_acct_ 000116 project mdc_parse_acct_ 000121 tag mdc_parse_acct_ 000122 i mdc_parse_acct_ 000123 star_sw mdc_parse_acct_ THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. call_ext_out return_mac ext_entry_desc THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. get_group_id_$tag_star THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. error_table_$mdc_illegal_account LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 17 000024 41 000055 42 000056 46 000057 48 000105 52 000107 56 000121 57 000127 59 000142 61 000146 62 000157 64 000171 65 000174 66 000177 68 000202 70 000206 71 000210 72 000217 75 000226 76 000236 77 000246 78 000250 80 000251 81 000271 82 000275 86 000276 88 000321 89 000331 90 000341 94 000342 98 000353 99 000357 100 000364 103 000365 105 000376 106 000377 107 000410 108 000413 109 000416 110 000424 111 000427 112 000430 113 000432 114 000440 115 000443 117 000444 118 000447 119 000457 120 000467 123 000475 ----------------------------------------------------------- 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