COMPILATION LISTING OF SEGMENT cmcs_expand_tree_path_ Compiled by: Multics PL/I Compiler, Release 31b, of April 24, 1989 Compiled at: Bull HN, Phoenix AZ, System-M Compiled on: 05/24/89 1031.7 mst Wed Options: optimize map 1 /****^ *********************************************************** 2* * * 3* * Copyright, (C) BULL HN Information Systems Inc., 1989 * 4* * * 5* * Copyright, (C) Honeywell Information Systems Inc., 1981 * 6* * * 7* *********************************************************** */ 8 9 10 11 12 /****^ HISTORY COMMENTS: 13* 1) change(89-04-23,Zimmerman), approve(89-04-23,MCR8060), 14* audit(89-05-05,RWaters), install(89-05-24,MR12.3-1048): 15* MCR8060 cmcs_expand_tree_path_.pl1 Reformatted code to new Cobol standard. 16* END HISTORY COMMENTS */ 17 18 19 /* Modified since Version 4.3 */ 20 21 /* format: style3 */ 22 cmcs_expand_tree_path_: 23 proc (a_input, a_tree_path, a_code); 24 25 /* This COBOL MCS subroutine is used by the CMCS command interfaces to expand 26* the short-form tree path (no blanks, period delimiters) into the proper 27* 48-character internal representation. The level_names can be from 1-12 chars 28* in length and must be period separated. Blanks may appear only on 29* the trailing end of the input string. Errors will be returned 30* if there are more than three periods, intervening blanks, adjacent periods, 31* and level_names outside the length of 1-12 characters. 32* 33* Bob May, 6/30/77 */ 34 35 dcl a_input char (*), 36 a_tree_path char (48), 37 a_code fixed bin (35); 38 39 dcl cmcs_error_table_$bad_tree_path 40 fixed bin (35) external; 41 42 dcl buffer char (51), 43 buffer_left_begin fixed bin, 44 buffer_left_len fixed bin; 45 46 dcl end_sw bit (1), 47 (i, j) fixed bin; 48 49 dcl tree_path_ptr ptr; 50 51 dcl 1 tree_path based (tree_path_ptr), 52 2 level_names (4) char (12); 53 54 dcl level_no fixed bin; 55 56 dcl (index, length, search, substr, verify) 57 builtin; 58 59 /* */ 60 61 /* Preliminary Checks */ 62 63 if length (a_input) = 0 | length (a_input) > 51 64 then go to bad_tree_path; 65 if substr (a_input, 1, 1) = "." | substr (a_input, 1, 1) = " " 66 then go to bad_tree_path; /* period and blank */ 67 68 /* Initialization */ 69 70 tree_path_ptr = addr (a_tree_path); 71 buffer = a_input; /* copy to fixed space for efficiency */ 72 buffer_left_begin = 1; 73 buffer_left_len = 51; 74 level_no = 0; 75 end_sw = "0"b; 76 77 /* Main Procedure */ 78 79 loop: 80 level_no = level_no + 1; 81 if level_no = 5 82 then go to bad_tree_path; /* data follows level_name-4 */ 83 84 i = index (substr (buffer, buffer_left_begin, buffer_left_len), "."); 85 /* look for another component preceded with "." */ 86 if i = 0 87 then do; /* at least no more periods */ 88 end_sw = "1"b; /* should be last time through */ 89 i = index (substr (buffer, buffer_left_begin, buffer_left_len), " "); 90 /* trailing blanks? */ 91 if i = 0 92 then do; /* no, use all that remains */ 93 i = buffer_left_len; 94 end; 95 else do; /* found trailing blank */ 96 if buffer_left_begin + i < 53 97 then if verify (substr (buffer, buffer_left_begin + i), " ") ^= 0 98 /* look for data after blank */ 99 then go to bad_tree_path; 100 101 i = i - 1; /* adjust field length to elim blank */ 102 end; 103 end; 104 else i = i - 1; /* found a period, set i to length of level_name */ 105 106 /* validate level name */ 107 108 if i = 0 109 then go to bad_tree_path; 110 if i > 12 111 then go to bad_tree_path; /* must be 1-12 chars long */ 112 113 level_names (level_no) = substr (buffer, buffer_left_begin, i); 114 if level_names (level_no) = " " 115 then go to bad_tree_path; /* tried to slip it in between good delims */ 116 if ^end_sw 117 then do; 118 buffer_left_begin = buffer_left_begin + i + 1; 119 buffer_left_len = buffer_left_len - i - 1; 120 /* include the trailing "." as well */ 121 go to loop; 122 end; 123 124 /* Finish Up */ 125 126 if level_no ^= 4 127 then do i = level_no + 1 to 4; /* blank out all trailing level names */ 128 level_names (i) = ""; 129 end; 130 131 a_code = 0; 132 return; 133 134 bad_tree_path: 135 a_code = cmcs_error_table_$bad_tree_path; 136 a_tree_path = ""; /* make sure they can't use anything */ 137 return; 138 139 end /* cmcs_expand_tree_path_ */; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 05/24/89 0837.3 cmcs_expand_tree_path_.pl1 >spec>install>MR12.3-1048>cmcs_expand_tree_path_.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. a_code parameter fixed bin(35,0) dcl 35 set ref 22 131* 134* a_input parameter char packed unaligned dcl 35 ref 22 63 63 65 65 71 a_tree_path parameter char(48) packed unaligned dcl 35 set ref 22 70 136* buffer 000100 automatic char(51) packed unaligned dcl 42 set ref 71* 84 89 96 113 buffer_left_begin 000115 automatic fixed bin(17,0) dcl 42 set ref 72* 84 89 96 96 113 118* 118 buffer_left_len 000116 automatic fixed bin(17,0) dcl 42 set ref 73* 84 89 93 119* 119 cmcs_error_table_$bad_tree_path 000010 external static fixed bin(35,0) dcl 39 ref 134 end_sw 000117 automatic bit(1) packed unaligned dcl 46 set ref 75* 88* 116 i 000120 automatic fixed bin(17,0) dcl 46 set ref 84* 86 89* 91 93* 96 96 101* 101 104* 104 108 110 113 118 119 126* 128* index builtin function dcl 56 ref 84 89 length builtin function dcl 56 ref 63 63 level_names based char(12) array level 2 packed packed unaligned dcl 51 set ref 113* 114 128* level_no 000124 automatic fixed bin(17,0) dcl 54 set ref 74* 79* 79 81 113 114 126 126 substr builtin function dcl 56 ref 65 65 84 89 96 113 tree_path based structure level 1 packed packed unaligned dcl 51 tree_path_ptr 000122 automatic pointer dcl 49 set ref 70* 113 114 128 verify builtin function dcl 56 ref 96 NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. j automatic fixed bin(17,0) dcl 46 search builtin function dcl 56 NAMES DECLARED BY EXPLICIT CONTEXT. bad_tree_path 000220 constant label dcl 134 ref 63 65 81 96 108 110 114 cmcs_expand_tree_path_ 000007 constant entry external dcl 22 loop 000053 constant label dcl 79 ref 121 NAME DECLARED BY CONTEXT OR IMPLICATION. addr builtin function ref 70 STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 276 310 232 306 Length 460 232 12 133 43 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME cmcs_expand_tree_path_ 88 external procedure is an external procedure. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME cmcs_expand_tree_path_ 000100 buffer cmcs_expand_tree_path_ 000115 buffer_left_begin cmcs_expand_tree_path_ 000116 buffer_left_len cmcs_expand_tree_path_ 000117 end_sw cmcs_expand_tree_path_ 000120 i cmcs_expand_tree_path_ 000122 tree_path_ptr cmcs_expand_tree_path_ 000124 level_no cmcs_expand_tree_path_ THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. return_mac ext_entry_desc NO EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. cmcs_error_table_$bad_tree_path LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 22 000003 63 000022 65 000026 70 000040 71 000042 72 000045 73 000047 74 000051 75 000052 79 000053 81 000054 84 000057 86 000072 88 000073 89 000075 91 000106 93 000107 94 000111 96 000112 101 000135 103 000137 104 000140 108 000142 110 000144 113 000146 114 000156 116 000162 118 000164 119 000170 121 000174 126 000175 128 000205 129 000213 131 000215 132 000217 134 000220 136 000224 137 000230 ----------------------------------------------------------- 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