COMPILATION LISTING OF SEGMENT rmdb_build_attr_info Compiled by: Multics PL/I Compiler, Release 29, of July 28, 1986 Compiled at: Honeywell Multics Op. - System M Compiled on: 10/16/86 1347.8 mst Thu Options: optimize map 1 /* *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Information Systems Inc., 1982 * 4* * * 5* *********************************************************** */ 6 7 8 rmdb_build_attr_info: proc (I_dbm_ptr, I_adi_ptr, I_fm_ptr, I_di_ptr, O_err_msg, O_err_code); 9 10 /* . BEGIN_DESCRIPTION 11* 12* The purpose of this procedure is to add the attr_info for the attribute 13* defined in I_adi_ptr -> attr_def_info. The definition order of the 14* attributes will be the order in which they are supplied to this procedure. 15* The necessary rel_info structure elements are also updated. 16* 17* . END_DESCRIPTION 18**/ 19 20 21 22 /* HISTORY: 23* 82-04-13 Originally written by R. Lackey. 24* 25* 82-06-25 Roger Lackey : Added the divide builting and the 26* constants VARYING_CHAR_TYPE = 22 and VARYING_BIT_TYPE = 20 27* 28* 82-07-02 R. Harvey : changed mu_data_length reference to 29* mdbm_util_$mu_data_length 30* 31* 83-01-10 R. Harvey : changed so the attribute index_id is set to 32* all zeroes and the max_attr_index_id field is set beyond 33* the maximum for pre-relation manager MRDS. 34**/ 35 36 /* PARAMETERS */ 37 38 dcl I_dbm_ptr ptr parameter; /* Pointer to the db_model */ 39 dcl I_adi_ptr ptr parameter; /* Pointer to attr_def_info */ 40 dcl I_fm_ptr ptr parameter; /* Pointer to file_model */ 41 dcl I_di_ptr ptr parameter; /* Pointer to domain_info */ 42 dcl O_err_msg char (*) parameter;/* Error message text */ 43 dcl O_err_code fixed bin (35) parameter; /* Error code */ 44 45 46 /* rmdb_build_attr_info: proc (I_dbm_ptr, I_adi_ptr, I_fm_ptr, I_di_ptr, O_err_msg, O_err_code); */ 47 48 dbm_ptr = I_dbm_ptr; /* Pointer to db_model */ 49 adi_ptr = I_adi_ptr; /* Pointer to atr_def_info */ 50 fm_ptr = I_fm_ptr; /* Pointer to file_model */ 51 di_ptr = I_di_ptr; /* pointer to domain_info for this attribute */ 52 O_err_msg = ""; 53 O_err_code = 0; 54 55 ri_ptr = ptr (fm_ptr, file_model.rel_ptr); /* Pointer to rel_info */ 56 57 /* Find end of attr_info list and check for dup attr_names 58* count the attributes to determine attr order number. 59* count key attributes. */ 60 61 prev_ptr = null; 62 63 key_attribute_count = 0; 64 65 do ai_ptr = ptr (fm_ptr, rel_info.attr_ptr) /* Loop thru all attibutes getting the attr_name */ 66 repeat ptr (fm_ptr, attr_info.fwd_thread) 67 while (rel (ai_ptr) ^= NULL_OFFSET); 68 69 if attr_def_info.name = attr_info.name then do; /* Found a duplicate name */ 70 O_err_msg = rtrim (attr_info.name);/* so return an error */ 71 O_err_code = mrds_error_$rst_name_duplicate; 72 return; 73 end; 74 75 if attr_info.key_attr then key_attribute_count = key_attribute_count + 1; /* Count key attributes */ 76 prev_ptr = ai_ptr; 77 78 end; 79 80 if rel_info.num_attr + 1 > mrds_data_$max_attributes then do; 81 O_err_code = mrds_error_$max_attributes; 82 return; 83 end; 84 85 rel_info.num_attr = rel_info.num_attr + 1; 86 87 allocate attr_info in (fm_area) set (ai_ptr); 88 89 if prev_ptr = null then rel_info.attr_ptr = rel (ai_ptr); /* Link new attr_inof into list */ 90 else prev_ptr -> attr_info.fwd_thread = rel (ai_ptr); 91 92 attr_info.name = attr_def_info.name; 93 94 if attr_def_info.primary_key then do; /* If it is part of the primary key */ 95 attr_info.key_attr = "1"b; 96 attr_info.key_order = key_attribute_count + 1; 97 rel_info.num_key_attrs = rel_info.num_key_attrs + 1; /* Bump key attr count in rel_info */ 98 end; 99 else do; /* Not part of primary key */ 100 attr_info.key_attr = "0"b; 101 attr_info.key_order = 0; 102 end; 103 104 attr_info.link_attr = "0"b; 105 attr_info.reserved = "0"b; 106 107 if attr_def_info.indexed then do; /* It is an indexed attribute */ 108 if mdbm_util_$mu_data_length ((domain_info.db_desc)) > 2277 /* 253* 9 */ 109 then do; 110 O_err_code = mrds_error_$long_index; 111 O_err_msg = 112 "The attribute has a domain that allows a values with length greater then 253 characters. " 113 || attr_def_info.name; 114 return; 115 end; 116 117 118 attr_info.index_attr = "1"b; 119 rel_info.indexed = "1"b; /* Set rel_info stuff */ 120 rel_info.max_attr_index_id = 257; /* set so old rmdb will not be able to add indexes */ 121 attr_info.index_id = "0"b; 122 end; 123 else do; /* NOT an indexed attribute */ 124 attr_info.index_id = "0"b; 125 attr_info.index_attr = "0"b; 126 end; 127 128 attr_info.defn_order = rel_info.num_attr; /* Same order that they are added to the attribute_list */ 129 130 call compute_bit_offset_and_length; /* Internal proc */ 131 132 attr_info.link_child_cnt = 0; 133 attr_info.link_par_cnt = 0; 134 attr_info.domain_ptr = rel (di_ptr); 135 attr_info.rslt_ptr = "0"b; 136 attr_info.fwd_thread = NULL_OFFSET; 137 attr_info.changer_ptr = db_model.changer_ptr; 138 139 140 if ceil (divide (rel_info.max_key_len, 9, 35)) > mrds_data_$max_key_len then do; 141 O_err_msg = rtrim (rel_info.name); 142 O_err_code = mrds_error_$long_key; 143 end; 144 145 exit: return; 146 147 /* * * * * * * * * * * compute_bit_offset_and_length * * * * * * * */ 148 149 compute_bit_offset_and_length: proc; 150 151 /* routine to convert the attribute's domain descriptor into 152* the required tuple offset and space required and update the 153* corresponding statistics for the relation information 154* NOTE: the padding routines were introduced to make the data stored 155* in the tuple(via bit offset/length) relect the pl1 definition 156* of storage locations needed for unaligned and aligned data types */ 157 158 varying_string = "0"b; 159 160 desc_ptr = addr (domain_info.db_desc); /* get descriptor for this attribute */ 161 162 attr_info.bit_length = 163 mdbm_util_$get_data_bit_length (desc_ptr -> descriptor_bit_36_ovrly); 164 165 if descriptor.type = VARYING_BIT_TYPE | 166 descriptor.type = VARYING_CHAR_TYPE then 167 varying_string = "1"b; 168 169 /* fixed length attribute/domain handling */ 170 171 if ^varying_string then do; /* fixed attributes */ 172 padding = 173 mdbm_util_$align_data_item (desc_ptr, rel_info.var_offset - 1); 174 attr_info.bit_offset = rel_info.var_offset + padding; 175 /* set to end of fixed data */ 176 rel_info.var_offset = 177 rel_info.var_offset + attr_info.bit_length + padding; 178 /* set new fixed data end */ 179 end; 180 181 /* varying string handling */ 182 183 else do; /* varying strings */ 184 rel_info.nvar_atts = rel_info.nvar_atts + 1; /* count up varying attributes */ 185 attr_info.bit_offset = rel_info.nvar_atts; /* varying array index, not offset */ 186 padding = pad (WORD, attr_info.bit_length); /* varying must start/stop on word boundary */ 187 end; 188 189 /* set the maximum tuple and key bit lengths */ 190 191 rel_info.max_data_len = 192 rel_info.max_data_len + attr_info.bit_length + padding; 193 if attr_def_info.primary_key then 194 195 rel_info.max_key_len = rel_info.max_key_len + attr_info.bit_length; 196 197 end compute_bit_offset_and_length; 198 199 /* * * * * * * * * * * * * * * pad * * * * * * * * * * * * */ 200 201 pad: proc (pad_size, pad_base) returns (fixed bin); 202 203 /* routine to return the number of bits necessary to pad a bit count 204* out to an alignment boundary of 9(byte), 36(word), or 72(double word) bits 205* as determined by the pad size input */ 206 207 if mod (pad_base, pad_size) = 0 then 208 number_of_bits = 0; 209 else do; 210 211 number_of_bits = pad_size - mod (pad_base, pad_size); 212 213 end; 214 215 return (number_of_bits); 216 217 dcl pad_size fixed bin; /* either 9 or 36 or 72 */ 218 dcl pad_base fixed bin (35); /* current bit length to be padded */ 219 dcl number_of_bits fixed bin; /* what has to be added to get to the desired boundary */ 220 221 end pad; 222 223 dcl NULL_OFFSET bit (18) internal static options (constant) init ((18)"1"b); /* db version of null offset */ 224 dcl addr builtin; 225 dcl ceil builtin; 226 dcl WORD fixed bin int static options (constant) init (36); 227 dcl descriptor_bit_36_ovrly bit (36) based; /* overlay for descriptor */ 228 dcl divide builtin; 229 dcl fixed builtin; 230 dcl key_attribute_count fixed bin; 231 dcl mdbm_util_$align_data_item entry (ptr, fixed bin (35)) returns (fixed bin); 232 dcl mdbm_util_$get_data_bit_length entry (bit (36)) returns (fixed bin (35)); 233 dcl mod builtin; 234 dcl mrds_data_$max_attributes ext fixed bin (35); 235 dcl mrds_data_$max_key_len fixed bin (35) ext; 236 dcl mrds_error_$long_index fixed bin (35) ext static; 237 dcl mrds_error_$long_key fixed bin (35) ext static; 238 dcl mrds_error_$max_attributes fixed bin (35) ext static; 239 dcl mrds_error_$rst_name_duplicate fixed bin (35) ext static; 240 dcl mdbm_util_$mu_data_length entry (bit (36)) returns (fixed bin (35)); 241 dcl null builtin; 242 dcl padding fixed bin; 243 dcl prev_ptr ptr; 244 dcl ptr builtin; 245 dcl rel builtin; 246 dcl rtrim builtin; 247 dcl sys_info$max_seg_size fixed bin (35) ext static; 248 dcl VARYING_BIT_TYPE fixed bin int static options (constant) init (20); 249 dcl VARYING_CHAR_TYPE fixed bin int static options (constant) init (22); 250 dcl varying_string bit (1); 251 1 1 /* BEGIN INCLUDE rmdb_create_rel_info.incl.pl1 */ 1 2 1 3 /* Contains relation name and all attributes that are associated with the 1 4* relation being created. Attributes which are to be indexed are flagged. */ 1 5 1 6 /* HISTORY: 1 7* Created 82-03-22 by R. Lackey 1 8**/ 1 9 1 10 1 11 dcl 1 rmdb_create_rel_info aligned based (rmdb_create_rel_info_ptr), 1 12 2 version fixed bin, /* Version number of this structure */ 1 13 2 db_path char (168), /* Absolute pathname of database */ 1 14 2 temp_directory_path char (168), /* Absolute pathname of directory to be used for temp space */ 1 15 2 db_model_ptr ptr, /* Pointer to db_model */ 1 16 2 relation_name char (32) unal, /* Name of relation being created */ 1 17 2 num_attrs fixed bin, /* Number of attributes 1 18* for this relation */ 1 19 2 attrs (rmdb_create_rel_info_alloc /* Attribute info */ 1 20 refer (rmdb_create_rel_info.num_attrs)) aligned 1 21 like attr_def_info; 1 22 1 23 1 24 dcl 1 attr_def_info based (adi_ptr), /* Attribute definition info */ 1 25 2 name char (32) unal, /* Attribute name */ 1 26 2 primary_key bit (1) unal, /* Primary key attribute */ 1 27 2 indexed bit (1) unal, /* On => attribute is to be indexed */ 1 28 2 mbz bit (34) unal; /* For future reference */ 1 29 1 30 dcl adi_ptr pointer; /* Pointer to attr_def_info structure */ 1 31 dcl rmdb_create_rel_info_ptr pointer; /* Based structure pointer */ 1 32 dcl rmdb_create_rel_info_alloc fixed bin; /* Allocation size of attribute info for structure */ 1 33 dcl RMDB_CREATE_REL_INFO_VERSION_1 int static options (constant) init (1); 1 34 1 35 1 36 dcl 1 rmdb_ix_attrs aligned based (rmdb_ix_attrs_ptr), /* List of names of attributes to be indexed */ 1 37 2 version fixed bin, 1 38 2 relation_name char (32), /* Name of the relation */ 1 39 2 num_used fixed bin, 1 40 2 an (rmdb_ix_attrs_alloc refer (rmdb_ix_attrs.num_used)) char (32); 1 41 1 42 dcl rmdb_ix_attrs_alloc fixed bin; 1 43 dcl rmdb_ix_attrs_ptr ptr; 1 44 dcl RMDB_IX_ATTRS_VERSION_1 int static options (constant) init (1); 1 45 1 46 dcl 1 rmdb_sel_val_info aligned based (rmdb_sel_val_info_ptr), /* Selection value info */ 1 47 2 version fixed bin, 1 48 2 sv_num fixed bin, /* Number of select values */ 1 49 2 data_list_ptr ptr, /* Pointer to list of ptrs to sv data */ 1 50 2 desc_list_ptr ptr; /* Pointer to list of ptrs to sv descriptors */ 1 51 1 52 dcl rmdb_sel_val_info_ptr ptr; 1 53 dcl RMDB_SEL_VAL_INFO_VERSION_1 int static options (constant) init (1); 1 54 1 55 /* END INCLUDE rmdb_create_rel_info.incl.pl1 */ 252 253 2 1 /* BEGIN INCLUDE FILE mdbm_db_model.incl.pl1 -- jaw, 10/2/78 */ 2 2 2 3 2 4 /****^ HISTORY COMMENTS: 2 5* 1) change(79-02-01,Gray), approve(), audit(), install(): 2 6* modified to save space occupied by model 2 7* 2) change(80-11-03,Gray), approve(), audit(), install(): 2 8* to add mdbm_secured bit in db_model 2 9* 3) change(82-04-09,Davids), approve(), audit(), install(): 2 10* collapsed the following into an unused_offset array: 2 11* chng_before_path_ptr chng_err_path_ptr chng_after_path_ptr 2 12* copy_before_path_ptr copy_err_path_ptr copy_after_path_ptr 2 13* dsply_before_path_pt dsply_err_path_pt dsply_after_path_ptr 2 14* accs_before_path_ptr accs_err_path_ptr accs_after_path_ptr 2 15* unused_1 2 16* Also changed the name of unused_2 to restructuring_history_offset 2 17* and changed the comment on the changer structure to indicate 2 18* that it will contain on database creation information. 2 19* 4) change(82-04-14,Davids), approve(), audit(), install(): 2 20* used one of the unused_offsets to point to a message which indicates 2 21* why the db is inconsistent. The offset will be null when the db is created 2 22* and set the first time the message is used. this is so it will be 2 23* consistent with existing data bases. Also added the message structure. 2 24* 5) change(82-04-28,Davids), approve(), audit(), install(): 2 25* added the undo_request element to the message structure 2 26* 6) change(82-05-04,Davids), approve(), audit(), install(): 2 27* changed unused_offset (12) to last_restructruring_history_offset and 2 28* changed restructuring_history_offset to first_restructuring_history_offset 2 29* 7) change(82-08-19,Davids), approve(), audit(), install(): 2 30* changed the meaning of db_type from 1 => relational and 2 => CODASYL to 2 31* 1 => vfile database and 2 => page_file database. Up to this point all 2 32* database types were equal to 1. 2 33* 8) change(83-02-14,Davids), approve(), audit(), install(): 2 34* changed db_type from a fixed bin unal to a substructure of 18 bit (1) unal 2 35* flags. This will allow information about transactions and dm_file 2 36* concurrency to be independent of the db_type, i.e. vfile or dm_file. The 2 37* change is compatable with all datamodels created by the released version 2 38* of mrds. 2 39* 9) change(83-02-15,Davids), approve(), audit(), install(): 2 40* added the rollback_on flag to the db_type_flags since it appears that you 2 41* can have a dmfile database that requires transactions but does not have any 2 42* journalizing. Also switched the order of the transactions_needed and 2 43* concurrency_on flags - this makes the change compatable with existing 2 44* dmfile databases except when displaying the model since concurrency_on and 2 45* rollback_on will be off in the model even though the dmfile relations had 2 46* them on during creation. 2 47* 10) change(83-02-22,Kubicar), approve(), audit(), install(): 2 48* Removed ctl_file_path_ptr. 2 49* 11) change(85-11-08,Spitzer), approve(85-12-03,MCR7311), 2 50* audit(86-09-02,Blair), install(86-10-16,MR12.0-1187): 2 51* used 1 unused offset for unreferenced attribute linked lists in db_model, 2 52* 1 unused bit flag in domain_info to indicate an unreferenced domain, 1 bit 2 53* in the flag word for rmdb copying. 2 54* END HISTORY COMMENTS */ 2 55 2 56 2 57 /* this include file contains the structures that go into the make up 2 58* of the "db_model" segment in the model for the database. 2 59* in addition there file_model.m segments, 1 for each database file(see mdbm_file_model.incl.pl1) 2 60* 2 61* the db_model structure goes at the base of the segment, and contains items unique to 2 62* the whole databse. in addition, it has an area of size to fill the 2 63* rest of a segment, that holds the lists of files and domains in the database. 2 64* these lists are singly forward linked lists. all "pointers" in the database model 2 65* are maintained as offsets(bit (18)) from the base of the particular model segment 2 66* since actual pointers are process dependent on segment number. 2 67* the remaining structures are first a path_entry one to save pathnames in, 2 68* and the stack_item and constent structures, used to save a boolean 2 69* expression in polish form, with the stack represented by a linked list. 2 70* the final structure is one for identifying the status of version information */ 2 71 2 72 dcl 1 db_model aligned based (dbm_ptr),/* base of db_model segment, allocated once per database */ 2 73 2 version unal fixed bin, /* data base version, currently 4 */ 2 74 2 db_type_flags unal, 2 75 3 copy_good bit (1) unal, /* "1"b => copy of the db_model is the valid copy */ 2 76 3 unused (13) bit (1) unal, 2 77 3 rollback_on bit (1) unal, /* "1"b => before journaling is to be done */ 2 78 3 concurrency_on bit (1) unal, /* "1"b => dm_file concurrency is being used */ 2 79 3 transactions_needed bit (1) unal, /* "1"b => transactions are needed to reference data */ 2 80 3 vfile_type bit (1) unal, /* "1"b => vfile type relations, "0"b => dm_file type relations */ 2 81 2 uniq_sw_name char (32), /* per database unique attach switch name for files */ 2 82 2 consistant bit (1) unal, /* ON => correctly created/restructured database, ok to open */ 2 83 2 mdbm_secured bit (1) unal, /* on => database has been secured */ 2 84 2 reserved bit (34) unal, /* reserved for flags */ 2 85 2 blk_file_id_len unal fixed bin, /* no. bits required for blocked file id. */ 2 86 2 unblk_file_id_len unal fixed bin, /* number of file id bits, unblocked file */ 2 87 2 num_blk_files unal fixed bin, /* number of blocked files defined in db */ 2 88 2 num_unblk_files unal fixed bin, /* number of unblocked files defined in db */ 2 89 2 num_rels unal fixed bin, /* number of relations defined in db. */ 2 90 2 num_domains unal fixed bin, /* number of domains defined */ 2 91 2 num_dyn_links unal fixed bin, /* no. dynamic links defined */ 2 92 2 max_max_tuples unal fixed bin (35), /* maximum max_tuples across all files */ 2 93 2 pad_1 unal fixed bin (35), /* for future use */ 2 94 2 pad_2 unal fixed bin (35), /* for future use */ 2 95 2 version_ptr bit (18), /* offset to version structure */ 2 96 2 file_ptr unal bit (18), /* offset to first in threaded list of file_infos */ 2 97 2 domain_ptr unal bit (18), /* offset to first in list of domain_infos */ 2 98 2 unreferenced_attribute_ptr unal bit (18), /* offset to first in list of unreferenced attr_infos */ 2 99 2 unused_offsets (11) unal bit (18), /* extra offsets if needed */ 2 100 2 last_restructuring_history_offset unal bit (18), /* offset to last restructuring history entry */ 2 101 2 inconsistent_message_offset unal bit (18), /* offset to message indicating why db is inconsistent */ 2 102 2 first_restructuring_history_offset unal bit (18), /* offset to first restructuring history entry */ 2 103 2 changer_ptr unal bit (18), /* offset to information about db creation */ 2 104 2 dbm_area area (sys_info$max_seg_size - fixed (rel (addr (db_model.dbm_area))) - 1); 2 105 2 106 dcl dbm_ptr ptr; 2 107 2 108 /* the files in the database each have a file_info containing 2 109* their name, the file_model for each file is found by initiating the 2 110* segment "file_name.m" (i.e. the file's name with suffix ".m") 2 111* the file_info list is a singly linked list in definition order */ 2 112 2 113 dcl 1 file_info aligned based (fi_ptr), /* list of file names and numbers */ 2 114 2 file_name char (30), /* name of file */ 2 115 2 file_id bit (36), /* id number of file */ 2 116 2 fwd_ptr unal bit (18), /* thread to next in list */ 2 117 2 unused unal bit (18); /* for future expansion */ 2 118 2 119 dcl fi_ptr ptr; 2 120 2 121 /* each domain used in the database will have a domain info saved in the db_model 2 122* segment. it describes the domain of the given name, and it's options. 2 123* the domain_info's form a singly linked list in definition order */ 2 124 2 125 dcl 1 domain_info aligned based (di_ptr), /* one for each domain defined */ 2 126 2 name char (32), /* name of domain */ 2 127 2 db_desc_is_ptr bit (1) unal, /* on if descriptor is pointer to real desc. */ 2 128 2 user_desc_is_ptr bit (1) unal, /* on if user desc is ptr */ 2 129 2 no_conversion bit (1) unal, /* if no conversion allowed */ 2 130 2 procedures_present bit (1) unal, /* on => ids type procedures present */ 2 131 2 unreferenced bit (1) unal, /* on => this domain is not used in any attribute */ 2 132 2 reserved bit (31) unal, 2 133 2 db_desc bit (36), /* desc. for item in db, or ptr to it */ 2 134 2 user_desc bit (36), /* desc. for user-visible attr, or ptr */ 2 135 2 ave_len fixed bin (35), /* average length of varying string */ 2 136 2 nck_items unal fixed bin, /* no. items in check stack */ 2 137 2 fwd_thread unal bit (18), /* offset to next in list */ 2 138 2 check_path_ptr unal bit (18), /* integ. check proc. */ 2 139 2 ck_stack_ptr unal bit (18), /* to check stack */ 2 140 2 encd_path_ptr unal bit (18), /* encode procedure */ 2 141 2 decd_path_ptr unal bit (18), /* decode procedure */ 2 142 2 str_before_path_ptr unal bit (18), /* proc paths and entries */ 2 143 2 str_err_path_ptr unal bit (18), 2 144 2 str_after_path_ptr unal bit (18), 2 145 2 get_before_path_ptr unal bit (18), 2 146 2 get_err_path_ptr unal bit (18), 2 147 2 get_after_path_ptr unal bit (18), 2 148 2 mod_before_path_ptr unal bit (18), 2 149 2 mod_err_path_ptr unal bit (18), 2 150 2 mod_after_path_ptr unal bit (18), 2 151 2 unused_1 unal bit (18), /* for future expansion */ 2 152 2 unused_2 unal bit (18), 2 153 2 changer_ptr unal bit (18); /* pointer to change_id and chane_time structure */ 2 154 2 155 dcl di_ptr ptr; 2 156 2 157 /* information necessary for attributes that are not used in any relation */ 2 158 2 159 dcl 1 unreferenced_attribute aligned based (ua_ptr), 2 160 2 name char (32), /* name of attribute */ 2 161 2 domain_ptr bit (18) unal, /* to domain_info */ 2 162 2 fwd_thread bit (18) unal, /* to next in list */ 2 163 2 unused (2) bit (18) unal; 2 164 2 165 dcl ua_ptr ptr; 2 166 2 167 2 168 /* space saving pathname$entryname structure, to be allocated 2 169* only when a path$entry has to be saved, else only a bit(18) 2 170* offset takes up space in the main model structure */ 2 171 2 172 declare 1 path_entry based (path_entry_ptr), 2 173 2 path char (168), /* pathname portion of desired path$entry */ 2 174 2 entry char (32), /* entryname portion of desired path$entry */ 2 175 2 reserved unal bit (36); /* for future use */ 2 176 2 177 declare path_entry_ptr ptr; 2 178 2 179 2 180 2 181 2 182 2 183 /* declarations for model of postfix stack holding the check option boolean expression 2 184* the following encoding values indicate the corresponding type of stack element 2 185* 2 186* 1 = 2 187* 2 ^= 2 188* 3 > 2 189* 4 < 2 190* 5 >= 2 191* 6 <= 2 192* 2 193* 10 and 2 194* 20 or 2 195* 30 not 2 196* 2 197* 40 - (minus) 2 198* 2 199* 50 domain variable(same name as domain) 2 200* 2 201* 60 constant(number, bit string, or character string) 2 202* 2 203**/ 2 204 2 205 2 206 declare 1 stack_item based (stack_item_ptr), /* element of stack model list */ 2 207 2 next bit (18), /* link to next in list */ 2 208 2 type fixed binary, /* code for this element type */ 2 209 2 value_ptr bit (18); /* pointer to variable holding value, 2 210* if this is a constant element type */ 2 211 2 212 declare stack_item_ptr ptr; /* pointer to a stack element */ 2 213 2 214 2 215 2 216 declare 1 constant based (constant_ptr), /* variable size space for constant's value storage */ 2 217 2 length fixed bin (35), /* length allocated to hold value */ 2 218 2 value bit (alloc_length refer (constant.length)) aligned; /* value for this constant */ 2 219 2 220 declare constant_ptr ptr; /* pointer to constant's value space */ 2 221 2 222 declare alloc_length fixed binary (35) internal static; /* amount of space to allocate for constant's value */ 2 223 2 224 /* version structure, giving status of source for CMDB/RMDB, 2 225* status of model, and status of resultant */ 2 226 2 227 /* version number is in form MM.N.Y 2 228* where MM is the major version number, N is the minor version alteration, 2 229* and Y is the lastest modification to that alteration, 2 230* where M and N represent numbers 0-9, and Y is a letter */ 2 231 2 232 declare 1 version_status unal based (version_status_ptr), 2 233 2 cmdb_rmdb, 2 234 3 major fixed bin, 2 235 3 minor fixed bin, 2 236 3 modification char (4), 2 237 2 model, 2 238 3 major fixed bin, 2 239 3 minor fixed bin, 2 240 3 modification char (4), 2 241 2 resultant, 2 242 3 major fixed bin, 2 243 3 minor fixed bin, 2 244 3 modification char (4); 2 245 2 246 declare version_status_ptr ptr; 2 247 2 248 2 249 /* maintains information only about the db creation */ 2 250 2 251 declare 1 changer unal based (changer_ptr), 2 252 2 id char (32), 2 253 2 time fixed bin (71), 2 254 2 next bit (18); /* to next in the singly linked list */ 2 255 2 256 declare changer_ptr ptr; 2 257 2 258 2 259 dcl 01 message_str unal based (message_str_ptr), /* general purpose structure to hold messages */ 2 260 02 len fixed bin, /* length of the message */ 2 261 02 text char (message_str_len refer (message_str.len)), /* actual message */ 2 262 02 name char (32), /* name of thing that set the message */ 2 263 02 undo_request char (100), /* rmdb request that will undo the operation 2 264* that caused the database to become inconsistent */ 2 265 02 mbz bit (36); /* for possible extensions, like an offset to another message */ 2 266 2 267 dcl message_str_ptr ptr; /* pointer to the message_str structure */ 2 268 2 269 dcl message_str_len fixed bin; /* initail length of the text string in message_str */ 2 270 2 271 /* END INCLUDE FILE mdbm_db_model.incl.pl1 */ 2 272 2 273 254 3 1 /* BEGIN INCLUDE FILE mdbm_file_model.incl.pl1 -- jaw, 8/29/78 */ 3 2 3 3 3 4 /****^ HISTORY COMMENTS: 3 5* 1) change(79-02-01,JGray), approve(), audit(), install(): 3 6* modified to save space occupied by model 3 7* 2) change(82-05-19,Davids), approve(), audit(), install(): 3 8* renamed rel_info.nsec_inds to rel_info.unused_3 because it really wasn't 3 9* the number of secondary indices in the relation - it was always zero. 3 10* 3) change(82-08-19,DWoodka), approve(), audit(), install(): 3 11* changed rel_info.id and attr_info.index_id to bit (36) unaligned for the 3 12* DMS conversion. 3 13* 4) change(82-09-20,MKubicar), approve(), audit(), install(): 3 14* changed rel_info.id and attr_info.index_id to aligned; they are needed that 3 15* way for relmgr_ calls. Also added rel_info.primary_key_index_id, needed 3 16* for relation manager changes. 3 17* 5) change(85-12-02,Spitzer), approve(85-12-02,MCR7311), 3 18* audit(86-09-02,Blair), install(86-10-16,MR12.0-1187): 3 19* used 2 reserved bits to indicate whether the copy of the .m and/or 3 20* files are good (for rmdb) 3 21* END HISTORY COMMENTS */ 3 22 3 23 3 24 /* each file in the database will have a model segment with the name 3 25* file_name.m (i.e. the files name plus a suffix of ".m") 3 26* the file_model structure is allocated at the base of the segment for a given file. 3 27* it contains an area with which all other structures in this include file are allocated. 3 28* these structures contain the information about which relations, foreign keys, 3 29* and attributes are members of this file. all lists are singly linked lists in 3 30* definition order. pointers to these structures are obtained by using the "pointer" 3 31* builtin function with arguments of the segment base pointer, and the 3 32* offset (bit (18)) relative to that pointer that is actually stored in 3 33* the file model itself. this is because pointer segment numbers are 3 34* per process dependent. the major lists pointed to by the file_model structure 3 35* are the list of relations in this file(each with a contained attribute list), 3 36* and the list of foreign keys whose parent relation resides in this file 3 37* (along with a participating attribute sublist, and the child relation list, 3 38* if they are also in this file) */ 3 39 3 40 dcl 1 file_model aligned based (fm_ptr), /* base of segment */ 3 41 2 temporary bit (1) unal, /* on if file not part of db. */ 3 42 2 procedures_present bit (1) unal, /* on => ids procedures present */ 3 43 2 file_model_copy_good bit (1) unaligned, /* on => .m file is the good copy */ 3 44 2 relation_copy_good bit (1) unaligned, /* on => file is the good copy */ 3 45 2 reserved bit (32) unal, /* reserved for future flags */ 3 46 2 max_tuples fixed bin (35), /* max no. of tuples in file */ 3 47 2 num_blocks fixed bin (35), /* number of blocks in file */ 3 48 2 num_buckets fixed bin (35), /* number of buckets in file */ 3 49 2 pad_1 fixed bin (35), /* for future use */ 3 50 2 pad_2 fixed bin (35), 3 51 2 ratd_len fixed bin (21), /* length of above */ 3 52 2 mratd_len fixed bin (21), /* length of above */ 3 53 2 uatd_len fixed bin (21), /* char. length of update attach desc. */ 3 54 2 latd_len fixed bin (21), /* char. len. of attach desc. */ 3 55 2 sratd_len fixed bin (21), /* char. length of above attach desc. */ 3 56 2 suatd_len fixed bin (21), /* char. length of attach desc. */ 3 57 2 file_type unal fixed bin, /* 1 => unblocked, 2 => blocked */ 3 58 2 block_size unal fixed bin, /* no. pages in block */ 3 59 2 block_factor unal fixed bin, /* no. tuple slots per block */ 3 60 2 bucket_density unal fixed bin, /* no. of bucket headers per block, neg. => blocks per header */ 3 61 2 tuple_id_len unal fixed bin, /* no. bits needed for local tuple id */ 3 62 2 num_rels unal fixed bin, /* number of relations in file */ 3 63 2 num_links unal fixed bin, /* number of links in file */ 3 64 2 num_children unal fixed bin, /* count of all child_link_infos in this file */ 3 65 2 default_rbs (3) unal fixed bin (8), /* file ring brackets when not MDBM-secured */ 3 66 2 rel_ptr unal bit (18), /* to first of list of rel_infos */ 3 67 2 link_ptr unal bit (18), /* to first in list of parent link_infos */ 3 68 2 children_ptr unal bit (18), /* to list of all child_link_infos in this file model */ 3 69 2 cno_array_ptr unal bit (18), /* pointer to array of data component numbers */ 3 70 2 fi_ptr unal bit (18), /* offset to file_info in db_model */ 3 71 2 suatd_ptr unal bit (18), /* offset of scope_update attach desc. */ 3 72 2 sratd_ptr unal bit (18), /* offset of scope_retrieve attach desc. */ 3 73 2 latd_ptr unal bit (18), /* offset of load attach desc. */ 3 74 2 uatd_ptr unal bit (18), /* offset of update attach description for file */ 3 75 2 mratd_ptr unal bit (18), /* offset of moniter-retrieve attach desc. */ 3 76 2 ratd_ptr unal bit (18), /* offset of retrieve attach desc. */ 3 77 2 open_eu_before_path_ptr unal bit (18), /* paths and ents of file procs. */ 3 78 2 open_eu_err_path_ptr unal bit (18), 3 79 2 open_eu_after_path_ptr unal bit (18), 3 80 2 open_er_before_path_ptr unal bit (18), 3 81 2 open_er_err_path_ptr unal bit (18), 3 82 2 open_er_after_path_ptr unal bit (18), 3 83 2 open_neu_before_path_ptr unal bit (18), /* paths and ents of file procs. */ 3 84 2 open_neu_err_path_ptr unal bit (18), 3 85 2 open_neu_after_path_ptr unal bit (18), 3 86 2 open_ner_before_path_ptr unal bit (18), 3 87 2 open_ner_err_path_ptr unal bit (18), 3 88 2 open_ner_after_path_ptr unal bit (18), 3 89 2 open_pu_before_path_ptr unal bit (18), 3 90 2 open_pu_err_path_ptr unal bit (18), 3 91 2 open_pu_after_path_ptr unal bit (18), 3 92 2 open_pr_before_path_ptr unal bit (18), 3 93 2 open_pr_err_path_ptr unal bit (18), 3 94 2 open_pr_after_path_ptr unal bit (18), 3 95 2 open_cu_before_path_ptr unal bit (18), 3 96 2 open_cu_err_path_ptr unal bit (18), 3 97 2 open_cu_after_path_ptr unal bit (18), 3 98 2 open_cr_before_path_ptr unal bit (18), 3 99 2 open_cr_err_path_ptr unal bit (18), 3 100 2 open_cr_after_path_ptr unal bit (18), 3 101 2 close_before_path_ptr unal bit (18), 3 102 2 close_err_path_ptr unal bit (18), 3 103 2 close_after_path_ptr unal bit (18), 3 104 2 unused_1 unal bit (18), /* for future expansion */ 3 105 2 unused_2 unal bit (18), 3 106 2 changer_ptr unal bit (18), /* pointer to changer_id, changer_time structure */ 3 107 2 fm_area area (sys_info$max_seg_size - fixed (rel (addr (file_model.fm_area))) - 1); 3 108 dcl fm_ptr ptr; 3 109 dcl atd char (atd_len) based (atd_ptr); /* attach description for each file ready mode */ 3 110 dcl atd_ptr ptr; 3 111 dcl atd_len fixed bin; 3 112 dcl 1 comp_no_array unal based (cna_ptr), /* ordered array of data comp. nos. */ 3 113 2 ncomponents fixed bin, 3 114 2 comp_no (ncomp_init refer (comp_no_array.ncomponents)) fixed bin; 3 115 dcl cna_ptr ptr; 3 116 dcl ncomp_init fixed bin; 3 117 3 118 /* a rel_info structure contains information describing a relation. 3 119* a relation may only occur in one file, thus there is one rel_info 3 120* per relation per database, each stored in the file_model area for 3 121* the file that contains it. the list of rel_info's in this file 3 122* form a singly linked list in definition order. 3 123* the rel_info itself points to a list of the attributes it contains, 3 124* and to any parent_link or child_link info's that involve it in a foreign key */ 3 125 3 126 dcl 1 rel_info aligned based (ri_ptr), 3 127 2 name char (32), /* relation name */ 3 128 2 id bit (36) aligned, /* relation id number */ 3 129 2 hashed bit (1) unal, /* on if hashed */ 3 130 2 duplicates bit (1) unal, /* on if allow dup. hash fields */ 3 131 2 via_link bit (1) unal, /* on if to be stored by parent */ 3 132 2 system bit (1) unal, /* on if dont care how stored */ 3 133 2 indexed bit (1) unal, /* on if secondary index */ 3 134 2 mrds_update bit (1) unal, /* on if updateable by MRDS */ 3 135 2 mrds_retrieve bit (1) unal, /* on if retrievable by MRDS */ 3 136 2 virtual bit (1) unal, /* if virtual relation, mapped on IDS records */ 3 137 2 procedures_present bit (1) unal, /* on => ids type procedures present */ 3 138 2 reserved bit (27) unal, /* for future flags */ 3 139 2 num_attr unal fixed bin, /* number of attributes (all levels) defined */ 3 140 2 num_links_child unal fixed bin, /* no. links in which child */ 3 141 2 num_links_par unal fixed bin, /* no. links_in which parent */ 3 142 2 max_attr_index_id unal fixed bin, /* max index id used by attr in this rel or PLI */ 3 143 2 num_key_attrs unal fixed bin, /* number of attributes in primary key for this rel */ 3 144 2 nvar_atts unal fixed bin, /* no. varying len. attributes */ 3 145 2 n36_thds unal fixed bin, /* no. of 36-bit threads */ 3 146 2 n27_thds unal fixed bin, /* no of 27-bit threads */ 3 147 2 n18_thds unal fixed bin, /* no of 18-bit threads */ 3 148 2 unused_3 unal fixed bin, /* element that was never used */ 3 149 2 max_data_len fixed bin (35), /* max length of data portion of tuple */ 3 150 2 avg_data_len fixed bin (35), /* average length of tuple data portion */ 3 151 2 max_key_len fixed bin (35), /* max key length if not hashed */ 3 152 2 var_offset fixed bin (35), /* position of first varying attr. */ 3 153 2 max_tuples fixed bin (35), /* max no. tuples if blocked file */ 3 154 2 fwd_thread unal bit (18), /* offsset to next rel. in file */ 3 155 2 attr_ptr unal bit (18), /* to attr. info */ 3 156 2 primary_key_index_id bit (36) aligned, /* index id of the relation's primary key */ 3 157 2 clink_ptr unal bit (18), /* offset to child info of link determining location */ 3 158 2 map_ptr unal bit (18), /* pointer to mapping info if virtual rel. */ 3 159 2 sec_ind_ptr unal bit (18), /* ptr to list of sec. ind. infos, init. not used */ 3 160 2 locator_proc_path_ptr unal bit (18), /* proc to determ. location */ 3 161 2 link_before_path_ptr unal bit (18), /* op. proc. paths and entries */ 3 162 2 link_err_path_ptr unal bit (18), 3 163 2 link_after_path_ptr unal bit (18), 3 164 2 unlk_before_path_ptr unal bit (18), 3 165 2 unlk_err_path_ptr unal bit (18), 3 166 2 unlk_after_path_ptr unal bit (18), 3 167 2 str_before_path_ptr unal bit (18), 3 168 2 str_err_path_ptr unal bit (18), 3 169 2 str_after_path_ptr unal bit (18), 3 170 2 del_before_path_ptr unal bit (18), 3 171 2 del_err_path_ptr unal bit (18), 3 172 2 del_after_path_ptr unal bit (18), 3 173 2 mod_before_path_ptr unal bit (18), 3 174 2 mod_err_path_ptr unal bit (18), 3 175 2 mod_after_path_ptr unal bit (18), 3 176 2 find_before_path_ptr unal bit (18), 3 177 2 find_err_path_ptr unal bit (18), 3 178 2 find_after_path_ptr unal bit (18), 3 179 2 retr_before_path_ptr unal bit (18), 3 180 2 retr_err_path_ptr unal bit (18), 3 181 2 retr_after_path_ptr unal bit (18), 3 182 2 unused_1 unal bit (18), /* for future expansion */ 3 183 2 unused_2 unal bit (18), 3 184 2 changer_ptr unal bit (18) ; /* pointer to changer_id, changer_time structure */ 3 185 dcl ri_ptr ptr; 3 186 3 187 /* a attr_info structure contains information about an attribute in a given relation. 3 188* since attributes may appear in more than one relation, each occurence of an attribute 3 189* means that an attr_info for it will be put in that relations sublist of attributes. 3 190* the list is singly linked in definition order. the attr_info describes 3 191* the data it represents, and how that data is used during a database search. */ 3 192 dcl 1 attr_info aligned based (ai_ptr), /* info for a single attr. in attr. list */ 3 193 2 name char (32), /* name of attribute */ 3 194 2 key_attr bit (1) unal, /* on if part of primary or hash key */ 3 195 2 index_attr bit (1) unal, /* on if a secondary index */ 3 196 2 link_attr bit (1) unal, /* on if participates in link */ 3 197 2 reserved bit (33) unal, 3 198 2 index_id bit (36) aligned, /* id of index if index attr. */ 3 199 2 defn_order unal fixed bin, /* relative posit. in which defined */ 3 200 2 key_order unal fixed bin, /* relative posit. in key */ 3 201 2 bit_offset fixed bin (35), /* position in tuple */ 3 202 2 bit_length fixed bin (35), /* length if fixed */ 3 203 2 link_child_cnt fixed bin, /* number of uses of attr in child rel of link */ 3 204 2 link_par_cnt fixed bin, /* number of uses of attr in parent rel of link */ 3 205 2 domain_ptr unal bit (18), /* to domain info */ 3 206 2 rslt_ptr unal bit (18), /* ptr to info for "result" clause */ 3 207 2 fwd_thread unal bit (18), /* to next in list */ 3 208 2 changer_ptr unal bit (18) ; /* pointer to changer_id and changer_time */ 3 209 dcl ai_ptr ptr; 3 210 3 211 /* a parent_link_info structure is the carrier of foreign key definition info. 3 212* each time a foreign key definition indicates a relation as it's parent, 3 213* that relation will get a parent_link_info put in a list of associated parent_link_info's. 3 214* a relation can be parent and/or child in any number of foreign keys. 3 215* the parent_link_info structure describes the foreign key, and also points 3 216* to a list of the attributes that participate in this foreign key. 3 217* (this could be from 1 up to all attributes in the relation) 3 218* the attr_list structures are in a singly linked list in definition order 3 219* for this purpose. also pointed to is a list of child_link_info's 3 220* that describe the child relations in this foreign key. since foreign keys 3 221* may span files, not all related child_link_info's have to be in this file's 3 222* model area. */ 3 223 dcl 1 parent_link_info aligned based (pli_ptr), /* gen'l link info, appears in each area spanned by link parent */ 3 224 2 name char (32), /* name of link */ 3 225 2 singular bit (1) unal, /* on if system owned link */ 3 226 2 temp bit (1) unal, /* on if temp. order */ 3 227 2 first bit (1) unal, /* insertion indicators */ 3 228 2 last bit (1) unal, 3 229 2 next bit (1) unal, 3 230 2 prior bit (1) unal, 3 231 2 sort_rel_name bit (1) unal, /* sort -- relation name */ 3 232 2 sort_keys bit (1) unal, /* sort -- defined keys */ 3 233 2 dup_first bit (1) unal, /* duplicates first */ 3 234 2 dup_last bit (1) unal, /* duplicates last */ 3 235 2 indexed bit (1) unal, /* locate parent via index */ 3 236 2 hashed bit (1) unal, /* locate parent via hashed primary key */ 3 237 2 thread_36 bit (1) unal, /* thread size indicators */ 3 238 2 thread_27 bit (1) unal, 3 239 2 thread_18 bit (1) unal, 3 240 2 clustered bit (1) unal, /* ON => cluster option specified for this link */ 3 241 2 procedures_present bit (1) unal, /* on => ids type procedures present */ 3 242 2 reserved bit (19) unal, /* reserved for future flags */ 3 243 2 index_id aligned bit (8), /* id of index if indexed */ 3 244 2 thread_index unal fixed bin, /* index to threads in parent */ 3 245 2 nsel_attr unal fixed bin, /* no. attr. determ. parent */ 3 246 2 n_children unal fixed bin, /* no. children in link */ 3 247 2 child_fn char (30), /* file name for first child in list */ 3 248 2 parent_ptr unal bit (18), /* to parent relation info in file model */ 3 249 2 child_ptr unal bit (18), /* to list of child info ptrs */ 3 250 2 sel_attr_ptr unal bit (18), /* to first in list of attr. determ. parent */ 3 251 2 fwd_thread unal bit (18), /* thread to next parent link info in file */ 3 252 2 rel_fwd_thread unal bit (18), /* for multiple links within a relation */ 3 253 2 sort_before_path_ptr unal bit (18), /* proc. paths and entries */ 3 254 2 sort_err_path_ptr unal bit (18), 3 255 2 sort_after_path_ptr unal bit (18), 3 256 2 srch_before_path_ptr unal bit (18), 3 257 2 srch_err_path_ptr unal bit (18), 3 258 2 srch_after_path_ptr unal bit (18), 3 259 2 link_before_path_ptr unal bit (18), 3 260 2 link_err_path_ptr unal bit (18), 3 261 2 link_after_path_ptr unal bit (18), 3 262 2 unlk_before_path_ptr unal bit (18), 3 263 2 unlk_err_path_ptr unal bit (18), 3 264 2 unlk_after_path_ptr unal bit (18), 3 265 2 unused_1 unal bit (18), /* for future expansion */ 3 266 2 unused_2 unal bit (18), 3 267 2 changer_ptr unal bit (18) ; /* pointer to changer_id, changer_time structure */ 3 268 dcl pli_ptr ptr; 3 269 3 270 /* a child_link_info structure is the counter part of a parent_link_info 3 271* for foreign key child relations. each time a relation is defined to be 3 272* a child in a foreign key, it's list of child_link_infos will be added to. 3 273* this list is singly linked in foreign key definition order. 3 274* the child_link_info points to a list of participating attributes from the 3 275* child relation by means of a singly linked list of attr_list structures 3 276* in definition order. the number of attributes in the parent attr_list 3 277* and the child attr_list lists are the same with corresponding attr_list 3 278* attributes having the same domain. all child_link_infos in this file 3 279* are on a seperately linked list. this may not include all 3 280* child_link_infos for foreign keys whose parent relation resides in this file, 3 281* since foreign keys may span files, and the child_link_info will 3 282* reside in the file containing it's associated relation_info. */ 3 283 dcl 1 child_link_info aligned based (cli_ptr), /* in same files as children */ 3 284 2 link_name char (32), /* name of foreign key involving parent relation for this child */ 3 285 2 mandatory bit (1) unal, /* on if membership mandatory */ 3 286 2 fixed bit (1) unal, /* on if membership fixed */ 3 287 2 optional bit (1) unal, /* on if membership optional */ 3 288 2 auto bit (1) unal, /* on if insertion automatic */ 3 289 2 manual bit (1) unal, /* on if insertion manual */ 3 290 2 struct_const bit (1) unal, /* on if membership constrained by attr. comp. */ 3 291 2 range_sel bit (1) unal, /* on if range type selection */ 3 292 2 key_dup_first bit (1) unal, /* sort key flags */ 3 293 2 key_dup_last bit (1) unal, 3 294 2 key_null bit (1) unal, /* on if null allowed */ 3 295 2 sel_system bit (1) unal, /* selection criteria flags */ 3 296 2 sel_current bit (1) unal, 3 297 2 sel_key bit (1) unal, 3 298 2 sel_proc bit (1) unal, 3 299 2 no_null bit (1) unal, /* if null key values not allowed */ 3 300 2 reserved bit (21) unal, 3 301 2 thread_index unal fixed bin, /* index to thread in tuple */ 3 302 2 chain_len unal fixed bin, /* no. "then-thru's" in selction crit. */ 3 303 2 n_sort_keys unal fixed bin, /* no. attr. in sort key */ 3 304 2 n_sel_items unal fixed bin, /* no. items to sel for link sel. */ 3 305 2 n_dup_prevs unal fixed bin, /* no. attr. for dup prev. */ 3 306 2 link_fwd_fn char (30), /* file name for next child info in link */ 3 307 2 parent_fn char (30), /* file name for parent info */ 3 308 2 parent_ptr unal bit (18), /* offset to parent link info */ 3 309 2 link_fwd_thread unal bit (18), /* offset for next child in link */ 3 310 2 rel_info_ptr unal bit (18), /* to corresponding rel info */ 3 311 2 dup_prev_ptr unal bit (18), /* list of attrs. for dup. prev. */ 3 312 2 sel_ptr unal bit (18), /* list of attr. for link sel. */ 3 313 2 rel_fwd_thread unal bit (18), /* for multiple links within a relation */ 3 314 2 child_fwd_thread unal bit (18), /* pointer to next in list of all child_link_infos in this file */ 3 315 2 sort_key_ptr unal bit (18), /* list of sort keys */ 3 316 2 chain_ptr unal bit (18), /* to "then thru" list */ 3 317 2 sel_proc_path_ptr unal bit (18), /* link selection proc. */ 3 318 2 link_before_path_ptr unal bit (18), /* proc. paths and entries */ 3 319 2 link_err_path_ptr unal bit (18), 3 320 2 link_after_path_ptr unal bit (18), 3 321 2 unlk_before_path_ptr unal bit (18), 3 322 2 unlk_err_path_ptr unal bit (18), 3 323 2 unlk_after_path_ptr unal bit (18), 3 324 2 srch_before_path_ptr unal bit (18), 3 325 2 srch_err_path_ptr unal bit (18), 3 326 2 srch_after_path_ptr unal bit (18), 3 327 2 unused_1 unal bit (18), /* for future expansion */ 3 328 2 unused_2 unal bit (18) ; 3 329 dcl cli_ptr ptr; 3 330 3 331 /* the attr_list structure is associated with the parent_link_info 3 332* and child_link_info structures to represent by means of a singly linked list 3 333* the participating attributes from relations in a foreign key. 3 334* the parent_link_info has a list for the parent relation, 3 335* and the child_link_info has a list for the child relation. 3 336* the participating attributes are a subset(not necessary proper) of 3 337* those attributes contained in a relation definition. 3 338* there are equal numbers of attr_list structures in the parent and 3 339* child lists of the same foreign key. the corresponding attributes in these 3 340* lists must have the same domain. */ 3 341 dcl 1 attr_list aligned based (al_ptr), /* general attr. list */ 3 342 2 attr_fn char (30), /* file name for attr. */ 3 343 2 attr_ptr unal bit (18), /* to attr info block */ 3 344 2 fwd_thread unal bit (18); /* to next in list */ 3 345 dcl al_ptr ptr; 3 346 dcl 1 sort_key aligned based (sk_ptr), /* entry in sort key list */ 3 347 2 ascend bit (1) unal, /* ascending order */ 3 348 2 descend bit (1) unal, /* descending order */ 3 349 2 reserved bit (34) unal, 3 350 2 attr_ptr unal bit (18), /* to attr info */ 3 351 2 fwd_thread unal bit (18); /* to next in list */ 3 352 dcl sk_ptr ptr; 3 353 dcl 1 dup_prev aligned based (dp_ptr), /* dup. prevention list entry */ 3 354 2 attr_ptr unal bit (18), /* to attr info */ 3 355 2 fwd_thread unal bit (18); /* to next in list */ 3 356 dcl dp_ptr ptr; 3 357 dcl 1 select_chain aligned based (sc_ptr), /* "then thru" list entry */ 3 358 2 link_fn char (30), /* file name for thru link */ 3 359 2 link_ptr unal bit (18), /* to parent link info */ 3 360 2 parent_attr_ptr unal bit (18), /* to parent ident. attr. list */ 3 361 2 comp_proc_path_ptr unal bit (18), /* comparison procedure */ 3 362 2 comp_attr_fn char (30), /* file name for comparison attr. */ 3 363 2 comp_attr_ptr unal bit (18), /* to comparison attr list */ 3 364 2 fwd_thread unal bit (18); /* to next in chain */ 3 365 dcl sc_ptr ptr; 3 366 3 367 /* END INCLUDE FILE mdbm_file_model.incl.pl1 */ 3 368 3 369 255 256 4 1 /* BEGIN mdbm_descriptor.incl.pl1 -- jaw 5/31/78 */ 4 2 /* modified by Jim Gray - - Nov. 1979, to change type from fixed bin(5) to 4 3* unsigned fixed bin(6), so new packed decimal data types could be handled. 4 4* also the duplicate mrds_descriptor.incl.pl1 was eliminated. */ 4 5 4 6 dcl 1 descriptor based (desc_ptr), /* map of Multics descriptor */ 4 7 2 version bit (1) unal, /* DBM handles vers. 1 only */ 4 8 2 type unsigned fixed bin (6) unal, /* data type */ 4 9 2 packed bit (1) unal, /* on if data item is packed */ 4 10 2 number_dims bit (4) unal, /* dimensions */ 4 11 2 size, /* size for string data */ 4 12 3 scale bit (12) unal, /* scale for num. data */ 4 13 3 precision bit (12) unal, /* prec. for num. data */ 4 14 2 array_info (num_dims), 4 15 3 lower_bound fixed bin (35), /* lower bound of dimension */ 4 16 3 upper_bound fixed bin (35), /* upper bound of dimension */ 4 17 3 multiplier fixed bin (35); /* element separation */ 4 18 4 19 dcl desc_ptr ptr; 4 20 dcl num_dims fixed bin init (0) ; /* more useful form of number_dims */ 4 21 4 22 /* END mdbm_descriptor.incl.pl1 */ 4 23 4 24 257 258 259 end rmdb_build_attr_info; 260 SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 10/16/86 1143.7 rmdb_build_attr_info.pl1 >special_ldd>install>MR12.0-1187>rmdb_build_attr_info.pl1 252 1 10/14/83 1609.0 rmdb_create_rel_info.incl.pl1 >ldd>include>rmdb_create_rel_info.incl.pl1 254 2 10/16/86 1139.3 mdbm_db_model.incl.pl1 >special_ldd>install>MR12.0-1187>mdbm_db_model.incl.pl1 255 3 10/16/86 1139.9 mdbm_file_model.incl.pl1 >special_ldd>install>MR12.0-1187>mdbm_file_model.incl.pl1 257 4 10/14/83 1608.6 mdbm_descriptor.incl.pl1 >ldd>include>mdbm_descriptor.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. I_adi_ptr parameter pointer dcl 39 ref 8 49 I_dbm_ptr parameter pointer dcl 38 ref 8 48 I_di_ptr parameter pointer dcl 41 ref 8 51 I_fm_ptr parameter pointer dcl 40 ref 8 50 NULL_OFFSET constant bit(18) initial unaligned dcl 223 ref 65 136 O_err_code parameter fixed bin(35,0) dcl 43 set ref 8 53* 71* 81* 110* 142* O_err_msg parameter char unaligned dcl 42 set ref 8 52* 70* 111* 141* VARYING_BIT_TYPE constant fixed bin(17,0) initial dcl 248 ref 165 VARYING_CHAR_TYPE constant fixed bin(17,0) initial dcl 249 ref 165 WORD 000000 constant fixed bin(17,0) initial dcl 226 set ref 186* addr builtin function dcl 224 ref 160 adi_ptr 000106 automatic pointer dcl 1-30 set ref 49* 69 92 94 107 111 193 ai_ptr 000120 automatic pointer dcl 3-209 set ref 65* 65* 69 70 75 76* 78 87* 89 90 92 95 96 100 101 104 105 118 121 124 125 128 132 133 134 135 136 137 162 174 176 185 186 191 193 attr_def_info based structure level 1 packed unaligned dcl 1-24 attr_info based structure level 1 dcl 3-192 set ref 87 attr_ptr 24(18) based bit(18) level 2 packed unaligned dcl 3-126 set ref 65 89* bit_length 14 based fixed bin(35,0) level 2 dcl 3-192 set ref 162* 176 186* 191 193 bit_offset 13 based fixed bin(35,0) level 2 dcl 3-192 set ref 174* 185* ceil builtin function dcl 225 ref 140 changer_ptr 32(18) based bit(18) level 2 in structure "db_model" packed unaligned dcl 2-72 in procedure "rmdb_build_attr_info" ref 137 changer_ptr 20(18) based bit(18) level 2 in structure "attr_info" packed unaligned dcl 3-192 in procedure "rmdb_build_attr_info" set ref 137* db_desc 11 based bit(36) level 2 dcl 2-125 set ref 108 160 db_model based structure level 1 dcl 2-72 dbm_ptr 000110 automatic pointer dcl 2-106 set ref 48* 137 defn_order 12 based fixed bin(17,0) level 2 packed unaligned dcl 3-192 set ref 128* desc_ptr 000122 automatic pointer dcl 4-19 set ref 160* 162 165 165 172* descriptor based structure level 1 unaligned dcl 4-6 descriptor_bit_36_ovrly based bit(36) unaligned dcl 227 set ref 162* di_ptr 000112 automatic pointer dcl 2-155 set ref 51* 108 134 160 divide builtin function dcl 228 ref 140 domain_info based structure level 1 dcl 2-125 domain_ptr 17 based bit(18) level 2 packed unaligned dcl 3-192 set ref 134* file_model based structure level 1 dcl 3-40 fm_area 46 based area level 2 dcl 3-40 ref 87 fm_ptr 000114 automatic pointer dcl 3-108 set ref 50* 55 55 65 78 87 fwd_thread 20 based bit(18) level 2 packed unaligned dcl 3-192 set ref 78 90* 136* index_attr 10(01) based bit(1) level 2 packed unaligned dcl 3-192 set ref 118* 125* index_id 11 based bit(36) level 2 dcl 3-192 set ref 121* 124* indexed 11(04) based bit(1) level 2 in structure "rel_info" packed unaligned dcl 3-126 in procedure "rmdb_build_attr_info" set ref 119* indexed 10(01) based bit(1) level 2 in structure "attr_def_info" packed unaligned dcl 1-24 in procedure "rmdb_build_attr_info" ref 107 key_attr 10 based bit(1) level 2 packed unaligned dcl 3-192 set ref 75 95* 100* key_attribute_count 000100 automatic fixed bin(17,0) dcl 230 set ref 63* 75* 75 96 key_order 12(18) based fixed bin(17,0) level 2 packed unaligned dcl 3-192 set ref 96* 101* link_attr 10(02) based bit(1) level 2 packed unaligned dcl 3-192 set ref 104* link_child_cnt 15 based fixed bin(17,0) level 2 dcl 3-192 set ref 132* link_par_cnt 16 based fixed bin(17,0) level 2 dcl 3-192 set ref 133* max_attr_index_id 13(18) based fixed bin(17,0) level 2 packed unaligned dcl 3-126 set ref 120* max_data_len 17 based fixed bin(35,0) level 2 dcl 3-126 set ref 191* 191 max_key_len 21 based fixed bin(35,0) level 2 dcl 3-126 set ref 140 193* 193 mdbm_util_$align_data_item 000010 constant entry external dcl 231 ref 172 mdbm_util_$get_data_bit_length 000012 constant entry external dcl 232 ref 162 mdbm_util_$mu_data_length 000030 constant entry external dcl 240 ref 108 mod builtin function dcl 233 ref 207 211 mrds_data_$max_attributes 000014 external static fixed bin(35,0) dcl 234 ref 80 mrds_data_$max_key_len 000016 external static fixed bin(35,0) dcl 235 ref 140 mrds_error_$long_index 000020 external static fixed bin(35,0) dcl 236 ref 110 mrds_error_$long_key 000022 external static fixed bin(35,0) dcl 237 ref 142 mrds_error_$max_attributes 000024 external static fixed bin(35,0) dcl 238 ref 81 mrds_error_$rst_name_duplicate 000026 external static fixed bin(35,0) dcl 239 ref 71 name based char(32) level 2 in structure "attr_def_info" packed unaligned dcl 1-24 in procedure "rmdb_build_attr_info" ref 69 92 111 name based char(32) level 2 in structure "rel_info" dcl 3-126 in procedure "rmdb_build_attr_info" ref 141 name based char(32) level 2 in structure "attr_info" dcl 3-192 in procedure "rmdb_build_attr_info" set ref 69 70 92* null builtin function dcl 241 ref 61 89 num_attr 12 based fixed bin(17,0) level 2 packed unaligned dcl 3-126 set ref 80 85* 85 128 num_dims 000124 automatic fixed bin(17,0) initial dcl 4-20 set ref 4-20* num_key_attrs 14 based fixed bin(17,0) level 2 packed unaligned dcl 3-126 set ref 97* 97 number_of_bits 000142 automatic fixed bin(17,0) dcl 219 set ref 207* 211* 215 nvar_atts 14(18) based fixed bin(17,0) level 2 packed unaligned dcl 3-126 set ref 184* 184 185 pad_base parameter fixed bin(35,0) dcl 218 ref 201 207 211 pad_size parameter fixed bin(17,0) dcl 217 ref 201 207 211 211 padding 000101 automatic fixed bin(17,0) dcl 242 set ref 172* 174 176 186* 191 prev_ptr 000102 automatic pointer dcl 243 set ref 61* 76* 89 90 primary_key 10 based bit(1) level 2 packed unaligned dcl 1-24 ref 94 193 ptr builtin function dcl 244 ref 55 65 78 rel builtin function dcl 245 ref 65 89 90 134 rel_info based structure level 1 dcl 3-126 rel_ptr 20(27) based bit(18) level 2 packed unaligned dcl 3-40 ref 55 reserved 10(03) based bit(33) level 2 packed unaligned dcl 3-192 set ref 105* ri_ptr 000116 automatic pointer dcl 3-185 set ref 55* 65 80 85 85 89 97 97 119 120 128 140 141 172 174 176 176 184 184 185 191 191 193 193 rslt_ptr 17(18) based bit(18) level 2 packed unaligned dcl 3-192 set ref 135* rtrim builtin function dcl 246 ref 70 141 type 0(01) based fixed bin(6,0) level 2 packed unsigned unaligned dcl 4-6 ref 165 165 var_offset 22 based fixed bin(35,0) level 2 dcl 3-126 set ref 172 174 176* 176 varying_string 000104 automatic bit(1) unaligned dcl 250 set ref 158* 165* 171 NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. RMDB_CREATE_REL_INFO_VERSION_1 internal static fixed bin(17,0) initial dcl 1-33 RMDB_IX_ATTRS_VERSION_1 internal static fixed bin(17,0) initial dcl 1-44 RMDB_SEL_VAL_INFO_VERSION_1 internal static fixed bin(17,0) initial dcl 1-53 al_ptr automatic pointer dcl 3-345 alloc_length internal static fixed bin(35,0) dcl 2-222 atd based char unaligned dcl 3-109 atd_len automatic fixed bin(17,0) dcl 3-111 atd_ptr automatic pointer dcl 3-110 attr_list based structure level 1 dcl 3-341 changer based structure level 1 packed unaligned dcl 2-251 changer_ptr automatic pointer dcl 2-256 child_link_info based structure level 1 dcl 3-283 cli_ptr automatic pointer dcl 3-329 cna_ptr automatic pointer dcl 3-115 comp_no_array based structure level 1 packed unaligned dcl 3-112 constant based structure level 1 unaligned dcl 2-216 constant_ptr automatic pointer dcl 2-220 dp_ptr automatic pointer dcl 3-356 dup_prev based structure level 1 dcl 3-353 fi_ptr automatic pointer dcl 2-119 file_info based structure level 1 dcl 2-113 fixed builtin function dcl 229 message_str based structure level 1 packed unaligned dcl 2-259 message_str_len automatic fixed bin(17,0) dcl 2-269 message_str_ptr automatic pointer dcl 2-267 ncomp_init automatic fixed bin(17,0) dcl 3-116 parent_link_info based structure level 1 dcl 3-223 path_entry based structure level 1 packed unaligned dcl 2-172 path_entry_ptr automatic pointer dcl 2-177 pli_ptr automatic pointer dcl 3-268 rmdb_create_rel_info based structure level 1 dcl 1-11 rmdb_create_rel_info_alloc automatic fixed bin(17,0) dcl 1-32 rmdb_create_rel_info_ptr automatic pointer dcl 1-31 rmdb_ix_attrs based structure level 1 dcl 1-36 rmdb_ix_attrs_alloc automatic fixed bin(17,0) dcl 1-42 rmdb_ix_attrs_ptr automatic pointer dcl 1-43 rmdb_sel_val_info based structure level 1 dcl 1-46 rmdb_sel_val_info_ptr automatic pointer dcl 1-52 sc_ptr automatic pointer dcl 3-365 select_chain based structure level 1 dcl 3-357 sk_ptr automatic pointer dcl 3-352 sort_key based structure level 1 dcl 3-346 stack_item based structure level 1 unaligned dcl 2-206 stack_item_ptr automatic pointer dcl 2-212 sys_info$max_seg_size external static fixed bin(35,0) dcl 247 ua_ptr automatic pointer dcl 2-165 unreferenced_attribute based structure level 1 dcl 2-159 version_status based structure level 1 packed unaligned dcl 2-232 version_status_ptr automatic pointer dcl 2-246 NAMES DECLARED BY EXPLICIT CONTEXT. compute_bit_offset_and_length 000427 constant entry internal dcl 149 ref 130 exit 000426 constant label dcl 145 pad 000563 constant entry internal dcl 201 ref 186 rmdb_build_attr_info 000045 constant entry external dcl 8 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 740 772 606 750 Length 1260 606 32 252 132 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME rmdb_build_attr_info 137 external procedure is an external procedure. compute_bit_offset_and_length internal procedure shares stack frame of external procedure rmdb_build_attr_info. pad internal procedure shares stack frame of external procedure rmdb_build_attr_info. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME rmdb_build_attr_info 000100 key_attribute_count rmdb_build_attr_info 000101 padding rmdb_build_attr_info 000102 prev_ptr rmdb_build_attr_info 000104 varying_string rmdb_build_attr_info 000106 adi_ptr rmdb_build_attr_info 000110 dbm_ptr rmdb_build_attr_info 000112 di_ptr rmdb_build_attr_info 000114 fm_ptr rmdb_build_attr_info 000116 ri_ptr rmdb_build_attr_info 000120 ai_ptr rmdb_build_attr_info 000122 desc_ptr rmdb_build_attr_info 000124 num_dims rmdb_build_attr_info 000142 number_of_bits pad THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. alloc_char_temp call_ext_out return_mac mdfx1 shorten_stack ext_entry_desc op_alloc_ THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. mdbm_util_$align_data_item mdbm_util_$get_data_bit_length mdbm_util_$mu_data_length THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. mrds_data_$max_attributes mrds_data_$max_key_len mrds_error_$long_index mrds_error_$long_key mrds_error_$max_attributes mrds_error_$rst_name_duplicate LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 8 000037 4 20 000060 48 000061 49 000065 50 000070 51 000073 52 000076 53 000102 55 000103 61 000112 63 000114 65 000115 69 000125 70 000133 71 000152 72 000155 75 000156 76 000162 78 000163 80 000171 81 000201 82 000204 85 000205 87 000211 89 000217 90 000230 92 000233 94 000237 95 000243 96 000245 97 000250 98 000256 100 000257 101 000261 104 000263 105 000265 107 000267 108 000273 110 000312 111 000316 114 000334 118 000336 119 000341 120 000344 121 000346 122 000347 124 000350 125 000351 128 000353 130 000357 132 000360 133 000362 134 000363 135 000365 136 000367 137 000371 140 000374 141 000405 142 000424 145 000426 149 000427 158 000430 160 000431 162 000434 165 000446 171 000460 172 000462 174 000504 176 000512 179 000517 184 000520 185 000526 186 000530 191 000542 193 000551 197 000562 201 000563 207 000565 211 000574 215 000577 ----------------------------------------------------------- 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