COMPILATION LISTING OF SEGMENT mrds_dsl_get_scope Compiled by: Multics PL/I Compiler, Release 30, of February 16, 1988 Compiled at: Honeywell Bull, Phoenix AZ, SysM Compiled on: 08/01/88 1326.1 mst Mon Options: optimize map 1 /* *********************************************************** 2* * * 3* * * 4* * Copyright, (C) Honeywell Information Systems Inc., 1981 * 5* * * 6* * * 7* *********************************************************** */ 8 9 /* ****************************************************** 10* * * 11* * * 12* * Copyright (c) 1972 by Massachusetts Institute of * 13* * Technology and Honeywell Information Systems, Inc. * 14* * * 15* * * 16* ****************************************************** */ 17 18 /* HISTORY: 19* 20* Originally written by Jim Gray - - January 1981 21* 22* 83-04-04 Davids: explicitly declared the builtin function empty which was 23* implicitly declared. 24* 25* 83-06-20 Davids: Removed check for old version database and the call 26* to v1 code if it was an old version db (old version dbs can no longer 27* be opened) 28**/ 29 30 mrds_dsl_get_scope: get_scope: procedure 31 (db_index, relation_name, permits, prevents, scope_mode_version, error_code); 32 33 /* DESCRIPTION: 34* 35* This routine will return the scope permit/prevent ops currently 36* set on a given relation for a particular database opening. 37* It also returns the version of the concurrency control in effect, 38* so that the user may know whether to interpret the 39* encodings of 0-1-2-4-8 as n-r-s-d-m or n-r-a-d-m. 40* The permit and prevent arguments are encoded in the same 41* fashion as for the dsl_$set/dl_scope routines. 42* The database opening index may be to a model or submodel opening 43* of any version MRDS database. If the opening is through 44* a submodel, the submodel relation name should be used. 45* 46**/ 47 48 /* PARAMETERS: 49* 50* db_index - - (input) fixed bin(35), the database opening index as returned 51* from a call to dsl_$open. This may be either a model or submodel 52* opening of any version MRDS database. 53* 54* relation_name - - (input) char(*), the name of the relation for which the 55* current scope information is desired. If the opening was through a submodel, 56* then this should be the submodel name of the relation. 57* 58* permits - - (output) fixed bin, the sum of the permited scope modes 59* taken from the encodings 0 = null, 1 = read_attr, 2 = store or append_tuple, 60* 4 = delete_tuple, 8 = modify_attr as used by dsl_$set/dl_scope. 61* 62* prevents - - (output) fixed bin, the sum of the prevented scope modes 63* for this relation, using the same encodings as for permits. 64* 65* scope_mode_version - - (output) fixed bin, the concurrency control 66* version be used by the database. 5 => r-a-m-d, earlier versions 67* make use of r-s-m-d. (outmoded 4 using r-u will not be encountered) 68* 69* error_code - - (output) fixed bin(35), the error status encoding, 0 for 70* a successfull operation. It will be mrds_error_$scope_not_set 71* if no scope is currently set on the relation. An error code of 0, 72* with permit/prevents = 0 indicates null scope has been set. 73* 74**/ 75 76 /* initialize */ 77 78 permits, prevents, scope_mode_version, error_code = 0; 79 80 /* check for a valid database index */ 81 82 call mu_database_index$get_resultant_model_pointer (db_index, dbcb_ptr); 83 if dbcb_ptr = null () then 84 error_code = mrds_error_$invalid_db_index; 85 else do; 86 87 /* get the version of the scope modes */ 88 89 dbc_ptr = dbcb.dbc_ptr; 90 scope_mode_version = dbc.version; 91 92 /* set up the overlay pointers */ 93 94 permit_requests_ptr = addr (permits); 95 prevent_requests_ptr = addr (prevents); 96 97 call get_new_scope; 98 99 end; 100 101 get_new_scope: procedure (); 102 103 /* routine to get r-a-m-d type scope using the latest version of 104* scope_info in the new version resultant model */ 105 106 scope_ptr = dbcb.scope_ptr; 107 if scope_ptr = null then 108 error_code = mrds_error_$non_scope_ready; 109 else do; 110 111 found, finished = OFF; 112 i = 1; 113 114 do while (^finished); 115 116 if relation_name = scope_info.scope (i).sm_name then do; 117 118 permit_requests.read_attr = scope_info.scope (i).flags.permits.read_attr; 119 permit_requests.modify_attr = scope_info.scope (i).flags.permits.modify_attr; 120 permit_requests.append_tuple = scope_info.scope (i).flags.permits.append_tuple; 121 permit_requests.delete_tuple = scope_info.scope (i).flags.permits.delete_tuple; 122 123 prevent_requests.read_attr = scope_info.scope (i).flags.prevents.read_attr; 124 prevent_requests.modify_attr = scope_info.scope (i).flags.prevents.modify_attr; 125 prevent_requests.append_tuple = scope_info.scope (i).flags.prevents.append_tuple; 126 prevent_requests.delete_tuple = scope_info.scope (i).flags.prevents.delete_tuple; 127 128 finished, found = ON; 129 130 end; 131 132 else if i < scope_info.nfiles then 133 i = i + 1; 134 135 else finished = ON; 136 137 end; 138 139 if ^found then 140 error_code = mrds_error_$unknown_relation_name; 141 142 else if ^scope_info.scope (i).flags.touched then 143 error_code = mrds_error_$scope_not_set; 144 145 end; 146 1 1 /* BEGIN mdbm_scope_info.incl.pl1 -- odf 8/8/78 */ 1 2 1 3 /* WARNING 1 4* If the scope_info or scope_flags structure is changed then the 1 5* mrds_data_ item saved_res_version MUST be incremented to invalidate 1 6* all existing saved resultants 1 7**/ 1 8 1 9 /* Modified by Jim Gray - - 80-11-17, to add back store/delete/modify permissions */ 1 10 1 11 /* 80-12-10 Jim Gray : change name of store to append_tuple, delete to delete_tuple, 1 12* modify to modify_attr, retrieve to read_attr, remvoe update, put level 4 1 13* qualifiers for permit/prevent modes and to put pads in standard format */ 1 14 1 15 /* 80-12-11 Jim Gray : added submodel version of file/rel name for convenience */ 1 16 1 17 /* 80-12-22 Jim Gray : added like referenced structure so linus_scope_data.incl 1 18* could make use of it for compatibility. */ 1 19 1 20 /* 81-1-11 Jim Gray : added touched bit to scope_flags, so that 1 21* the fact that null scope has been set can be displayed */ 1 22 1 23 /* 85-04-14 Thanh Nguyen: Made scope_flags to be aligned so we could access the 1 24* prevent flags from any pointer which directly pointed to scope_flags itself 1 25* (i.e rm_rel_info.scope_flags_ptr). */ 1 26 1 27 /* this structure is to be allocated in the mrds_dbcb.incl.pl1 static area, 1 28* and is used to maintain the scope mechanism for file access. 1 29* It contains the scope permit/prevent operations that this user 1 30* has set in his view for this opening instance. */ 1 31 1 32 dcl 1 scope_info aligned based (scope_ptr), /* array of scope tuples for this user */ 1 33 2 mbz1 bit (144), /* Reserved for future use */ 1 34 2 nfiles fixed bin, /* Number of scope tuples in user's scope */ 1 35 2 active_scopes fixed bin, /* number of scopes currently active for a given user */ 1 36 2 scope (max_file_init refer (scope_info.nfiles)), /* defines user's scope of access to files */ 1 37 3 name char (30) aligned, /* filename */ 1 38 3 sm_name char (32), /* name of file(rel) in submodel */ 1 39 3 flags like scope_flags ; 1 40 1 41 1 42 declare 1 scope_flags aligned based, /* common layout of scope flag bits */ 1 43 2 permits, /* modes to permit this user */ 1 44 3 read_attr bit (1) unal, /* read_attr access to this file in scope */ 1 45 3 append_tuple bit (1) unal, /* append_tuple concnrrency permission */ 1 46 3 delete_tuple bit (1) unal, /* delete_tuple concurrency permission on rel */ 1 47 3 modify_attr bit (1) unal, /* modify_attr concurrency permission */ 1 48 3 mbz2 bit (10) unal, /* for expansion of permit ops */ 1 49 2 prevents, /* modes to be denyed to other users */ 1 50 3 read_attr bit (1) unal, /* on if user has prevent on read_attr for this file */ 1 51 3 append_tuple bit (1) unal, /* prevent of append_tuple concurrency */ 1 52 3 delete_tuple bit (1) unal, /* prevent of delete_tuple concurrency */ 1 53 3 modify_attr bit (1) unal, /* prevent of modify_attr concurrency */ 1 54 3 mbz3 bit (10) unal, /* for future prevent concurrency modes */ 1 55 2 touched bit (1) unal, /* on => scope set for this relation */ 1 56 2 mbz4 bit (7) unal ; /* for future flags */ 1 57 1 58 dcl max_file_init fixed bin; /* nbr. of files in data base */ 1 59 dcl scope_ptr ptr init (null ()); /* points to scope_info array */ 1 60 dcl scope_rdy bit (6) unal init ("000011"b) int static options (constant); /* scope file ready modes (5 or 6) */ 1 61 dcl scope_rdy_array (6) bit (1) unal based; /* array format of scope_rdy string */ 1 62 1 63 /* END mdbm_scope_info.incl.pl1 */ 147 148 end; 149 150 declare db_index fixed bin (35); /* opening index for database */ 151 declare mu_database_index$get_resultant_model_pointer entry (fixed bin (35), ptr); /* gets pointer from open index */ 152 declare mrds_error_$invalid_db_index fixed bin (35) ext; /* not good opening index */ 153 declare relation_name char (*); /* the submodel or model name of the relation */ 154 declare permits fixed bin; /* the permited scope modes */ 155 declare prevents fixed bin; /* the prevented scope modes */ 156 declare scope_mode_version fixed bin; /* the dbc structure version */ 157 declare error_code fixed bin (35); /* the error status encoding */ 158 declare mrds_error_$scope_not_set fixed bin (35) ext; /* no scope set for relation */ 159 declare sys_info$max_seg_size fixed bin (35) ext;/* largest segment */ 160 declare (addr, null, rel, empty, fixed) builtin; 161 declare i fixed bin; /* loop index */ 162 declare ON bit (1) init ("1"b); /* true value */ 163 declare OFF bit (1) init ("0"b); /* false value */ 164 declare found bit (1); /* on => given name found in resultant model */ 165 declare finished bit (1); /* loop exit control */ 166 declare work_area area (4096); /* space for returned structures about scope */ 167 declare mrds_error_$unknown_relation_name fixed bin (35) ext; /* name not in view */ 168 declare mrds_error_$non_scope_ready fixed bin (35) ext; /* relation not readied for scope concurrency */ 169 2 1 /* BEGIN mrds_dbcb.incl.pl1 -- jaw, 11/7/78 */ 2 2 2 3 2 4 2 5 /****^ HISTORY COMMENTS: 2 6* 1) change(85-11-17,Dupuis), approve(85-12-16,MCR7314), 2 7* audit(86-02-04,Brunelle), install(86-02-05,MR12.0-1013): 2 8* This entry is being made to cover the change made on 85-07-01 by Thanh 2 9* Nguyen. The scopes_changed flag was added to make checking for this 2 10* more efficient (mrds error list #137). 2 11* 2) change(86-06-10,Blair), approve(86-08-07,MCR7491), 2 12* audit(86-08-07,Gilcrease), install(86-08-15,MR12.0-1127): 2 13* Add a bit called dont_check_txn_id to indicate whether or not we should 2 14* care if multiple txns use the same selection_expression. (mrds #156) 2 15* 3) change(87-11-23,Hergert), approve(88-06-28,MCR7903), 2 16* audit(88-06-28,Dupuis), install(88-08-01,MR12.2-1073): 2 17* Added parser_work_area_ptr and mrds_se_info_ptr for new parser. 2 18* END HISTORY COMMENTS */ 2 19 2 20 2 21 /* WARNING 2 22* If the dbcb structure is changed then the mrds_data_ 2 23* item saved_res_version MUST be incremented to invalidate all 2 24* existing saved resultants 2 25**/ 2 26 2 27 /* HISTORY : 2 28* 2 29* modified by Jim Gray - - 80-10-24, to add new_select_expr bit for 2 30* tid_list management 2 31* 2 32* 81-1-9 Jim Gray : added like reference for ease in making the 2 33* phony resultant in mu_database_index, without having the area dcl 2 34* included. 2 35* 2 36* 81-06-17 Roger Lackey : added last_store_rel_name for use by 2 37* mrds_dsl_store 2 38* 2 39* 81-06-26 Roger Lackey : Added no_optimize and print_search_order 2 40* switches 2 41* 2 42* 81-07-06 Jim Gray : added identifier for the current selection 2 43* expression, so that relation statistics can be updated relative 2 44* to number of selection expressions seem. Also removed init for 2 45* last_store_rel_name, as this iw now properly done in 2 46* mrds_dsl_init_res. 2 47* 2 48* 81-07-17 Roger Lackey : added pred_ptr and unused_ptrs. 2 49* 2 50* 82-08-19 Mike Kubicar : added store_vector field. This is needed 2 51* for the conversion to the relation manager. 2 52* 2 53* 82-08-23 Davids: added the relmgr_entries and access_costs 2 54* substructures so that the entries and costs can change 2 55* depending on the type of database that is opened. 2 56* 2 57* 82-09-09 Mike Kubicar : added modify_vector field. This is needed 2 58* since modify uses a different vector type (general) than does store. 2 59* 2 60* 82-09-20 Davids: changed names of (store modify)_vector to 2 61* (store modify)_vector_ptr. Also (delete modify)_tuple_by_id to 2 62* (delete modify)_tuples_by_id. added the element cursor_storage_ptr 2 63* which should be inited to null and will be set by mu_cursor_manager_$get 2 64* during the first call. 2 65* 2 66* 82-09-21 Davids: renamed cursor_storage_ptr to cursor_ptrs_storage_ptr 2 67* since it deals with the pointers to the cursors and not the cursors 2 68* themelves and added the element cursor_storage_area_ptr which points 2 69* to the area where the cursors are kept. 2 70* 2 71* 82-09-22 Davids: renamed the transact_ctl_seg to transactions_needed. 2 72* the transact_ctl_seg always had a value of 0 and really didn't mean 2 73* anything. 2 74* 2 75* 82-09-22 Mike Kubicar : added create_relation, create_index and 2 76* destroy_relation_by_opening to relmgr_entries. They are needed 2 77* by mrds_dsl_define_temp_rel. 2 78* 2 79* 82-09-24 Donna Woodka : added put_tuple to relmgr_entries. It 2 80* is needed by mu_store. 2 81* 2 82* 82-11-12 Davids: changed the declaration of the access_costs from fixed 2 83* bin to float bin since the values are not integers. 2 84* 2 85* 83-02-02 Davids: added the dbc_uid element. This will allow mrds to make 2 86* sure that the dbc_ptr still points to the correct segment. Element was 2 87* added to the end of the structure to allow modules that don't use 2 88* the element to continue to reference the dbcb structure without recompiling. 2 89* 2 90* 83-02-25 Davids: added the concurrency_on and rollback_on elements. These 2 91* are needed so that temp rels can be created with the same file attributes 2 92* as the permanent relations. 2 93* 2 94* 83-05-02 Mike Kubicar : Deleted get_next_search_specification_ptr and 2 95* added the resultant_in_pdir bit. 2 96* 2 97* 83-05-18 Davids: reduced the number of reserved bits to 14 (from 15) and 2 98* added the res_already_made element. 2 99* 2 100* 83-05-24 Mike Kubicar : Updated the relation manager calling sequences. 2 101* 2 102* 83-08-03 Mike Kubicar : Added the element_id_list_segment_ptr and removed 2 103* one of the unused pointers. 2 104* 2 105* 83-09-20 Ron Harvey: Added relmgr_entries.get_population. 2 106* 2 107* 84-08-27 John Hergert: Created compiled_se_info_ptr from unused_ptrs(2) 2 108* leaving unused_ptrs(1). 2 109* 2 110* 85-01-15 Thanh Nguyen: Added the work_area_ptr and removed the last 2 111* unused_ptrs (1). 2 112* 2 113* 85-04-12 Thanh Nguyen: Added user_started_transaction and 2 114* non_shared_to_shared flags. Also added se_transaction_id and some more 2 115* spare ptrs, entries and reserved storages for future enhancement, since 2 116* we changed the saved_res_version from rslt0001 to rslt0002. 2 117* 2 118* 85-07-01 Thanh Nguyen: Added scopes_changed flag. This flag is set by 2 119* common routine of mrds_dsl_set_scope, reset by mrds_dsl_optimize and 2 120* mrds_dsl_gen_srch_prog when building of a new search_vars. 2 121**/ 2 122 2 123 2 124 /* this structure is based on the {unique_name}.mrds.dbcb segment 2 125* that constitutes the non-secure portion of the resultant model that is 2 126* created during the opening of a database. it contains variables that 2 127* are used during the runtime access of the database, and an area 2 128* for evaluation of requests. it points to four other 2 129* segments in the resultant model, {unique_name}.mrds.rdbi, the secure 2 130* portion of the resultant(see mdbm_rm_db_info.incl.pl1), 2 131* {unique_name}.mrds.select, an area for selection expression evaluation, 2 132* {unique_name}.mrds.curdat, and {unique_name}.mrds.stadat, two segments 2 133* used in the elimination of duplicate tuples during a retrieve. 2 134* the dbcb area holds the structure in mdbm_scope_info.incl.pl1 2 135* that is used when the database is using the file scope mechanism 2 136* for concurrency control over file readying. the segment overlayed via 2 137* mrds_dbc.incl.pl1 structure is pointed to and also handles concurrency control, 2 138* across database openings. the pointer to this dbcb structure is kept in a table 2 139* which associates database indexes(returned from a call to dsl_$open), with particular 2 140* opening instances of resultant models. (see mu_database_index routine) */ 2 141 2 142 dcl 1 dbcb aligned based (dbcb_ptr), /* DBCB -- non-secure portion */ 2 143 2 data like dbcb_data, 2 144 2 static_area area (sys_info$max_seg_size - fixed (rel (addr (dbcb.static_area)))); 2 145 2 146 dcl dbcb_ptr ptr; 2 147 2 148 declare 1 dbcb_data based, /* info part of dbcb, separated out so that 2 149* like references can avoid getting the area declaration */ 2 150 2 rdbi_ptr ptr, /* pointer to write protected mdbm_util_ info. */ 2 151 2 range_ptr ptr, /* ptr to range structure, or null */ 2 152 2 select_ptr ptr, /* ptr to select list, or null */ 2 153 2 sv_ptr ptr, /* pointer to search variables */ 2 154 2 so_ptr ptr, /* pointer to search operators */ 2 155 2 ti_ptr ptr, /* pointer to tuple info */ 2 156 2 lit_ptr ptr, /* pointer to the literal area, or null */ 2 157 2 current_ptr ptr, /* ptr to select list resulting from -current clause */ 2 158 2 ss_ptr ptr, /* ptr to select sets block if not simple s.e. */ 2 159 2 retr_info_ptr ptr, /* ptr to retrieve info area */ 2 160 2 trel_info_ptr ptr, /* ptr to retrieve info area */ 2 161 2 sti_ptr ptr, /* pointer to store info */ 2 162 2 dbc_ptr ptr, /* pointer to the data base control segment */ 2 163 2 sfi_ptr ptr, /* points to head of scalar function list */ 2 164 2 scope_ptr ptr, /* points to array of scope tuples */ 2 165 2 select_area_ptr ptr, /* ptr to area for current selection expression allocations */ 2 166 2 current_data_ptr ptr, /* ptr to one of 2 segments used by mrds_dsl_retrieve 2 167* for eliminating duplicate tuples. */ 2 168 2 static_data_ptr ptr, /* ptr to one of 2 segments used by mrds_dsl_retrieve 2 169* for eliminating duplicate tuples. */ 2 170 2 store_area_ptr ptr, /* temp storage area for dsl_$store */ 2 171 2 retrieve_area_ptr ptr, /* temp storage for dsl_$retrieve */ 2 172 2 modify_area_ptr ptr, /* temp storage area for dsl_$modify */ 2 173 2 delete_area_ptr ptr, /* temp storage area for dsl_$delete */ 2 174 2 def_temp_rel_area_ptr ptr, /* temp storage area for dsl_$define_temp_rel */ 2 175 2 pred_ptr ptr, /* Pointer to pred_array */ 2 176 2 store_vector_ptr ptr, /* Vector structure used during store operations */ 2 177 2 modify_vector_ptr ptr, /* Used during modifies */ 2 178 2 element_id_list_segment_ptr ptr, /* Points to the segment used to hold element_id_list structures */ 2 179 2 compiled_se_info_ptr ptr, /* points to the segment containing all info on compiled sexs */ 2 180 2 work_area_ptr ptr, /* Work area for encode/decode value allocations in mu_retrieve */ 2 181 2 se_info_ptr ptr, /* Points to se_info struct. Primarily for error reports */ 2 182 2 parser_work_area_ptr ptr, /* work area for parser */ 2 183 2 reserved_ptrs (4) ptr, /* Reserved for future use */ 2 184 2 another_flag bit (1) unal, /* on if predicate was -another */ 2 185 2 current_flag bit (1) unal, /* on if predicate was -current clause */ 2 186 2 dbc_incr bit (1) unal, /* on if dbc open mode has been incremented for this user */ 2 187 2 delete_flag bit (1) unal, /* On if search was called from mrds_dsl_sec_delete */ 2 188 2 dup_retain bit (1) unaligned, /* On if dup tuples allowed for retrieval */ 2 189 2 prev_select bit (1) unal, /* on if prev. select block processed in this s.e. */ 2 190 2 possible_op bit (1) unal, /* on of arith op. allowed */ 2 191 2 sel_clause bit (1) unal, /* on if currently in select clause */ 2 192 2 dsm_sw bit (1) unal, /* on if data base was opened via data submodel */ 2 193 2 val_rtrv bit (1) unal, /* if s.e. valid for retrieve */ 2 194 2 val_mod bit (1) unal, /* for modify */ 2 195 2 val_del bit (1) unal, /* for delete */ 2 196 2 val_dtr bit (1) unal, /* for define temp rel */ 2 197 2 transactions_needed bit (1) unal, /* On => transaction must be started or in progress does 2 198* not imply that the database is of type page_file */ 2 199 2 open_mode bit (3) unal, /* 0=>unknown, 1=>r, 2=>u, 3=>er, 4=>eu, >4=>bad */ 2 200 2 new_select_expr bit (1) unal, /* on => starting a new tid list management period */ 2 201 2 no_optimize bit (1) unal, /* On => no optimize */ 2 202 2 print_search_order bit (1) unal, /* On => print the search order */ 2 203 2 resultant_in_pdir bit (1) unal, /* On => Temp segments are in the process dir */ 2 204 2 res_already_made bit (1) unal, /* On => resultant has been made based on a saved copy */ 2 205 2 user_started_transaction bit (1) unal, /* On => user already started his own transaction. */ 2 206 2 non_shared_to_shared bit (1) unal, /* On => user changed the scope from non shared to shared 2 207* inside a sequence of -another selection expression. */ 2 208 2 scopes_changed bit (1) unal, /* On => scopes had been changed by set_scopes or delete_scopes */ 2 209 2 dont_check_txn_id bit (1) unal, /* On => cpmd needs same selection exp across multiple txns */ 2 210 2 reserved bit (10) unal, /* reserved for future use */ 2 211 2 nseq_sch fixed bin (35), /* no. tuples located via sequential search */ 2 212 2 nind_sch fixed bin (35), /* no. tuples located via index search */ 2 213 2 nhash_sch fixed bin (35), /* no. tuples located via hash search */ 2 214 2 nlk_sch fixed bin (35), /* no tuples located via link search */ 2 215 2 cur_lit_offset fixed bin (35), /* current bit offset in literal string */ 2 216 2 dbi fixed bin (35), /* database index for this opening */ 2 217 2 last_s_e_id_num fixed bin (35), /* identifying number for last selection expression seen */ 2 218 2 se_transaction_id bit (36) aligned, /* transaction id from beginning of select expression */ 2 219 2 last_store_rel_name char (32), /* Name of relation last used for store */ 2 220 2 cursor_ptrs_storage_ptr ptr, /* pointer to space where cursor ptrs are stored */ 2 221 2 cursor_storage_area_ptr ptr, /* pointer to area where the cursors are kept */ 2 222 2 reserved_words (10) fixed bin (35), /* Reserved for future use */ 2 223 2 relmgr_entries, /* relation manager entries */ 2 224 3 open entry (char (*), char (*), bit (36) aligned, fixed bin (35)), 2 225 3 close entry (bit (36) aligned, fixed bin (35)), 2 226 3 create_cursor entry (bit (36) aligned, ptr, ptr, fixed bin (35)), 2 227 3 destroy_cursor entry (ptr, ptr, fixed bin (35)), 2 228 3 set_scope entry (bit (36) aligned, bit (2) aligned, bit (2) aligned, fixed bin (35)), 2 229 3 delete_tuples_by_id entry (ptr, ptr, fixed bin (35), fixed bin (35)), 2 230 3 modify_tuples_by_id entry (ptr, ptr, ptr, fixed bin (35), fixed bin (35)), 2 231 3 get_tuple_by_id entry (ptr, bit (36) aligned, ptr, ptr, ptr, fixed bin (35)), 2 232 3 get_tuples_by_spec entry (ptr, ptr, ptr, ptr, ptr, fixed bin (35)), 2 233 3 get_tuple_id entry (ptr, ptr, ptr, ptr, fixed bin (35)), 2 234 3 put_tuple entry (ptr, ptr, bit (36) aligned, fixed bin (35)), 2 235 3 get_count entry (ptr, ptr, fixed bin (35), fixed bin (35)), 2 236 3 get_duplicate_key_count entry (ptr, bit (36) aligned, fixed bin (17), fixed bin (35), fixed bin (35)), 2 237 3 get_population entry (ptr, fixed bin (35), fixed bin (35)), 2 238 3 create_relation entry (char (*), char (*), ptr, ptr, bit (36) aligned, bit (36) aligned, fixed bin (35)), 2 239 3 create_index entry (bit (36) aligned, ptr, bit (36) aligned, fixed bin (17), bit (36) aligned, fixed bin (35)), 2 240 3 destroy_relation_by_path entry (char (*), char (*), fixed bin (35)), 2 241 3 reserved_entries (5) entry (), 2 242 2 access_costs, /* access costs for permute */ 2 243 3 total_primary_key_cost float bin, 2 244 3 access_cost float bin, 2 245 3 access_overhead float bin, 2 246 3 us_access_cost float bin, 2 247 3 os_access_cost float bin, 2 248 2 dbc_uid bit (36) aligned, /* uid of the segment containing the dbc structure */ 2 249 2 concurrency_on bit (1) unal, /* "1"b implies dmfile concurrency is being used */ 2 250 2 rollback_on bit (1) unal; /* "1"b iomplies before journaling is to be done */ 2 251 2 252 /* END mrds_dbcb.incl.pl1 */ 2 253 2 254 170 171 3 1 /* BEGIN INCLUDE FILE mdbm_scope_requests.incl.pl1 - - Jim Gray 80-12-10 */ 3 2 3 3 /* this include file contains overlays for the fixed bin (17) 3 4* permit/prevent scope mode encoding that set/dl_fscope and all lower 3 5* routines use in interface communications. 3 6* Note that is fixed bin(17) aligned, as recieved from 3 7* mrds_dsl_set_scope, thus the overlay is for a full 36 bit word. 3 8* The scope modes are encoded as a sum of the individual permissions, 3 9* with 1 => read_attr, 2 => append_tuple, 4 => delete_tuple, 8 => modify_attr, 3 10* thus individual bits in the fixed bin word can be used for each mode 3 11* These were known as r-s-m-d modes by old mrds users. */ 3 12 3 13 declare 1 common based, /* common layout of bits for scope modes */ 3 14 2 mbz1 bit (32) unal, /* unused upper part of word */ 3 15 2 modify_attr bit (1) unal, /* mode sum has an 8 */ 3 16 2 delete_tuple bit (1) unal, /* mode sum has a 4 */ 3 17 2 append_tuple bit (1) unal, /* mode sum has a 2 */ 3 18 2 read_attr bit (1) unal ; /* mode sum has a 1 */ 3 19 3 20 declare 1 permit_requests like common based (permit_requests_ptr) ; /* permit modes in scope call */ 3 21 3 22 declare 1 prevent_requests like common based (prevent_requests_ptr) ; /* prevent modes in scope call */ 3 23 3 24 declare (permit_requests_ptr, prevent_requests_ptr) ptr ; 3 25 3 26 /* the following structure is used to describe in detail, 3 27* what scope conflict existed between a users requested 3 28* permit/prevent modes in a set/dl_scope call and the 3 29* actual usage of a file/relation currently with active scope in the database 3 30* Note that for delete_scope, the conflict check is that the requested deletion 3 31* be a subset of the users currently set scope. 3 32* For set_scope, the conflict check is that a permit does not conflict with 3 33* another users prevent, and that the requested prevent does not 3 34* conflict with an existing other users permit already granted. */ 3 35 3 36 declare 1 conflict_detail based (conflict_detail_ptr), 3 37 2 permits like common, /* conflicts in permit part of requests */ 3 38 2 prevents like common ; /* conflicts in prevent part of requests */ 3 39 3 40 declare conflict_detail_ptr ptr ; 3 41 3 42 /* END INCLUDE FILE mdbm_scope_requests.incl.pl1 */ 172 173 4 1 /* BEGIN INCLUDE FILE mdbm_dbc.incl.pl1 08/23/78 odf */ 4 2 4 3 /* HISTORY: 4 4* 4 5* Modified by odf for new version data bases in August 1978 4 6* Modified by Al Kepner, March 8, 1979 to add new flags for quiescing 4 7* Modified by M. Pierret, 8 April 1980 to look prettier, add pads 4 8* Modified by M. Pierret, 22 August 1980, grouping like fields (flags, offsets..) 4 9* 4 10* 80-11-19 Jim Gray : modified to change version number from 4 to 5 to allow 4 11* automatic update of dbc structures to new r-s-m-d-u scope codes from r-u. 4 12**/ 4 13 4 14 dcl 1 dbc based (dbc_ptr), /* data base control segment description */ 4 15 2 proper, 4 16 3 version fixed bin, /* version number of this structure */ 4 17 3 dtd_mrds fixed bin (71), /* date time dumped by mrds utility */ 4 18 3 flags, 4 19 4 trouble_switch bit (1) unal, /* ON => ungraceful termination of a user process */ 4 20 4 dead_proc_flag bit (1) unal, /* ON => dead process has access to part of data base */ 4 21 4 quiesce_sw bit (1) unal, /* ON => db is quiesced for a administrative user */ 4 22 4 quiesce_db bit (1) unal, /* ON => The entire data base is being quiesced. */ 4 23 4 quiesce_files bit (1) unal, /* ON => A selected set of files is being quiesced. */ 4 24 4 pad bit (31) unal, /* reserved for future use */ 4 25 3 quiesce_lock bit (36) aligned, /* lock word for quiescing data base */ 4 26 3 wakeup_waiters fixed bin, /* nbr users who have been sent a wakeup signal but have not yet 4 27* received it */ 4 28 3 user_counts, 4 29 4 open_users fixed bin, /* nbr of users with data base open in any mode */ 4 30 4 active_users fixed bin, /* nbr of users currently having a scope set */ 4 31 4 waiting_users fixed bin, /* nbr of users waiting to set scope */ 4 32 3 open_lock bit (36) aligned, /* lock word for opening data base */ 4 33 3 scope_lock bit (36) aligned, /* lock word for setting and deleting scope */ 4 34 3 sa_size fixed bin (35), /* size in words of static area */ 4 35 3 pad2 bit (144), 4 36 3 offsets, 4 37 4 open_users_ofs bit (18) unal, /* bit offset to list of users with data base currently open */ 4 38 4 active_users_ofs bit (18) unal, /* bit offset to list of active users in shared mode */ 4 39 4 waiting_users_ofs bit (18) unal, /* bit offset to list of waiting users in shared mode */ 4 40 4 obsolete bit (36) unal, /* obsolete */ 4 41 3 pad3 bit (144), 4 42 2 static_area area (sys_info$max_seg_size - fixed (rel (addr (dbc.static_area))) + 1); 4 43 4 44 dcl dbc_ptr ptr init (null ()); 4 45 4 46 dcl VERSION_NBR fixed bin init (5) static internal options (constant); 4 47 4 48 4 49 /* END mdbm_dcb.incl.pl1 */ 4 50 4 51 174 175 176 end; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 08/01/88 1315.0 mrds_dsl_get_scope.pl1 >special_ldd>install>MR12.2-1073>mrds_dsl_get_scope.pl1 147 1 04/18/85 1628.1 mdbm_scope_info.incl.pl1 >ldd>include>mdbm_scope_info.incl.pl1 170 2 08/01/88 1300.0 mrds_dbcb.incl.pl1 >special_ldd>install>MR12.2-1073>mrds_dbcb.incl.pl1 172 3 10/14/83 1608.7 mdbm_scope_requests.incl.pl1 >ldd>include>mdbm_scope_requests.incl.pl1 174 4 10/14/83 1609.0 mdbm_dbc.incl.pl1 >ldd>include>mdbm_dbc.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. OFF 000102 automatic bit(1) initial packed unaligned dcl 163 set ref 111 163* ON 000101 automatic bit(1) initial packed unaligned dcl 162 set ref 128 135 162* addr builtin function dcl 160 ref 94 95 append_tuple 0(34) based bit(1) level 2 in structure "permit_requests" packed packed unaligned dcl 3-20 in procedure "get_scope" set ref 120* append_tuple 26(01) based bit(1) array level 5 in structure "scope_info" packed packed unaligned dcl 1-32 in procedure "get_new_scope" ref 120 append_tuple 0(34) based bit(1) level 2 in structure "prevent_requests" packed packed unaligned dcl 3-22 in procedure "get_scope" set ref 125* append_tuple 27(01) based bit(1) array level 5 in structure "scope_info" packed packed unaligned dcl 1-32 in procedure "get_new_scope" ref 125 common based structure level 1 packed packed unaligned dcl 3-13 data based structure level 2 dcl 2-142 db_index parameter fixed bin(35,0) dcl 150 set ref 30 30 82* dbc based structure level 1 unaligned dcl 4-14 dbc_ptr 010114 automatic pointer initial dcl 4-44 in procedure "get_scope" set ref 89* 90 4-44* dbc_ptr 30 based pointer level 3 in structure "dbcb" dcl 2-142 in procedure "get_scope" ref 89 dbcb based structure level 1 dcl 2-142 dbcb_data based structure level 1 unaligned dcl 2-148 dbcb_ptr 010106 automatic pointer dcl 2-146 set ref 82* 83 89 106 delete_tuple 26(02) based bit(1) array level 5 in structure "scope_info" packed packed unaligned dcl 1-32 in procedure "get_new_scope" ref 121 delete_tuple 0(33) based bit(1) level 2 in structure "prevent_requests" packed packed unaligned dcl 3-22 in procedure "get_scope" set ref 126* delete_tuple 27(02) based bit(1) array level 5 in structure "scope_info" packed packed unaligned dcl 1-32 in procedure "get_new_scope" ref 126 delete_tuple 0(33) based bit(1) level 2 in structure "permit_requests" packed packed unaligned dcl 3-20 in procedure "get_scope" set ref 121* empty builtin function dcl 160 ref 166 error_code parameter fixed bin(35,0) dcl 157 set ref 30 30 78* 83* 107* 139* 142* finished 000104 automatic bit(1) packed unaligned dcl 165 set ref 111* 114 128* 135* flags 26 based structure array level 3 dcl 1-32 found 000103 automatic bit(1) packed unaligned dcl 164 set ref 111* 128* 139 i 000100 automatic fixed bin(17,0) dcl 161 set ref 112* 116 118 119 120 121 123 124 125 126 132 132* 132 142 modify_attr 26(03) based bit(1) array level 5 in structure "scope_info" packed packed unaligned dcl 1-32 in procedure "get_new_scope" ref 119 modify_attr 27(03) based bit(1) array level 5 in structure "scope_info" packed packed unaligned dcl 1-32 in procedure "get_new_scope" ref 124 modify_attr 0(32) based bit(1) level 2 in structure "prevent_requests" packed packed unaligned dcl 3-22 in procedure "get_scope" set ref 124* modify_attr 0(32) based bit(1) level 2 in structure "permit_requests" packed packed unaligned dcl 3-20 in procedure "get_scope" set ref 119* mrds_error_$invalid_db_index 000012 external static fixed bin(35,0) dcl 152 ref 83 mrds_error_$non_scope_ready 000020 external static fixed bin(35,0) dcl 168 ref 107 mrds_error_$scope_not_set 000014 external static fixed bin(35,0) dcl 158 ref 142 mrds_error_$unknown_relation_name 000016 external static fixed bin(35,0) dcl 167 ref 139 mu_database_index$get_resultant_model_pointer 000010 constant entry external dcl 151 ref 82 nfiles 4 based fixed bin(17,0) level 2 dcl 1-32 ref 132 null builtin function dcl 160 ref 83 4-44 107 1-59 permit_requests based structure level 1 packed packed unaligned dcl 3-20 permit_requests_ptr 010110 automatic pointer dcl 3-24 set ref 94* 118 119 120 121 permits 26 based structure array level 4 in structure "scope_info" dcl 1-32 in procedure "get_new_scope" permits parameter fixed bin(17,0) dcl 154 in procedure "get_scope" set ref 30 30 78* 94 prevent_requests based structure level 1 packed packed unaligned dcl 3-22 prevent_requests_ptr 010112 automatic pointer dcl 3-24 set ref 95* 123 124 125 126 prevents 27 based structure array level 4 in structure "scope_info" dcl 1-32 in procedure "get_new_scope" prevents parameter fixed bin(17,0) dcl 155 in procedure "get_scope" set ref 30 30 78* 95 proper based structure level 2 unaligned dcl 4-14 read_attr 0(35) based bit(1) level 2 in structure "permit_requests" packed packed unaligned dcl 3-20 in procedure "get_scope" set ref 118* read_attr 0(35) based bit(1) level 2 in structure "prevent_requests" packed packed unaligned dcl 3-22 in procedure "get_scope" set ref 123* read_attr 26 based bit(1) array level 5 in structure "scope_info" packed packed unaligned dcl 1-32 in procedure "get_new_scope" ref 118 read_attr 27 based bit(1) array level 5 in structure "scope_info" packed packed unaligned dcl 1-32 in procedure "get_new_scope" ref 123 relation_name parameter char packed unaligned dcl 153 ref 30 30 116 scope 6 based structure array level 2 dcl 1-32 scope_flags based structure level 1 dcl 1-42 scope_info based structure level 1 dcl 1-32 scope_mode_version parameter fixed bin(17,0) dcl 156 set ref 30 30 78* 90* scope_ptr 010124 automatic pointer initial dcl 1-59 in procedure "get_new_scope" set ref 106* 107 116 118 119 120 121 123 124 125 126 132 142 1-59* scope_ptr 34 based pointer level 3 in structure "dbcb" dcl 2-142 in procedure "get_scope" ref 106 sm_name 16 based char(32) array level 3 dcl 1-32 ref 116 touched 30 based bit(1) array level 4 packed packed unaligned dcl 1-32 ref 142 version based fixed bin(17,0) level 3 dcl 4-14 ref 90 work_area 000106 automatic area(4096) dcl 166 set ref 166* NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. VERSION_NBR internal static fixed bin(17,0) initial dcl 4-46 conflict_detail based structure level 1 packed packed unaligned dcl 3-36 conflict_detail_ptr automatic pointer dcl 3-40 fixed builtin function dcl 160 max_file_init automatic fixed bin(17,0) dcl 1-58 rel builtin function dcl 160 scope_rdy internal static bit(6) initial packed unaligned dcl 1-60 scope_rdy_array based bit(1) array packed unaligned dcl 1-61 sys_info$max_seg_size external static fixed bin(35,0) dcl 159 NAMES DECLARED BY EXPLICIT CONTEXT. get_new_scope 000125 constant entry internal dcl 101 ref 97 get_scope 000027 constant entry external dcl 30 mrds_dsl_get_scope 000046 constant entry external dcl 30 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 426 450 310 436 Length 724 310 22 237 115 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME get_scope 4191 external procedure is an external procedure. get_new_scope internal procedure shares stack frame of external procedure get_scope. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME get_scope 000100 i get_scope 000101 ON get_scope 000102 OFF get_scope 000103 found get_scope 000104 finished get_scope 000106 work_area get_scope 010106 dbcb_ptr get_scope 010110 permit_requests_ptr get_scope 010112 prevent_requests_ptr get_scope 010114 dbc_ptr get_scope 010124 scope_ptr get_new_scope THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. call_ext_out return_mac ext_entry_desc op_empty_ THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. mu_database_index$get_resultant_model_pointer THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. mrds_error_$invalid_db_index mrds_error_$non_scope_ready mrds_error_$scope_not_set mrds_error_$unknown_relation_name LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 162 000007 163 000011 166 000012 4 44 000015 30 000021 78 000062 82 000067 83 000100 89 000111 90 000114 94 000117 95 000121 97 000123 176 000124 101 000125 1 59 000126 106 000130 107 000133 111 000143 112 000146 114 000150 116 000152 118 000166 119 000174 120 000203 121 000212 123 000221 124 000227 125 000235 126 000243 128 000251 130 000254 132 000255 135 000263 137 000265 139 000266 142 000275 148 000307 ----------------------------------------------------------- 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