COMPILATION LISTING OF SEGMENT im_create_cursor Compiled by: Multics PL/I Compiler, Release 33e, of October 6, 1992 Compiled at: CGI Compiled on: 2000-05-05_1827.79_Fri_mdt Options: optimize map 1 /* *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Information Systems Inc., 1983 * 4* * * 5* *********************************************************** */ 6 /* format: style2,ind3 */ 7 im_create_cursor: 8 create_cursor: 9 proc (p_file_opening_id, p_collection_id, p_work_area_ptr, p_index_cursor_ptr, p_code); 10 11 /* DESCRIPTION 12* Allocates a index_cursor structure in the provided work area. This 13* cursor is tailored for the index collection with which it is to be used. 14* Its initial position is at the beginning of the collection. 15**/ 16 17 /* Written by Matthew Pierret. 18*Modified: 19*08/09/82 by Matthew Pierret: Changed p_collection_id from "fixed bin (17)" to 20* "bit (36) aligned". 21*09/01/82 by Lindsey Spratt: Changed to use version 2 of the index_cursor. 22*02/28/83 by Lindsey Spratt: Changed to use version 3 of the index_cursor. 23* Added the $destroy entry. 24**/ 25 26 /* START OF DECLARATIONS */ 27 /* Parameter */ 28 29 dcl p_file_opening_id bit (36) aligned; 30 dcl p_collection_id bit (36) aligned; 31 dcl p_work_area_ptr ptr; 32 dcl p_index_cursor_ptr ptr; 33 dcl p_code fixed bin (35); 34 35 /* Automatic */ 36 37 dcl work_area_ptr ptr; 38 dcl myname init ("im_create_cursor") char (32) varying; 39 dcl cks_length fixed bin (24); 40 41 /* Based */ 42 43 dcl work_area area (sys_info$max_seg_size) based (work_area_ptr); 44 dcl current_key_string bit (cks_length) based; 45 46 /* Builtin */ 47 48 dcl null builtin; 49 50 /* Condition */ 51 52 dcl area condition; 53 54 /* Constant */ 55 /* Entry */ 56 57 dcl sub_err_ entry options (variable); 58 59 /* External */ 60 61 dcl ( 62 error_table_$area_too_small, 63 error_table_$unimplemented_version, 64 dm_error_$wrong_cursor_type 65 ) ext fixed bin (35); 66 dcl sys_info$max_seg_size ext fixed bin (35); 67 68 /* END OF DECLARATIONS */ 69 70 work_area_ptr = p_work_area_ptr; 71 72 on area 73 begin; 74 p_code = error_table_$area_too_small; 75 goto RETURN; 76 end; 77 78 alloc index_cursor in (work_area); 79 index_cursor.version = INDEX_CURSOR_VERSION_3; 80 index_cursor.type = INDEX_CURSOR_TYPE; 81 index_cursor.area_ptr = work_area_ptr; 82 index_cursor.file_opening_id = p_file_opening_id; 83 index_cursor.collection_id = p_collection_id; 84 index_cursor.key_id_string = "0"b; 85 index_cursor.current_key_string_ptr = null; 86 index_cursor.current_key_string_length = 0; 87 string (index_cursor.flags) = "0"b; 88 index_cursor.flags.is_at_beginning_of_index = "1"b; 89 index_cursor.flags.is_valid = "1"b; 90 p_index_cursor_ptr = index_cursor_ptr; 91 92 p_code = 0; 93 RETURN: 94 return; 95 96 destroy: 97 entry (p_index_cursor_ptr, p_code); 98 myname = "im_create_cursor$destroy"; 99 index_cursor_ptr = p_index_cursor_ptr; 100 if index_cursor.type ^= INDEX_CURSOR_TYPE 101 then call 102 sub_err_ (dm_error_$wrong_cursor_type, myname, "s", null, 0, 103 "^/Expected an index cursor, type ^d. Received a cursor of type ^d.", INDEX_CURSOR_TYPE, index_cursor.type); 104 105 call check_version ((index_cursor.version), (INDEX_CURSOR_VERSION_3), "index_cursor"); 106 p_code = 0; 107 108 work_area_ptr = index_cursor.area_ptr; 109 if index_cursor.current_key_string_ptr ^= null 110 then 111 do; 112 cks_length = index_cursor.current_key_string_length; 113 free index_cursor.current_key_string_ptr -> current_key_string in (work_area); 114 end; 115 free index_cursor in (work_area); 116 p_index_cursor_ptr = null; 117 return; 118 119 check_version: 120 proc (p_received_version, p_expected_version, p_structure_name); 121 122 dcl p_received_version fixed bin (35); 123 dcl p_expected_version fixed bin (35); 124 dcl p_structure_name char (*); 125 126 if p_received_version ^= p_expected_version 127 then call 128 sub_err_ (error_table_$unimplemented_version, myname, "s", null, 0, 129 "^/Expected version ^d of the ^a structure. 130 Received version ^d, instead.", p_expected_version, p_structure_name, p_received_version); 131 132 end check_version; 133 1 1 /* BEGIN INCLUDE FILE - dm_im_cursor.incl.pl1 */ 1 2 1 3 /* DESCRIPTION: 1 4* 1 5* This structure specifies a DM file, an index collection in that DM 1 6*file, and a position (key) in that index collection. 1 7* 1 8**/ 1 9 1 10 /* HISTORY: 1 11* 1 12*Written by Lindsey Spratt, 03/29/82 1 13*Modified: 1 14*08/09/82 by Matthew Pierret: Changed collection_id from "fixed bin (17)" to 1 15* "bit (35) aligned". 1 16*08/26/82 by Lindsey Spratt: Changed to version 2. Added the is_valid and 1 17* is_at_end_of_index flags. Changed the key_check_value to fixed 1 18* bin (35). Added the IM_HASH_BIAS, which is used to increment the 1 19* value developed by hash_index_, and IM_HASH_NUMBER_OF_BUCKETS, 1 20* which is a unique number used by hash_index_ to develop the 1 21* key_check_value. 1 22*02/23/83 by Lindsey Spratt: Changed to keep the current key value in the 1 23* cursor. Also, implemented the ability to have the cursor 1 24* positioned before or after the index. 1 25*10/23/84 by Lindsey L. Spratt: Added a description section. 1 26**/ 1 27 1 28 /* format: style2,ind3 */ 1 29 dcl 1 index_cursor based (index_cursor_ptr), 1 30 2 type fixed bin (17) unaligned, 1 31 2 version fixed bin (17) unaligned, 1 32 2 file_opening_id bit (36) aligned, 1 33 2 collection_id bit (36) aligned, 1 34 2 key_id_string bit (36) aligned, /* Is the location of the current key, */ 1 35 /* if flags.current_key_exists is on. Is the location */ 1 36 /* of the end of the index if flags.is_at_end_of_index */ 1 37 /* is on, which is only available via an operation */ 1 38 /* requiring the "previous" key. Is the location of */ 1 39 /* the "next" key, otherwise. */ 1 40 2 area_ptr ptr, /* Area in which the cursor and key_string area allocated. */ 1 41 /* Must be a freeing area. */ 1 42 2 current_key_string_ptr 1 43 ptr, /* Points to the value of the current key. */ 1 44 2 current_key_string_length 1 45 fixed bin (24) unal, /* Is the length of the current key in bits. */ 1 46 2 pad bit (12) unal, 1 47 2 flags aligned, 1 48 3 is_at_beginning_of_index 1 49 bit (1) unaligned, /* Only the "next" key is defined. */ 1 50 3 is_at_end_of_index 1 51 bit (1) unaligned, /* Only the "previous" key is defined. */ 1 52 3 current_key_exists 1 53 bit (1) unaligned, /* If on, indicates that the "current" key is identified */ 1 54 /* by the key_id_string. If off, the "current" position */ 1 55 /* is undefined, and the key_id_string identifies the */ 1 56 /* previous or next key, depending on whether */ 1 57 /* flags.is_at_end_of_index is off or on, respectively. */ 1 58 3 is_valid bit (1) unaligned, /* If off, the index_manager_ was interrupted while */ 1 59 /* setting the cursor position and the cursor is not */ 1 60 /* to be trusted for relative position operations. */ 1 61 3 pad bit (32) unal; 1 62 1 63 1 64 dcl index_cursor_ptr ptr; 1 65 1 66 dcl INDEX_CURSOR_VERSION_3 fixed bin (17) init (3) internal static options (constant); 1 67 dcl INDEX_CURSOR_TYPE init (2) fixed bin (17) internal static options (constant); 1 68 1 69 /* END INCLUDE FILE - dm_im_cursor.incl.pl1 */ 134 135 136 end im_create_cursor; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 05/05/00 1827.7 im_create_cursor.pl1 >udd>sm>ds>w>ml>im_create_cursor.pl1 134 1 01/07/85 0958.9 dm_im_cursor.incl.pl1 >ldd>incl>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. INDEX_CURSOR_TYPE 000014 constant fixed bin(17,0) initial dcl 1-67 set ref 80 100 100* INDEX_CURSOR_VERSION_3 constant fixed bin(17,0) initial dcl 1-66 ref 79 105 area 000114 stack reference condition dcl 52 ref 72 area_ptr 4 based pointer level 2 dcl 1-29 set ref 81* 108 cks_length 000113 automatic fixed bin(24,0) dcl 39 set ref 112* 113 113 collection_id 2 based bit(36) level 2 dcl 1-29 set ref 83* current_key_string based bit packed unaligned dcl 44 ref 113 current_key_string_length 10 based fixed bin(24,0) level 2 packed packed unaligned dcl 1-29 set ref 86* 112 current_key_string_ptr 6 based pointer level 2 dcl 1-29 set ref 85* 109 113 dm_error_$wrong_cursor_type 000016 external static fixed bin(35,0) dcl 61 set ref 100* error_table_$area_too_small 000012 external static fixed bin(35,0) dcl 61 ref 74 error_table_$unimplemented_version 000014 external static fixed bin(35,0) dcl 61 set ref 126* file_opening_id 1 based bit(36) level 2 dcl 1-29 set ref 82* flags 12 based structure level 2 dcl 1-29 set ref 87* index_cursor based structure level 1 unaligned dcl 1-29 set ref 78 115 index_cursor_ptr 000122 automatic pointer dcl 1-64 set ref 78* 79 80 81 82 83 84 85 86 87 88 89 90 99* 100 100 105 108 109 112 113 115 is_at_beginning_of_index 12 based bit(1) level 3 packed packed unaligned dcl 1-29 set ref 88* is_valid 12(03) based bit(1) level 3 packed packed unaligned dcl 1-29 set ref 89* key_id_string 3 based bit(36) level 2 dcl 1-29 set ref 84* myname 000102 automatic varying char(32) initial dcl 38 set ref 38* 98* 100* 126* null builtin function dcl 48 ref 85 100 100 109 116 126 126 p_code parameter fixed bin(35,0) dcl 33 set ref 7 7 74* 92* 96 106* p_collection_id parameter bit(36) dcl 30 ref 7 7 83 p_expected_version parameter fixed bin(35,0) dcl 123 set ref 119 126 126* p_file_opening_id parameter bit(36) dcl 29 ref 7 7 82 p_index_cursor_ptr parameter pointer dcl 32 set ref 7 7 90* 96 99 116* p_received_version parameter fixed bin(35,0) dcl 122 set ref 119 126 126* p_structure_name parameter char packed unaligned dcl 124 set ref 119 126* p_work_area_ptr parameter pointer dcl 31 ref 7 7 70 sub_err_ 000010 constant entry external dcl 57 ref 100 126 type based fixed bin(17,0) level 2 packed packed unaligned dcl 1-29 set ref 80* 100 100* version 0(18) based fixed bin(17,0) level 2 packed packed unaligned dcl 1-29 set ref 79* 105 work_area based area dcl 43 ref 78 113 115 work_area_ptr 000100 automatic pointer dcl 37 set ref 70* 78 81 108* 113 115 NAME DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. sys_info$max_seg_size external static fixed bin(35,0) dcl 66 NAMES DECLARED BY EXPLICIT CONTEXT. RETURN 000226 constant label dcl 93 ref 75 check_version 000401 constant entry internal dcl 119 ref 105 create_cursor 000111 constant entry external dcl 7 destroy 000233 constant entry external dcl 96 im_create_cursor 000127 constant entry external dcl 7 NAME DECLARED BY CONTEXT OR IMPLICATION. string builtin function ref 87 STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 632 652 516 642 Length 1044 516 20 155 114 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME create_cursor 214 external procedure is an external procedure. on unit on line 72 64 on unit check_version internal procedure shares stack frame of external procedure create_cursor. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME create_cursor 000100 work_area_ptr create_cursor 000102 myname create_cursor 000113 cks_length create_cursor 000122 index_cursor_ptr create_cursor THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. call_ext_out_desc return_mac tra_ext_1 enable_op ext_entry int_entry op_alloc_ op_freen_ THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. sub_err_ THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. dm_error_$wrong_cursor_type error_table_$area_too_small error_table_$unimplemented_version LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 38 000075 7 000104 70 000142 72 000146 74 000162 75 000165 78 000170 79 000175 80 000177 81 000201 82 000203 83 000206 84 000210 85 000211 86 000213 87 000217 88 000220 89 000222 90 000224 92 000225 93 000226 96 000227 98 000246 99 000253 100 000256 105 000337 106 000354 108 000355 109 000360 112 000365 113 000370 115 000374 116 000376 117 000400 119 000401 126 000412 132 000476 ----------------------------------------------------------- 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