COMPILATION LISTING OF SEGMENT im_get_key_count_array Compiled by: Multics PL/I Compiler, Release 29, of July 28, 1986 Compiled at: Honeywell Bull, Phx. Az., Sys-M Compiled on: 04/02/87 1309.4 mst Thu Options: optimize map 1 /* *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Information Systems Inc., 1982 * 4* * * 5* *********************************************************** */ 6 7 /* DESCRIPTION: 8* This subroutine returns the key_count_array for a given index 9* collection. 10**/ 11 12 /* HISTORY: 13*Written by Lindsey L. Spratt, 12/06/82. 14*Modified: 15*02/28/83 by Lindsey Spratt: Changed to use version 3 of the index_cursor. 16*03/23/83 by Lindsey Spratt: Changed to use version 2 of the field_table. 17*05/04/84 by Matthew Pierret: Changed to use FIELD_TABLE_VERSION_3. 18*10/28/84 by Lindsey L. Spratt: Changed to use version 4 index_opening_info. 19* Changed to use ERROR_RETURN; Changed to simply return 20* index_opening_info.key_count_array_ptr. 21*01/10/85 by Lindsey L. Spratt: Removed some unreferenced include files. 22*03/07/85 by R. Michael Tague: Changed opening info version to version 3. 23**/ 24 25 /* format: style2,ind3 */ 26 27 im_get_key_count_array: 28 proc (p_index_cursor_ptr, p_work_area_ptr, p_key_count_array_ptr, p_code); 29 30 /* START OF DECLARATIONS */ 31 /* Parameter */ 32 33 dcl p_index_cursor_ptr ptr parameter; 34 dcl p_work_area_ptr ptr parameter; 35 dcl p_key_count_array_ptr ptr parameter; 36 dcl p_code fixed bin (35) parameter; 37 38 /* Automatic */ 39 40 dcl work_area_ptr ptr init (null); 41 42 /* Based */ 43 44 dcl work_area area based (work_area_ptr); 45 46 /* Builtin */ 47 48 dcl (addr, null) builtin; 49 50 /* Constant */ 51 52 dcl myname init ("im_get_key_count_array") char (32) varying internal static options (constant); 53 54 /* Entry */ 55 56 dcl im_get_opening_info entry (bit (36) aligned, bit (36) aligned, ptr, fixed bin (35)); 57 58 dcl sub_err_ entry () options (variable); 59 60 /* External */ 61 62 dcl error_table_$unimplemented_version 63 fixed bin (35) ext; 64 65 /* END OF DECLARATIONS */ 66 67 index_cursor_ptr = p_index_cursor_ptr; 68 work_area_ptr = p_work_area_ptr; 69 call CHECK_VERSION ((index_cursor.version), (INDEX_CURSOR_VERSION_3), "index_cursor"); 70 71 call im_get_opening_info (index_cursor.file_opening_id, index_cursor.collection_id, index_opening_info_ptr, p_code); 72 if p_code ^= 0 73 then call ERROR_RETURN (p_code); 74 75 call CHECK_VERSION_CHAR (index_opening_info.version, INDEX_OPENING_INFO_VERSION_3, "index_opening_info"); 76 77 call CHECK_VERSION_CHAR (index_opening_info.key_count_array_ptr -> key_count_array.version, 78 KEY_COUNT_ARRAY_VERSION_2, "key_count_array"); 79 80 kca_number_of_counts = index_opening_info.key_count_array_ptr -> key_count_array.number_of_counts; 81 82 alloc key_count_array in (work_area); 83 key_count_array = index_opening_info.key_count_array_ptr -> key_count_array; 84 85 p_key_count_array_ptr = key_count_array_ptr; 86 87 MAIN_RETURN: 88 return; 89 90 91 ERROR_RETURN: 92 proc (er_p_code); 93 dcl er_p_code fixed bin (35) parameter; 94 p_code = er_p_code; 95 goto MAIN_RETURN; 96 end ERROR_RETURN; 97 98 CHECK_VERSION: 99 proc (p_received_version, p_expected_version, p_structure_name); 100 dcl p_received_version fixed bin (35); 101 dcl p_expected_version fixed bin (35); 102 dcl p_structure_name char (*); 103 if p_received_version ^= p_expected_version 104 then call sub_err_ (error_table_$unimplemented_version, myname, ACTION_CANT_RESTART, null, 0, 105 "^/Expected version ^d of the ^a structure. 106 Received version ^d instead.", p_expected_version, p_structure_name, p_received_version); 107 end CHECK_VERSION; 108 109 CHECK_VERSION_CHAR: 110 proc (p_received_version, p_expected_version, p_structure_name); 111 112 dcl (p_expected_version, p_received_version) 113 char (8) aligned parameter; 114 dcl p_structure_name char (*) parameter; 115 116 if p_expected_version ^= p_received_version 117 then call sub_err_ (error_table_$unimplemented_version, myname, ACTION_CANT_RESTART, null, 0, 118 "^/Expected version ^a of the ^a structure. 119 Received version ^a, instead.", p_expected_version, p_structure_name, p_received_version); 120 end CHECK_VERSION_CHAR; 121 1 1 /* BEGIN INCLUDE FILE sub_err_flags.incl.pl1 BIM 11/81 */ 1 2 /* format: style3 */ 1 3 1 4 /* These constants are to be used for the flags argument of sub_err_ */ 1 5 /* They are just "string (condition_info_header.action_flags)" */ 1 6 1 7 declare ( 1 8 ACTION_CAN_RESTART init (""b), 1 9 ACTION_CANT_RESTART init ("1"b), 1 10 ACTION_DEFAULT_RESTART 1 11 init ("01"b), 1 12 ACTION_QUIET_RESTART 1 13 init ("001"b), 1 14 ACTION_SUPPORT_SIGNAL 1 15 init ("0001"b) 1 16 ) bit (36) aligned internal static options (constant); 1 17 1 18 /* End include file */ 122 123 2 1 /* BEGIN INCLUDE FILE - dm_key_count_array.incl.pl1 */ 2 2 2 3 2 4 2 5 /****^ HISTORY COMMENTS: 2 6* 1) change(87-01-15,Hergert), approve(87-04-01,MCR7632), 2 7* audit(87-02-09,Dupuis), install(87-04-02,MR12.1-1020): 2 8* Added the KEY_COUNT_OFFSET_IN_CHARACTERS. This is the offset from the 2 9* beginning of the structure to the element key_count_array.count in 2 10* characters. Using this it is possible to calculate the key_count_array_ptr 2 11* given the "addr (key_count_array.count (0))". 2 12* END HISTORY COMMENTS */ 2 13 2 14 2 15 /* DESCRIPTION: 2 16* 2 17* The key_count_array holds counts of the number of unique key values 2 18* in an index. These values are used by the search optimization done by 2 19* MRDS. count(0) is the number of keys in the index. count(N) is the 2 20* number of keys in the index which have at least fields 1 through N 2 21* having the same value as another key in the index, i.e. count(N) 2 22* is the number of partial duplicates with number of partial 2 23* duplication fields equal to N. 2 24* 2 25**/ 2 26 2 27 /* HISTORY: 2 28* 2 29*Written by Lindsey Spratt, 11/09/82. 2 30*Modified: 2 31*10/27/84 by Lindsey L. Spratt: Changed the version to char(8) aligned. 2 32* Added a description, fixed the history section. 2 33**/ 2 34 2 35 /* format: style2,ind3 */ 2 36 dcl 1 key_count_array aligned based (key_count_array_ptr), 2 37 2 version char (8) aligned, 2 38 2 number_of_counts fixed bin (17) unal, 2 39 2 pad bit (18) unal, 2 40 2 count (0:kca_number_of_counts refer (key_count_array.number_of_counts)) fixed 2 41 bin (35) aligned; 2 42 2 43 dcl KEY_COUNT_ARRAY_VERSION_2 2 44 init ("KeyCnt 2") char (8) aligned internal static options (constant); 2 45 dcl KEY_COUNT_OFFSET_IN_CHARACTERS 2 46 init (12) fixed bin internal static options (constant); 2 47 2 48 dcl key_count_array_ptr ptr init (null); 2 49 dcl kca_number_of_counts fixed bin (17) init (0); 2 50 2 51 2 52 /* END INCLUDE FILE - dm_key_count_array.incl.pl1 */ 124 125 3 1 /* BEGIN INCLUDE FILE - dm_im_opening_info.incl.pl1 */ 3 2 3 3 /* DESRIPTION: 3 4* 3 5* The index_opening_info is per-process information, stored in a 3 6* hash_table managed by the opening_manager_, which allows the 3 7* index_manager_ to quickly reference certain unchanging pieces of 3 8* information rapidly. 3 9**/ 3 10 3 11 /* HISTORY: 3 12* 3 13*Written by Lindsey Spratt, 10/28/82. 3 14*Modified: 3 15*10/26/84 by Lindsey L. Spratt: Changed version to char(8). Added a 3 16* description. Added the current_rollback_count. Added the 3 17* key_count_array_ptr. 3 18*03/07/85 by R. Michael Tague: Added key_count_increments_ptr and 3 19* key_counts_postcommit_written. Changed to version 3. 3 20*03/25/85 by R. Michael Tague: Added key_count_unprotected_file. This 3 21* flag is used by im_update_opening_info to help it maintain the 3 22* key count array info. 3 23**/ 3 24 3 25 /* format: style2,ind3 */ 3 26 dcl 1 index_opening_info based (index_opening_info_ptr) aligned, 3 27 2 version char (8) aligned, 3 28 2 file_opening_id bit (36) aligned, 3 29 2 collection_id bit (36) aligned, 3 30 2 index_header_ptr ptr init (null), 3 31 2 field_table_ptr ptr init (null), 3 32 2 key_count_array_ptr 3 33 ptr init (null), 3 34 2 key_count_increments_ptr 3 35 ptr init (null), 3 36 2 flags, 3 37 3 key_count_postcommit_written 3 38 bit (1) unal init ("0"b), 3 39 3 key_count_unprotected_file 3 40 bit (1) unal init ("0"b), 3 41 3 pad bit (34) unal init (""b), 3 42 2 current_txn_id fixed bin (35) init (0), 3 43 2 current_rollback_count 3 44 fixed bin (35) init (0); 3 45 3 46 dcl index_opening_info_ptr ptr init (null); 3 47 dcl INDEX_OPENING_INFO_VERSION_3 3 48 init ("IdxOpn 3") char (8) aligned internal static options (constant); 3 49 3 50 /* END INCLUDE FILE - dm_im_opening_info.incl.pl1 */ 126 127 4 1 /* BEGIN INCLUDE FILE - dm_im_cursor.incl.pl1 */ 4 2 4 3 /* DESCRIPTION: 4 4* 4 5* This structure specifies a DM file, an index collection in that DM 4 6*file, and a position (key) in that index collection. 4 7* 4 8**/ 4 9 4 10 /* HISTORY: 4 11* 4 12*Written by Lindsey Spratt, 03/29/82 4 13*Modified: 4 14*08/09/82 by Matthew Pierret: Changed collection_id from "fixed bin (17)" to 4 15* "bit (35) aligned". 4 16*08/26/82 by Lindsey Spratt: Changed to version 2. Added the is_valid and 4 17* is_at_end_of_index flags. Changed the key_check_value to fixed 4 18* bin (35). Added the IM_HASH_BIAS, which is used to increment the 4 19* value developed by hash_index_, and IM_HASH_NUMBER_OF_BUCKETS, 4 20* which is a unique number used by hash_index_ to develop the 4 21* key_check_value. 4 22*02/23/83 by Lindsey Spratt: Changed to keep the current key value in the 4 23* cursor. Also, implemented the ability to have the cursor 4 24* positioned before or after the index. 4 25*10/23/84 by Lindsey L. Spratt: Added a description section. 4 26**/ 4 27 4 28 /* format: style2,ind3 */ 4 29 dcl 1 index_cursor based (index_cursor_ptr), 4 30 2 type fixed bin (17) unaligned, 4 31 2 version fixed bin (17) unaligned, 4 32 2 file_opening_id bit (36) aligned, 4 33 2 collection_id bit (36) aligned, 4 34 2 key_id_string bit (36) aligned, /* Is the location of the current key, */ 4 35 /* if flags.current_key_exists is on. Is the location */ 4 36 /* of the end of the index if flags.is_at_end_of_index */ 4 37 /* is on, which is only available via an operation */ 4 38 /* requiring the "previous" key. Is the location of */ 4 39 /* the "next" key, otherwise. */ 4 40 2 area_ptr ptr, /* Area in which the cursor and key_string area allocated. */ 4 41 /* Must be a freeing area. */ 4 42 2 current_key_string_ptr 4 43 ptr, /* Points to the value of the current key. */ 4 44 2 current_key_string_length 4 45 fixed bin (24) unal, /* Is the length of the current key in bits. */ 4 46 2 pad bit (12) unal, 4 47 2 flags aligned, 4 48 3 is_at_beginning_of_index 4 49 bit (1) unaligned, /* Only the "next" key is defined. */ 4 50 3 is_at_end_of_index 4 51 bit (1) unaligned, /* Only the "previous" key is defined. */ 4 52 3 current_key_exists 4 53 bit (1) unaligned, /* If on, indicates that the "current" key is identified */ 4 54 /* by the key_id_string. If off, the "current" position */ 4 55 /* is undefined, and the key_id_string identifies the */ 4 56 /* previous or next key, depending on whether */ 4 57 /* flags.is_at_end_of_index is off or on, respectively. */ 4 58 3 is_valid bit (1) unaligned, /* If off, the index_manager_ was interrupted while */ 4 59 /* setting the cursor position and the cursor is not */ 4 60 /* to be trusted for relative position operations. */ 4 61 3 pad bit (32) unal; 4 62 4 63 4 64 dcl index_cursor_ptr ptr; 4 65 4 66 dcl INDEX_CURSOR_VERSION_3 fixed bin (17) init (3) internal static options (constant); 4 67 dcl INDEX_CURSOR_TYPE init (2) fixed bin (17) internal static options (constant); 4 68 4 69 /* END INCLUDE FILE - dm_im_cursor.incl.pl1 */ 128 129 end im_get_key_count_array; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 04/02/87 1304.9 im_get_key_count_array.pl1 >spec>install>MR12.1-1020>im_get_key_count_array.pl1 122 1 04/16/82 0958.1 sub_err_flags.incl.pl1 >ldd>include>sub_err_flags.incl.pl1 124 2 04/02/87 1300.6 dm_key_count_array.incl.pl1 >spec>install>MR12.1-1020>dm_key_count_array.incl.pl1 126 3 04/05/85 0924.4 dm_im_opening_info.incl.pl1 >ldd>include>dm_im_opening_info.incl.pl1 128 4 01/07/85 0858.9 dm_im_cursor.incl.pl1 >ldd>include>dm_im_cursor.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. ACTION_CANT_RESTART 000004 constant bit(36) initial dcl 1-7 set ref 103* 116* INDEX_CURSOR_VERSION_3 constant fixed bin(17,0) initial dcl 4-66 ref 69 INDEX_OPENING_INFO_VERSION_3 000000 constant char(8) initial dcl 3-47 set ref 75* KEY_COUNT_ARRAY_VERSION_2 000002 constant char(8) initial dcl 2-43 set ref 77* collection_id 2 based bit(36) level 2 dcl 4-29 set ref 71* er_p_code parameter fixed bin(35,0) dcl 93 ref 91 94 error_table_$unimplemented_version 000014 external static fixed bin(35,0) dcl 62 set ref 103* 116* file_opening_id 1 based bit(36) level 2 dcl 4-29 set ref 71* im_get_opening_info 000010 constant entry external dcl 56 ref 71 index_cursor based structure level 1 unaligned dcl 4-29 index_cursor_ptr 000110 automatic pointer dcl 4-64 set ref 67* 69 71 71 index_opening_info based structure level 1 dcl 3-26 index_opening_info_ptr 000106 automatic pointer initial dcl 3-46 set ref 71* 75 77 80 83 3-46* kca_number_of_counts 000104 automatic fixed bin(17,0) initial dcl 2-49 set ref 80* 82 82 2-49* key_count_array based structure level 1 dcl 2-36 set ref 82 83* 83 key_count_array_ptr 000102 automatic pointer initial dcl 2-48 in procedure "im_get_key_count_array" set ref 82* 83 85 2-48* key_count_array_ptr 10 based pointer initial level 2 in structure "index_opening_info" dcl 3-26 in procedure "im_get_key_count_array" ref 77 80 83 myname 000005 constant varying char(32) initial dcl 52 set ref 103* 116* null builtin function dcl 48 ref 40 2-48 3-46 103 103 116 116 number_of_counts 2 based fixed bin(17,0) level 2 packed unaligned dcl 2-36 set ref 80 82* 83 p_code parameter fixed bin(35,0) dcl 36 set ref 27 71* 72 72* 94* p_expected_version parameter fixed bin(35,0) dcl 101 in procedure "CHECK_VERSION" set ref 98 103 103* p_expected_version parameter char(8) dcl 112 in procedure "CHECK_VERSION_CHAR" set ref 109 116 116* p_index_cursor_ptr parameter pointer dcl 33 ref 27 67 p_key_count_array_ptr parameter pointer dcl 35 set ref 27 85* p_received_version parameter fixed bin(35,0) dcl 100 in procedure "CHECK_VERSION" set ref 98 103 103* p_received_version parameter char(8) dcl 112 in procedure "CHECK_VERSION_CHAR" set ref 109 116 116* p_structure_name parameter char unaligned dcl 102 in procedure "CHECK_VERSION" set ref 98 103* p_structure_name parameter char unaligned dcl 114 in procedure "CHECK_VERSION_CHAR" set ref 109 116* p_work_area_ptr parameter pointer dcl 34 ref 27 68 sub_err_ 000012 constant entry external dcl 58 ref 103 116 version based char(8) level 2 in structure "key_count_array" dcl 2-36 in procedure "im_get_key_count_array" set ref 77* version 0(18) based fixed bin(17,0) level 2 in structure "index_cursor" packed unaligned dcl 4-29 in procedure "im_get_key_count_array" ref 69 version based char(8) level 2 in structure "index_opening_info" dcl 3-26 in procedure "im_get_key_count_array" set ref 75* work_area based area(1024) dcl 44 ref 82 work_area_ptr 000100 automatic pointer initial dcl 40 set ref 40* 68* 82 NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. ACTION_CAN_RESTART internal static bit(36) initial dcl 1-7 ACTION_DEFAULT_RESTART internal static bit(36) initial dcl 1-7 ACTION_QUIET_RESTART internal static bit(36) initial dcl 1-7 ACTION_SUPPORT_SIGNAL internal static bit(36) initial dcl 1-7 INDEX_CURSOR_TYPE internal static fixed bin(17,0) initial dcl 4-67 KEY_COUNT_OFFSET_IN_CHARACTERS internal static fixed bin(17,0) initial dcl 2-45 addr builtin function dcl 48 NAMES DECLARED BY EXPLICIT CONTEXT. CHECK_VERSION 000320 constant entry internal dcl 98 ref 69 CHECK_VERSION_CHAR 000414 constant entry internal dcl 109 ref 75 77 ERROR_RETURN 000312 constant entry internal dcl 91 ref 72 MAIN_RETURN 000311 constant label dcl 87 ref 95 im_get_key_count_array 000122 constant entry external dcl 27 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 616 634 534 626 Length 1104 534 16 234 62 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME im_get_key_count_array 246 external procedure is an external procedure. ERROR_RETURN internal procedure shares stack frame of external procedure im_get_key_count_array. CHECK_VERSION internal procedure shares stack frame of external procedure im_get_key_count_array. CHECK_VERSION_CHAR internal procedure shares stack frame of external procedure im_get_key_count_array. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME im_get_key_count_array 000100 work_area_ptr im_get_key_count_array 000102 key_count_array_ptr im_get_key_count_array 000104 kca_number_of_counts im_get_key_count_array 000106 index_opening_info_ptr im_get_key_count_array 000110 index_cursor_ptr im_get_key_count_array THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. call_ext_out_desc call_ext_out return_mac ext_entry op_alloc_ THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. im_get_opening_info sub_err_ THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. error_table_$unimplemented_version LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 27 000115 40 000127 2 48 000131 2 49 000132 3 46 000133 67 000134 68 000140 69 000143 71 000160 72 000177 75 000210 77 000232 80 000260 82 000265 83 000276 85 000307 87 000311 91 000312 94 000314 95 000317 98 000320 103 000331 107 000413 109 000414 116 000425 120 000515 ----------------------------------------------------------- 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