/* BEGIN INCLUDE FILE mdbm_file_model.incl.pl1 -- jaw, 8/29/78 */ /****^ HISTORY COMMENTS: 1) change(79-02-01,JGray), approve(), audit(), install(): modified to save space occupied by model 2) change(82-05-19,Davids), approve(), audit(), install(): renamed rel_info.nsec_inds to rel_info.unused_3 because it really wasn't the number of secondary indices in the relation - it was always zero. 3) change(82-08-19,DWoodka), approve(), audit(), install(): changed rel_info.id and attr_info.index_id to bit (36) unaligned for the DMS conversion. 4) change(82-09-20,MKubicar), approve(), audit(), install(): changed rel_info.id and attr_info.index_id to aligned; they are needed that way for relmgr_ calls. Also added rel_info.primary_key_index_id, needed for relation manager changes. 5) change(85-12-02,Spitzer), approve(85-12-02,MCR7311), audit(86-09-02,Blair), install(86-10-16,MR12.0-1187): used 2 reserved bits to indicate whether the copy of the .m and/or files are good (for rmdb) END HISTORY COMMENTS */ /* each file in the database will have a model segment with the name file_name.m (i.e. the files name plus a suffix of ".m") the file_model structure is allocated at the base of the segment for a given file. it contains an area with which all other structures in this include file are allocated. these structures contain the information about which relations, foreign keys, and attributes are members of this file. all lists are singly linked lists in definition order. pointers to these structures are obtained by using the "pointer" builtin function with arguments of the segment base pointer, and the offset (bit (18)) relative to that pointer that is actually stored in the file model itself. this is because pointer segment numbers are per process dependent. the major lists pointed to by the file_model structure are the list of relations in this file(each with a contained attribute list), and the list of foreign keys whose parent relation resides in this file (along with a participating attribute sublist, and the child relation list, if they are also in this file) */ dcl 1 file_model aligned based (fm_ptr), /* base of segment */ 2 temporary bit (1) unal, /* on if file not part of db. */ 2 procedures_present bit (1) unal, /* on => ids procedures present */ 2 file_model_copy_good bit (1) unaligned, /* on => .m file is the good copy */ 2 relation_copy_good bit (1) unaligned, /* on => file is the good copy */ 2 reserved bit (32) unal, /* reserved for future flags */ 2 max_tuples fixed bin (35), /* max no. of tuples in file */ 2 num_blocks fixed bin (35), /* number of blocks in file */ 2 num_buckets fixed bin (35), /* number of buckets in file */ 2 pad_1 fixed bin (35), /* for future use */ 2 pad_2 fixed bin (35), 2 ratd_len fixed bin (21), /* length of above */ 2 mratd_len fixed bin (21), /* length of above */ 2 uatd_len fixed bin (21), /* char. length of update attach desc. */ 2 latd_len fixed bin (21), /* char. len. of attach desc. */ 2 sratd_len fixed bin (21), /* char. length of above attach desc. */ 2 suatd_len fixed bin (21), /* char. length of attach desc. */ 2 file_type unal fixed bin, /* 1 => unblocked, 2 => blocked */ 2 block_size unal fixed bin, /* no. pages in block */ 2 block_factor unal fixed bin, /* no. tuple slots per block */ 2 bucket_density unal fixed bin, /* no. of bucket headers per block, neg. => blocks per header */ 2 tuple_id_len unal fixed bin, /* no. bits needed for local tuple id */ 2 num_rels unal fixed bin, /* number of relations in file */ 2 num_links unal fixed bin, /* number of links in file */ 2 num_children unal fixed bin, /* count of all child_link_infos in this file */ 2 default_rbs (3) unal fixed bin (8), /* file ring brackets when not MDBM-secured */ 2 rel_ptr unal bit (18), /* to first of list of rel_infos */ 2 link_ptr unal bit (18), /* to first in list of parent link_infos */ 2 children_ptr unal bit (18), /* to list of all child_link_infos in this file model */ 2 cno_array_ptr unal bit (18), /* pointer to array of data component numbers */ 2 fi_ptr unal bit (18), /* offset to file_info in db_model */ 2 suatd_ptr unal bit (18), /* offset of scope_update attach desc. */ 2 sratd_ptr unal bit (18), /* offset of scope_retrieve attach desc. */ 2 latd_ptr unal bit (18), /* offset of load attach desc. */ 2 uatd_ptr unal bit (18), /* offset of update attach description for file */ 2 mratd_ptr unal bit (18), /* offset of moniter-retrieve attach desc. */ 2 ratd_ptr unal bit (18), /* offset of retrieve attach desc. */ 2 open_eu_before_path_ptr unal bit (18), /* paths and ents of file procs. */ 2 open_eu_err_path_ptr unal bit (18), 2 open_eu_after_path_ptr unal bit (18), 2 open_er_before_path_ptr unal bit (18), 2 open_er_err_path_ptr unal bit (18), 2 open_er_after_path_ptr unal bit (18), 2 open_neu_before_path_ptr unal bit (18), /* paths and ents of file procs. */ 2 open_neu_err_path_ptr unal bit (18), 2 open_neu_after_path_ptr unal bit (18), 2 open_ner_before_path_ptr unal bit (18), 2 open_ner_err_path_ptr unal bit (18), 2 open_ner_after_path_ptr unal bit (18), 2 open_pu_before_path_ptr unal bit (18), 2 open_pu_err_path_ptr unal bit (18), 2 open_pu_after_path_ptr unal bit (18), 2 open_pr_before_path_ptr unal bit (18), 2 open_pr_err_path_ptr unal bit (18), 2 open_pr_after_path_ptr unal bit (18), 2 open_cu_before_path_ptr unal bit (18), 2 open_cu_err_path_ptr unal bit (18), 2 open_cu_after_path_ptr unal bit (18), 2 open_cr_before_path_ptr unal bit (18), 2 open_cr_err_path_ptr unal bit (18), 2 open_cr_after_path_ptr unal bit (18), 2 close_before_path_ptr unal bit (18), 2 close_err_path_ptr unal bit (18), 2 close_after_path_ptr unal bit (18), 2 unused_1 unal bit (18), /* for future expansion */ 2 unused_2 unal bit (18), 2 changer_ptr unal bit (18), /* pointer to changer_id, changer_time structure */ 2 fm_area area (sys_info$max_seg_size - fixed (rel (addr (file_model.fm_area))) - 1); dcl fm_ptr ptr; dcl atd char (atd_len) based (atd_ptr); /* attach description for each file ready mode */ dcl atd_ptr ptr; dcl atd_len fixed bin; dcl 1 comp_no_array unal based (cna_ptr), /* ordered array of data comp. nos. */ 2 ncomponents fixed bin, 2 comp_no (ncomp_init refer (comp_no_array.ncomponents)) fixed bin; dcl cna_ptr ptr; dcl ncomp_init fixed bin; /* a rel_info structure contains information describing a relation. a relation may only occur in one file, thus there is one rel_info per relation per database, each stored in the file_model area for the file that contains it. the list of rel_info's in this file form a singly linked list in definition order. the rel_info itself points to a list of the attributes it contains, and to any parent_link or child_link info's that involve it in a foreign key */ dcl 1 rel_info aligned based (ri_ptr), 2 name char (32), /* relation name */ 2 id bit (36) aligned, /* relation id number */ 2 hashed bit (1) unal, /* on if hashed */ 2 duplicates bit (1) unal, /* on if allow dup. hash fields */ 2 via_link bit (1) unal, /* on if to be stored by parent */ 2 system bit (1) unal, /* on if dont care how stored */ 2 indexed bit (1) unal, /* on if secondary index */ 2 mrds_update bit (1) unal, /* on if updateable by MRDS */ 2 mrds_retrieve bit (1) unal, /* on if retrievable by MRDS */ 2 virtual bit (1) unal, /* if virtual relation, mapped on IDS records */ 2 procedures_present bit (1) unal, /* on => ids type procedures present */ 2 reserved bit (27) unal, /* for future flags */ 2 num_attr unal fixed bin, /* number of attributes (all levels) defined */ 2 num_links_child unal fixed bin, /* no. links in which child */ 2 num_links_par unal fixed bin, /* no. links_in which parent */ 2 max_attr_index_id unal fixed bin, /* max index id used by attr in this rel or PLI */ 2 num_key_attrs unal fixed bin, /* number of attributes in primary key for this rel */ 2 nvar_atts unal fixed bin, /* no. varying len. attributes */ 2 n36_thds unal fixed bin, /* no. of 36-bit threads */ 2 n27_thds unal fixed bin, /* no of 27-bit threads */ 2 n18_thds unal fixed bin, /* no of 18-bit threads */ 2 unused_3 unal fixed bin, /* element that was never used */ 2 max_data_len fixed bin (35), /* max length of data portion of tuple */ 2 avg_data_len fixed bin (35), /* average length of tuple data portion */ 2 max_key_len fixed bin (35), /* max key length if not hashed */ 2 var_offset fixed bin (35), /* position of first varying attr. */ 2 max_tuples fixed bin (35), /* max no. tuples if blocked file */ 2 fwd_thread unal bit (18), /* offsset to next rel. in file */ 2 attr_ptr unal bit (18), /* to attr. info */ 2 primary_key_index_id bit (36) aligned, /* index id of the relation's primary key */ 2 clink_ptr unal bit (18), /* offset to child info of link determining location */ 2 map_ptr unal bit (18), /* pointer to mapping info if virtual rel. */ 2 sec_ind_ptr unal bit (18), /* ptr to list of sec. ind. infos, init. not used */ 2 locator_proc_path_ptr unal bit (18), /* proc to determ. location */ 2 link_before_path_ptr unal bit (18), /* op. proc. paths and entries */ 2 link_err_path_ptr unal bit (18), 2 link_after_path_ptr unal bit (18), 2 unlk_before_path_ptr unal bit (18), 2 unlk_err_path_ptr unal bit (18), 2 unlk_after_path_ptr unal bit (18), 2 str_before_path_ptr unal bit (18), 2 str_err_path_ptr unal bit (18), 2 str_after_path_ptr unal bit (18), 2 del_before_path_ptr unal bit (18), 2 del_err_path_ptr unal bit (18), 2 del_after_path_ptr unal bit (18), 2 mod_before_path_ptr unal bit (18), 2 mod_err_path_ptr unal bit (18), 2 mod_after_path_ptr unal bit (18), 2 find_before_path_ptr unal bit (18), 2 find_err_path_ptr unal bit (18), 2 find_after_path_ptr unal bit (18), 2 retr_before_path_ptr unal bit (18), 2 retr_err_path_ptr unal bit (18), 2 retr_after_path_ptr unal bit (18), 2 unused_1 unal bit (18), /* for future expansion */ 2 unused_2 unal bit (18), 2 changer_ptr unal bit (18) ; /* pointer to changer_id, changer_time structure */ dcl ri_ptr ptr; /* a attr_info structure contains information about an attribute in a given relation. since attributes may appear in more than one relation, each occurence of an attribute means that an attr_info for it will be put in that relations sublist of attributes. the list is singly linked in definition order. the attr_info describes the data it represents, and how that data is used during a database search. */ dcl 1 attr_info aligned based (ai_ptr), /* info for a single attr. in attr. list */ 2 name char (32), /* name of attribute */ 2 key_attr bit (1) unal, /* on if part of primary or hash key */ 2 index_attr bit (1) unal, /* on if a secondary index */ 2 link_attr bit (1) unal, /* on if participates in link */ 2 reserved bit (33) unal, 2 index_id bit (36) aligned, /* id of index if index attr. */ 2 defn_order unal fixed bin, /* relative posit. in which defined */ 2 key_order unal fixed bin, /* relative posit. in key */ 2 bit_offset fixed bin (35), /* position in tuple */ 2 bit_length fixed bin (35), /* length if fixed */ 2 link_child_cnt fixed bin, /* number of uses of attr in child rel of link */ 2 link_par_cnt fixed bin, /* number of uses of attr in parent rel of link */ 2 domain_ptr unal bit (18), /* to domain info */ 2 rslt_ptr unal bit (18), /* ptr to info for "result" clause */ 2 fwd_thread unal bit (18), /* to next in list */ 2 changer_ptr unal bit (18) ; /* pointer to changer_id and changer_time */ dcl ai_ptr ptr; /* a parent_link_info structure is the carrier of foreign key definition info. each time a foreign key definition indicates a relation as it's parent, that relation will get a parent_link_info put in a list of associated parent_link_info's. a relation can be parent and/or child in any number of foreign keys. the parent_link_info structure describes the foreign key, and also points to a list of the attributes that participate in this foreign key. (this could be from 1 up to all attributes in the relation) the attr_list structures are in a singly linked list in definition order for this purpose. also pointed to is a list of child_link_info's that describe the child relations in this foreign key. since foreign keys may span files, not all related child_link_info's have to be in this file's model area. */ dcl 1 parent_link_info aligned based (pli_ptr), /* gen'l link info, appears in each area spanned by link parent */ 2 name char (32), /* name of link */ 2 singular bit (1) unal, /* on if system owned link */ 2 temp bit (1) unal, /* on if temp. order */ 2 first bit (1) unal, /* insertion indicators */ 2 last bit (1) unal, 2 next bit (1) unal, 2 prior bit (1) unal, 2 sort_rel_name bit (1) unal, /* sort -- relation name */ 2 sort_keys bit (1) unal, /* sort -- defined keys */ 2 dup_first bit (1) unal, /* duplicates first */ 2 dup_last bit (1) unal, /* duplicates last */ 2 indexed bit (1) unal, /* locate parent via index */ 2 hashed bit (1) unal, /* locate parent via hashed primary key */ 2 thread_36 bit (1) unal, /* thread size indicators */ 2 thread_27 bit (1) unal, 2 thread_18 bit (1) unal, 2 clustered bit (1) unal, /* ON => cluster option specified for this link */ 2 procedures_present bit (1) unal, /* on => ids type procedures present */ 2 reserved bit (19) unal, /* reserved for future flags */ 2 index_id aligned bit (8), /* id of index if indexed */ 2 thread_index unal fixed bin, /* index to threads in parent */ 2 nsel_attr unal fixed bin, /* no. attr. determ. parent */ 2 n_children unal fixed bin, /* no. children in link */ 2 child_fn char (30), /* file name for first child in list */ 2 parent_ptr unal bit (18), /* to parent relation info in file model */ 2 child_ptr unal bit (18), /* to list of child info ptrs */ 2 sel_attr_ptr unal bit (18), /* to first in list of attr. determ. parent */ 2 fwd_thread unal bit (18), /* thread to next parent link info in file */ 2 rel_fwd_thread unal bit (18), /* for multiple links within a relation */ 2 sort_before_path_ptr unal bit (18), /* proc. paths and entries */ 2 sort_err_path_ptr unal bit (18), 2 sort_after_path_ptr unal bit (18), 2 srch_before_path_ptr unal bit (18), 2 srch_err_path_ptr unal bit (18), 2 srch_after_path_ptr unal bit (18), 2 link_before_path_ptr unal bit (18), 2 link_err_path_ptr unal bit (18), 2 link_after_path_ptr unal bit (18), 2 unlk_before_path_ptr unal bit (18), 2 unlk_err_path_ptr unal bit (18), 2 unlk_after_path_ptr unal bit (18), 2 unused_1 unal bit (18), /* for future expansion */ 2 unused_2 unal bit (18), 2 changer_ptr unal bit (18) ; /* pointer to changer_id, changer_time structure */ dcl pli_ptr ptr; /* a child_link_info structure is the counter part of a parent_link_info for foreign key child relations. each time a relation is defined to be a child in a foreign key, it's list of child_link_infos will be added to. this list is singly linked in foreign key definition order. the child_link_info points to a list of participating attributes from the child relation by means of a singly linked list of attr_list structures in definition order. the number of attributes in the parent attr_list and the child attr_list lists are the same with corresponding attr_list attributes having the same domain. all child_link_infos in this file are on a seperately linked list. this may not include all child_link_infos for foreign keys whose parent relation resides in this file, since foreign keys may span files, and the child_link_info will reside in the file containing it's associated relation_info. */ dcl 1 child_link_info aligned based (cli_ptr), /* in same files as children */ 2 link_name char (32), /* name of foreign key involving parent relation for this child */ 2 mandatory bit (1) unal, /* on if membership mandatory */ 2 fixed bit (1) unal, /* on if membership fixed */ 2 optional bit (1) unal, /* on if membership optional */ 2 auto bit (1) unal, /* on if insertion automatic */ 2 manual bit (1) unal, /* on if insertion manual */ 2 struct_const bit (1) unal, /* on if membership constrained by attr. comp. */ 2 range_sel bit (1) unal, /* on if range type selection */ 2 key_dup_first bit (1) unal, /* sort key flags */ 2 key_dup_last bit (1) unal, 2 key_null bit (1) unal, /* on if null allowed */ 2 sel_system bit (1) unal, /* selection criteria flags */ 2 sel_current bit (1) unal, 2 sel_key bit (1) unal, 2 sel_proc bit (1) unal, 2 no_null bit (1) unal, /* if null key values not allowed */ 2 reserved bit (21) unal, 2 thread_index unal fixed bin, /* index to thread in tuple */ 2 chain_len unal fixed bin, /* no. "then-thru's" in selction crit. */ 2 n_sort_keys unal fixed bin, /* no. attr. in sort key */ 2 n_sel_items unal fixed bin, /* no. items to sel for link sel. */ 2 n_dup_prevs unal fixed bin, /* no. attr. for dup prev. */ 2 link_fwd_fn char (30), /* file name for next child info in link */ 2 parent_fn char (30), /* file name for parent info */ 2 parent_ptr unal bit (18), /* offset to parent link info */ 2 link_fwd_thread unal bit (18), /* offset for next child in link */ 2 rel_info_ptr unal bit (18), /* to corresponding rel info */ 2 dup_prev_ptr unal bit (18), /* list of attrs. for dup. prev. */ 2 sel_ptr unal bit (18), /* list of attr. for link sel. */ 2 rel_fwd_thread unal bit (18), /* for multiple links within a relation */ 2 child_fwd_thread unal bit (18), /* pointer to next in list of all child_link_infos in this file */ 2 sort_key_ptr unal bit (18), /* list of sort keys */ 2 chain_ptr unal bit (18), /* to "then thru" list */ 2 sel_proc_path_ptr unal bit (18), /* link selection proc. */ 2 link_before_path_ptr unal bit (18), /* proc. paths and entries */ 2 link_err_path_ptr unal bit (18), 2 link_after_path_ptr unal bit (18), 2 unlk_before_path_ptr unal bit (18), 2 unlk_err_path_ptr unal bit (18), 2 unlk_after_path_ptr unal bit (18), 2 srch_before_path_ptr unal bit (18), 2 srch_err_path_ptr unal bit (18), 2 srch_after_path_ptr unal bit (18), 2 unused_1 unal bit (18), /* for future expansion */ 2 unused_2 unal bit (18) ; dcl cli_ptr ptr; /* the attr_list structure is associated with the parent_link_info and child_link_info structures to represent by means of a singly linked list the participating attributes from relations in a foreign key. the parent_link_info has a list for the parent relation, and the child_link_info has a list for the child relation. the participating attributes are a subset(not necessary proper) of those attributes contained in a relation definition. there are equal numbers of attr_list structures in the parent and child lists of the same foreign key. the corresponding attributes in these lists must have the same domain. */ dcl 1 attr_list aligned based (al_ptr), /* general attr. list */ 2 attr_fn char (30), /* file name for attr. */ 2 attr_ptr unal bit (18), /* to attr info block */ 2 fwd_thread unal bit (18); /* to next in list */ dcl al_ptr ptr; dcl 1 sort_key aligned based (sk_ptr), /* entry in sort key list */ 2 ascend bit (1) unal, /* ascending order */ 2 descend bit (1) unal, /* descending order */ 2 reserved bit (34) unal, 2 attr_ptr unal bit (18), /* to attr info */ 2 fwd_thread unal bit (18); /* to next in list */ dcl sk_ptr ptr; dcl 1 dup_prev aligned based (dp_ptr), /* dup. prevention list entry */ 2 attr_ptr unal bit (18), /* to attr info */ 2 fwd_thread unal bit (18); /* to next in list */ dcl dp_ptr ptr; dcl 1 select_chain aligned based (sc_ptr), /* "then thru" list entry */ 2 link_fn char (30), /* file name for thru link */ 2 link_ptr unal bit (18), /* to parent link info */ 2 parent_attr_ptr unal bit (18), /* to parent ident. attr. list */ 2 comp_proc_path_ptr unal bit (18), /* comparison procedure */ 2 comp_attr_fn char (30), /* file name for comparison attr. */ 2 comp_attr_ptr unal bit (18), /* to comparison attr list */ 2 fwd_thread unal bit (18); /* to next in chain */ dcl sc_ptr ptr; /* END INCLUDE FILE mdbm_file_model.incl.pl1 */ */ ----------------------------------------------------------- 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 */