/* the control block */ dcl indx_cb_ptr ptr; dcl 1 indx_cb based (indx_cb_ptr), /* except as noted, init by create cb */ 2 fcb_ptr ptr, 2 file_base_ptr ptr, 2 node_length fixed, /* number of bytes in node, init by create_seg_ptrs */ 2 half_node_length fixed, /* init by create_seg_ptrs */ 2 max_record_size fixed (21), /* init by create_seg_ptrs */ 2 seg_ptr_array_ptr ptr, /* init by create seg_ptrs */ 2 seg_ptr_array_limit fixed, /* init by create seg_ptrs */ 2 mode fixed, 2 is_sequential_open bit (1) aligned, 2 is_read_only bit (1) aligned, 2 is_ks_out bit (1) aligned, /* position info */ 2 position_stack_ptr ptr, /* init by create_position stack */ 2 position_stack_height fixed, /* init by create position stack */ 2 root_position_ptr ptr, /* init by create_position_stack */ 2 file_position_ptr ptr, /* not init */ 2 change_position_ptr ptr, /* not init */ /* auxiliary variables */ 2 rover_seg_ptr ptr, /* init by create_seg_ptrs */ 2 index_state_ptr ptr, /* init by create_seg_ptrs */ 2 old_index_height fixed, 2 old_last_comp_num fixed, 2 last_change_count fixed (35), 2 wait_time fixed (35), 2 old_rover_comp_num fixed, 2 file_state_ptr ptr, 2 o_s_ptr ptr, 2 repeating bit (1) aligned, 2 next_substate fixed, 2 file_program_version fixed, /* used for record_lock compatibility */ 2 leave_locked bit (1) aligned, /* indicates use of set_file_lock order */ 2 dup_ok bit (1) aligned, /* if set, duplicate keys may occur */ 2 read_exclu bit (1) aligned, /* set when lock excludes readers */ 2 pos_incorrect bit (1) aligned, /* indicates index position is not current */ 2 saved_lock_copy bit (36) aligned, /* copy of process lock_id */ 2 min_key_len fixed, /* non-zero only in old programs */ 2 stat bit (1) aligned, /* causes write_record to create stationary records */ 2 current_subset fixed (34), /* used with select order */ 2 last_subset fixed (34), 2 subset_count fixed (34), /* count of descriptors in current subset */ 2 temp_iocbp ptr, /* temporary file used to implement select order */ 2 trans bit (1) aligned, /* set if -transaction attachment */ 2 transaction_code fixed (35), /* set for control switch only */ 2 tcfp ptr, /* ptr to iocb for transaction control switch--if applicable */ 2 reflp ptr, /* ptr to ref list file, set only in transaction control file */ 2 uid bit (36) aligned, /* used under -transaction */ 2 collection_delay_time fixed (35), /* microseconds to wait before garbage removal */ 2 min_res fixed (21), /* for min_block_size order */ 2 min_cap fixed (21), /* also for min_block_size order */ 2 subset_selected bit (2) aligned, /* first bit for select, second bit is for exclude */ 2 error, /* for error_status order */ 3 type fixed, /* only one error type supported now */ 3 requested fixed (34), /* skip arg given to position entry */ 3 received fixed (34), /* actual successful skips */ 2 state_vars, 3 fixed_state_part, 4 shared bit (1) aligned, 4 next_record_position fixed, /* 0, 1, or 2 */ 4 current_record_is_valid bit (1) aligned, 4 ready_to_write bit (1) aligned, 4 at_eof_or_bof, 5 at_bof bit (1) unal, 5 at_eof bit (1) unal, 5 pad bit (36) unal, 4 outside_index bit (1) aligned, /* set after deleting current key or after use of record_status with locate switch */ 4 current_descrip fixed (35), /* needed when outside index */ 4 saved_descrip fixed (35), /* for restoring index position */ 4 skip_state fixed, /* controls scanning of deleted entries */ 3 new_key char (256) var; dcl current_t_code fixed (35) based (addr (indx_cb.tcfp -> iocb.open_data_ptr -> indx_cb.transaction_code)); /* component locator structures */ dcl seg_ptr_array (0:seg_ptr_array_limit) ptr based (seg_ptr_array_ptr); dcl seg_ptr ptr; dcl seg_array (0:262143) fixed (19) based (seg_ptr) aligned; dcl designator fixed (35); dcl 1 ind_des_structure based, 2 comp fixed (17) unal, 2 offset bit (18) unal; dcl 1 stat_structure based, 2 pad bit (26) unal, 2 ref_count_after fixed (16) unsigned unal, 2 ind_comp fixed (13) unal, 2 ref_count fixed (16) unsigned unal, 2 record_lock bit (36) aligned, 2 modifier fixed (35), 2 time_stamp_words fixed (71) aligned, 2 prev_mod fixed (35), 2 record char (1000000) var; dcl 1 ind_structure based, 2 pad bit (26) unal, 2 ref_count_after fixed (16) unsigned unal, 2 ind_comp fixed (13) unal, 2 ref_count fixed (16) unsigned unal, 2 record_lock bit (36) aligned, 2 modifier fixed (35), 2 time_stamp_words fixed (71) aligned, 2 prev_mod fixed (35), 2 prev_desc fixed (35); dcl 1 time_stamp_structure based, 2 ind_offset bit (18) unal, 2 time_last_modified fixed (54) unsigned unal; dcl 1 record_block_structure based, 2 reserved aligned, /* data used by change_record_list */ 3 pad bit (2) unal, 3 block_size fixed (19) unal, 3 lock_flag bit (1) unal, /* record lock flag */ 3 stationary bit (1) unal, 3 indirect bit (1) unal, 3 after_applies bit (1) unal, 3 mbz bit (10) unal, 2 block_tail, /* structure varies with record type */ 3 record char (1000000) var; /* non-stat record location */ dcl 1 designator_struct aligned based (addr (designator)), 2 comp_num fixed (17) unal, 2 offset bit (18) unal; /* position and node templates */ dcl 1 position_frame based (pos_ptr), /* ref8 */ 2 parent_position_ptr ptr, 2 son_position_ptr ptr, 2 node_ptr ptr, 2 node fixed (35), 2 branch_num fixed; dcl 1 node_block based (node_ptr), /* ref9) */ 2 last_branch_num fixed, 2 low_key_pos fixed, 2 scat_space fixed, 2 branch_and_descrip (1 refer (node_block.last_branch_num)), /* in last element only branch is used */ 3 branch fixed (35), 3 descrip, 4 key_descrip, 5 key_pos fixed (17) unal, 5 key_length fixed (17) unal, 4 record_descrip, 5 record_designator fixed (35); dcl keys char (4096 /* 4*node_size */) based (node_ptr); /* file base and states */ dcl f_b_ptr ptr; dcl 1 file_base based (f_b_ptr), /* ref10 */ 2 common_header, 3 file_code fixed (35), 3 lock_word bit (36) aligned, 3 words (2) fixed, 2 file_version fixed, 2 program_version fixed, 2 node_size fixed (19), 2 minimum_key_length fixed, 2 minimum_block_size fixed (19), 2 max_seg_limit fixed (19), 2 root_node_block, 3 last_branch_num_root fixed, /* =1 */ 3 word fixed, 3 reserved fixed, 3 only_branch_in_root fixed (35), 2 file_state fixed, 2 change_count fixed (34), /* record state info, ref12 */ 2 old_number_of_free_blocks fixed (34), 2 prior_block_size fixed (19), 2 old_record_length fixed (21), 2 need_new_seg bit (1) aligned, 2 old_residue fixed, 2 new_last_comp_num fixed, 2 old_prev_free_block fixed (18), 2 old_next_free_block fixed (18), 2 new_record_length fixed (21), 2 old_record_designator fixed (35), 2 prec_block_was_free bit (1) aligned, 2 next_block_was_free bit (1) aligned, 2 former_block_size fixed (19), 2 old_init_offset fixed (18), 2 old_block_size fixed (19), 2 prev_block_size fixed (19), 2 former_rover_comp_num fixed, 2 former_rover_offset fixed (18), 2 next_block_size fixed (19), 2 next_prev_free_block fixed (18), 2 next_next_free_block fixed (18), 2 saved_ks_out bit (1) aligned, 2 new_descriptor fixed (35), 2 old_last_branch_num fixed, 2 old_low_key_pos fixed, 2 old_scat_space fixed, 2 old_key_pos fixed, 2 rover_comp_num fixed, 2 rover_offset fixed (18), 2 old_key_length fixed, 2 b_space fixed, 2 last_b_num fixed, 2 count fixed, 2 first_count fixed, 2 second_count fixed, 2 split_num fixed, 2 must_compact_dest bit (1) aligned, 2 first_branch fixed (35), 2 min_source_key_pos fixed, 2 min_dest_key_pos fixed, 2 new_low_key_pos fixed, 2 new_scat_space fixed, 2 old_seg_lim fixed (19), 2 old_number_of_free_nodes fixed, 2 old_next_node_designator fixed (35), 2 new_index_comp_num fixed, 2 out_of_index bit (1) aligned, 2 saved_min_res fixed (21), 2 saved_min_cap fixed (21), 2 was_stat bit (1) aligned, 2 was_ind bit (1) aligned, 2 old_ind_desc fixed (35), 2 after_desc fixed (35), 2 old_ref_count fixed (34), 2 new_ref_count fixed (34), 2 old_num_free fixed (34), 2 old_file_ch_count fixed (35), 2 y_count, /* for conversion of pre-MR6.9 files */ 2 old_modifier fixed (35), 2 was_transaction bit (1) aligned, /* state blocks */ 2 index_state fixed, 2 index_state_blocks (0:1), 3 words (104), 2 reserved (30), /* this free space might come in handy */ 2 old_prev_mod fixed (35), 2 needed_blksz fixed (35), 2 new_desc_val fixed (35), 2 is_partial_deletion bit (1) aligned, 2 reserved2 (42), 2 file_state_blocks (0:1), 3 words (size (file_state_block)) fixed, /* component info */ 2 max_comp_num fixed, 2 last_comp_num fixed, 2 first_free_comp_num, /* not yet supported */ 2 comp_table_start (size (comp_table)); /* start of comp_array */ dcl 1 comp_table (0:true_max_comp_num) based (addr (file_base.comp_table_start)) aligned, 2 seg_limit fixed (19), /* abs value is offset of first free word in seg, max val=max seg_limit and this indicates full seg */ 2 comp_link fixed (17) unal, 2 init_offset fixed (18) unsigned unal; dcl 1 file_header based (f_b_ptr), 2 first_three_pages (3, 1024) fixed, 2 spare_node char (4096) aligned; /* The File State */ dcl fs_ptr ptr; dcl 1 file_state_block based (fs_ptr), 2 file_action fixed, 2 file_substate fixed, 2 number_of_keys fixed (34), 2 duplicate_keys fixed (34), /* 0 if no duplications */ 2 dup_key_bytes fixed (34), 2 total_key_length fixed (34), 2 number_of_records fixed (34), 2 total_record_length fixed (34), 2 number_of_allocated_records fixed (34), 2 number_of_free_blocks fixed (34), 2 words (2) fixed; /* The Index State */ dcl is_ptr ptr; dcl 1 index_state_block based (is_ptr), /* if this declaration is changed, index_state_blocks must be adjusted */ 2 number_of_nodes fixed (34), 2 free_node_designator fixed (35), 2 index_tail_comp_num fixed, 2 index_height fixed, 2 index_action fixed, 2 index_substate fixed, 2 current_node fixed (35), 2 change_node fixed (35), 2 fake_node, /* equivalent to a short node because of storage map. It holds the new key, new record descrip, and new branch in a fashion convenient for overflow-underflow in change_index. */ 3 fake_head_and_descrip, 4 word1 fixed, /* last_branch_num in real node */ 4 word2 fixed, /* low_key_pos in real node */ 4 word3 fixed, /* normally scat_space */ 4 word4 fixed, /* first branch in real node */ 4 new_key_pos fixed (17) unal, /* set by initializefile to denote first char in new_key_string, never changed */ 4 new_key_length fixed (17) unal, 4 new_record_descrip, 5 new_record_designator fixed (35), 4 new_branch fixed (35), 3 new_key_string char (256), 2 branch_num_adjust fixed, 2 pos_array (10), 3 saved_node fixed (35), 3 saved_branch_num fixed; dcl 1 old_file_base based (f_b_ptr), 2 words1 (15) fixed, /* same in both file versions */ 2 old_file_state_blocks (0:1), 3 words (5) fixed, 2 words2 (7) fixed, 2 record_state fixed, 2 record_state_blocks (0:1), 3 words (4) fixed, 2 words3 (14) fixed, /* rover info same in both versions */ 2 old_version_index_height fixed, 2 old_version_number_of_nodes fixed (34), 2 words4 (157) fixed, 2 old_version_index_tail_comp_num fixed, 2 old_version_free_node_designator fixed (35), 2 words5 (10) fixed, 2 old_version_comp_info fixed, 2 word, 2 x_count fixed; /* always zero in old version files */ /* External Procedures */ dcl clock_ entry returns (fixed (71)); dcl alloc_cb_file entry (fixed, /* size of block in words */ ptr); /* ptr to block */ dcl free_cb_file entry (fixed, ptr); dcl get_seg_ptr entry (ptr, fixed) returns (ptr); dcl make_designator entry (fixed, fixed (18), fixed (35)); dcl create_seg_ptrs entry (ptr); dcl free_seg_ptrs entry (ptr); dcl get_new_seg entry (ptr, fixed, ptr, fixed, label); dcl free_seg entry (ptr, fixed, ptr); dcl set_bitcounts entry (ptr); dcl create_position_stack entry (ptr); dcl extend_position_stack entry (ptr); dcl free_position_stack entry (ptr); dcl change_index entry (ptr, label); dcl change_record_list entry (ptr, fixed, ptr, label); /* State Constants */ %include vfile_action_codes; /* Other constants */ dcl true_max_comp_num static options (constant) init (1250); dcl stat_header_size static internal fixed options (constant) init (8); /* builtins */ dcl (verify, reverse) builtin; dcl addr builtin; dcl divide builtin; dcl length builtin; dcl null builtin; dcl substr builtin; dcl size builtin; dcl abs builtin; dcl unspec builtin; dcl fixed builtin; dcl bit builtin; dcl max builtin; dcl min builtin; dcl rel builtin; */ ----------------------------------------------------------- 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 */