COMPILATION LISTING OF SEGMENT mrds_rst_consistancy_check Compiled by: Multics PL/I Compiler, Release 29, of July 28, 1986 Compiled at: Honeywell Multics Op. - System M Compiled on: 10/16/86 1346.3 mst Thu 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 1979 21* 22* 83-02-17 Davids: explicitly declared variables that were declared by 23* context or implication and deleted declarations to variables that were 24* not referenced. 25**/ 26 27 /* 28* Known Problems: 29* 1) RMDB code should be removed since its now done by the rmdb subsystem 30**/ 31 32 mrds_rst_consistancy_check: procedure (rsc_ptr); 33 34 /* 35* . BEGIN_DESCRIPTION 36* This routine makes sure that creation(CMDB) or restructuring(RMDB) 37* of a database model has resulted in a model that is guarenteed 38* to be consistant, complete, and error free. 39* 40* For CMDB this means checking that some attributes or domains 41* might never have been used or referenced, a possible oversight 42* by the database builder. 43* 44* RMDB is more complicated, because an "undefine" directive 45* can cause an inconsistancy that was later rectified by a 46* "define" or "redefine" directive. Thus many more checks 47* are made to ensure that attributes have domains, and are contained 48* in some relation, all domains are referenced, and so on. 49* . END_DESCRIPTION 50**/ 51 52 /* PARAMETERS: 53* 54* rsc_ptr - - (input) pointer to the restructure control segment 55* that holds error, directives seen, and other common information 56* 57* (output) warning messages about detected inconsistancies in 58* the database, and the setting of severity high in the rsc segment 59* 60**/ 61 62 /* get the semantic structure pointers */ 63 64 stmt_ptr = rsc.stmt_ptr; 65 directive_ptr = rsc.directive_ptr; 66 67 /* call metering if trace is on */ 68 69 if ^rsc.trace_sw then ; 70 else do; 71 if directive.cmdb.seen then 72 meter_mesg = "CMDB"; 73 else meter_mesg = "RMDB"; 74 call mrds_rst_meter (rsc_ptr, "mrds_rst_consistancy_check", "1"b /* input call */, meter_mesg); 75 end; 76 /* take action based on which command invoked us, 77* CMDB only can have used attributes and domains */ 78 79 if directive.cmdb.seen then do; 80 81 /* CMDB directive */ 82 83 call check_for_referencing_relation ("0"b /* for domains */); 84 85 call check_for_referencing_relation ("1"b /* for attributes */); 86 87 88 end; 89 90 else do; 91 92 /* RMDB directive */ 93 94 /* quick and dirty version for RMDB with only "define" directive */ 95 96 call check_for_referencing_relation ("0"b /* for domains */); 97 98 call check_for_referencing_relation ("1"b /* for attributes */); 99 /* call ioa_$ioa_switch (iox_$error_output, 100* "RMDB consistancy check not implemented yet.^/") ; */ 101 102 end; 103 104 /* call metering if trace is on */ 105 106 if ^trace_sw then ; 107 else call mrds_rst_meter (rsc_ptr, "mrds_rst_consistancy_check", "0"b /* output call */, meter_mesg); 108 109 check_for_referencing_relation: procedure (attribute_check); 110 111 /* routine to check the global list elements of domains and attributes, 112* to see whether they have been made ude of in some relation or not */ 113 114 if attribute_check then 115 root_ptr = rsc.h_gattr_ptr; 116 else root_ptr = rsc.h_gdom_ptr; 117 node_ptr = root_ptr; /* convention for first on list */ 118 success = "1"b; /* to init loop */ 119 120 /* go through all attributes/domains, checking that they are used in some relation */ 121 122 do while (success); 123 124 call mrds_rst_tree_successor (root_ptr, node_ptr, successor_ptr, successor_parent_ptr, success); 125 126 if ^success then ; 127 else do; 128 node_ptr = successor_ptr; 129 gl_ptr = node_ptr -> node.data; 130 131 /* issue a warning if this attribute/domain is unused */ 132 133 if gl.superior_assigned then ; 134 else do; 135 136 /* error message depends on which list was checked */ 137 138 if attribute_check then 139 if gl.parse_info_ptr -> attribute_domain.default then ; 140 else call unused_attribute_error (); /* only if not default attribute */ 141 else do; 142 call unused_domain_error (); 143 /* call delete_domain_info () ; */ 144 end; 145 146 end; 147 148 end; 149 150 end; 151 152 153 declare attribute_check bit (1); /* ON => this is for the attribute list elements, else domains */ 154 155 end; 156 157 unused_attribute_error: procedure (); 158 159 /* output error message warning of an attribute without a relation */ 160 161 attdom_ptr = gl.parse_info_ptr; 162 if attribute_domain.default then do; 163 line_mesg = "h"; 164 default_mesg = "default_"; 165 end; 166 else do; 167 default_mesg = ""; 168 line_mesg = "given on line " || ltrim (char (attribute_domain.line_num)) || " h"; 169 end; 170 171 call ioa_$rs ("^a ^a^a^a^a ^a^a", message, message_length, 172 "The", default_mesg, "attribute """, gl.name, """", line_mesg, 173 "as never been assigned to a relation."); 174 call mrds_rst_error (rsc_ptr, 1 /* severity */, mrds_error_$rst_unused_attr, (message)); 175 176 end; 177 178 unused_domain_error: procedure (); 179 180 /* output error message warning of a domain unreferenced by a relation */ 181 182 call ioa_$rs ("^a^a^a ^d ^a", message, message_length, 183 "The domain """, gl_ptr -> gl.name, """ given on line", 184 gl_ptr -> gl.parse_info_ptr -> domain.line_num, 185 "has only been referenced by attributes that have no assigned relation."); 186 call mrds_rst_error (rsc_ptr, 1 /* severity */, mrds_error_$rst_unused_attr_dom, (message)); 187 188 end; 189 190 declare meter_mesg char (4); /* name of directive being checked */ 191 declare mrds_rst_meter entry (ptr, char (*), bit (1), char (*)); /* restructuring metering routine */ 192 declare default_mesg char (8) varying; 193 declare line_mesg char (24) varying; 194 declare mrds_rst_tree_successor entry (ptr, ptr, ptr, ptr, bit (1)); /* get next on list routine */ 195 declare ioa_$rs entry options (variable); /* string manipulator routine */ 196 declare message char (256); /* specifics of error */ 197 declare message_length fixed bin (21); /* length of specifics message */ 198 declare mrds_rst_error entry (ptr, fixed bin (2), fixed bin (35), char (*)); /* error handler */ 199 declare mrds_error_$rst_unused_attr fixed bin (35) ext; /* unreferenced attr error */ 200 declare mrds_error_$rst_unused_attr_dom fixed bin (35) ext; /* unreferenced attrs dom unused elsewhere */ 201 declare sys_info$max_seg_size fixed bin (35) ext;/* largest segment size */ 202 declare (addr, rel, fixed, 203 char, ltrim) builtin; /* functions known to pl1 */ 204 1 1 /* BEGIN INCLUDE FILE mrds_rst_rsc.incl.pl1 RDL 7/7/78 */ 1 2 1 3 /* Modified 8/21/78 by RDL */ 1 4 1 5 /* Modified 9/11/78 by RDL to add directive and stmt pointers */ 1 6 1 7 /* Modified 11/4/78 by RDL to add debug,trace,meter switches 1 8* 1 9* Modified 3/29/79 by RDL to change s_seg_info_ptr to source_seg_ptr 1 10* 1 11* Modified by Jim Gray - - Jan. 1980, to add flags to disallow blocked files, forieng keys, and restructuring. 1 12* 1 13* Modified by Jim Gray - - Feb. 1980, to add command level flag for cmdb subroutine interface. 1 14* 1 15* Modified by Jim Gray - - 80-11-06, to add bit for cmdb -secure option. 1 16* 1 17* 81-05-18 Jim Gray : added bit for max_attributes error message, so that 1 18* it would only be issued on first occurence. 1 19* 1 20* 82-08-19 Davids: added the db_type field. 1 21* 1 22* 83-02-18 Mike Kubicar : Removed the db_type field and added the 1 23* db_relation_mode_flags substructure to define the modes applicable 1 24* to the database's relations. Also removed assorted unsed fields 1 25* (names that included the word unused). 1 26* 1 27**/ 1 28 1 29 dcl 1 rsc based (rsc_ptr), /* Restructuring control info */ 1 30 2 rsc_dir char (200), /* pathname of directory containing rsc segment */ 1 31 2 dbp char (168), /* Database absolute path */ 1 32 2 temp_dir char (168), /* Path name of temp restrucuring directory */ 1 33 2 temp_dir_sw bit (1) unal, /* On => temp dir has been created */ 1 34 2 db_quiesced_sw bit (1) unal, /* On => database has been quiesced */ 1 35 2 o_db_open_sw bit (1) unal, /* On => old database has been opened */ 1 36 2 n_db_open_sw bit (1) unal, /* On => temp database is open */ 1 37 2 listing_seg_sw bit (1) unal, /* On => listing segment has been created */ 1 38 2 skip_scanner_conversion bit (1) unal, /* Skip conversion in scanner */ 1 39 2 cmdb_option bit (1) unal, /* ON => this is a cmdb source, not restructuring */ 1 40 2 trace_sw bit (1) unal, /* On -> trace mode in affect */ 1 41 2 debug_sw bit (1) unal, /* On = debug mode (NOT IMPLEMENTED) */ 1 42 2 meter_sw bit (1) unal, /* On = procedures call metering procedure */ 1 43 2 delete_db_sw bit (1) unal, /* On = delete data base in cleanup */ 1 44 2 model_consistent_sw bit (1) unal, /* On => Model is consistent */ 1 45 2 physical_started_sw bit (1) unal, /* On => Physical restructuring started */ 1 46 2 physical_complete_sw bit (1) unal, /* On => Physical restructuring completed */ 1 47 2 model_overflow bit (1) unal, /* ON => model segment area condition occurred */ 1 48 2 max_files bit (1) unal, /* ON => maximum number of files reached */ 1 49 2 allow_foreign_keys bit (1) unal, /* on => allow foreign key statment */ 1 50 2 foreign_key_seen bit (1) unal, /* on => foreign key definition in source */ 1 51 2 allow_blocked_files bit (1) unal, /* on => allow file statement with blocked option */ 1 52 2 blocked_file_seen bit (1) unal, /* on => blocked file definition in source */ 1 53 2 allow_restructuring bit (1) unal, /* on => allow RMDB entry point */ 1 54 2 command_level bit (1) unal, /* on => called from command unal, not subroutine level */ 1 55 2 secure bit (1) unal, /* on => -secure option given for cmdb */ 1 56 2 max_attrs bit (1) unal, /* on => max attrs/rel or max indexes/rel exceeded */ 1 57 2 db_relation_mode_flags, 1 58 3 dm_file_type bit (1) unal, /* on => relations are dm files */ 1 59 3 protection_on bit (1) unal, /* on => relations need transactions */ 1 60 3 concurrency_on bit (1) unal, /* on => concurrency control enabled */ 1 61 3 rollback_on bit (1) unal, /* on => before journalling is enabled */ 1 62 2 severity_high fixed bin, /* Highest severity level error encountered */ 1 63 2 phase fixed bin, /* 000 = init 1 64* 100 = global list init 1 65* 200 = parse 1 66* 300 = physical init 1 67* 400 = physical */ 1 68 2 h_o_seg_info_ls_ptr ptr, /* Pointer to head of old db seg_info list */ 1 69 2 h_n_seg_info_ls_ptr ptr, /* Pointer to head of new db seg_info list */ 1 70 2 h_gfile_ptr ptr, /* Pointer to head of global file list */ 1 71 2 h_gdom_ptr ptr, /* Pointer to head of global domain list */ 1 72 2 h_gattr_ptr ptr, /* Pointer to head of global attribute list */ 1 73 2 h_grel_ptr ptr, /* Pointer to head of global relation list */ 1 74 2 h_glink_ptr ptr, /* Pointer to head of global link list */ 1 75 2 o_dm_ptr ptr, /* Pointer to old data model seg (dm_model ) */ 1 76 2 n_dm_ptr ptr, /* Pointer to temp data model seg */ 1 77 2 o_fn_hdr_ptr ptr, /* Pointer to head of original file list (fn structure) */ 1 78 2 source_seg_ptr ptr, /* Pointer to source_seg */ 1 79 2 listing_iocb_ptr ptr, /* Pointer to listing segment iocb */ 1 80 2 directive_ptr ptr, /* Pointer to directive type str in mrds_rst_semactics.incl.pl1 */ 1 81 2 stmt_ptr ptr, /* Pointer to statement str in mrds_rst_sematics.incl.pl1 */ 1 82 2 trace_metering_iocb_ptr ptr, /* Pointer to seg used by trace and metering */ 1 83 2 tree_node_area_ptr ptr, /* pointer to working storage for tree nodes */ 1 84 2 tree_data, 1 85 3 seg_info_area_ptr ptr, /* seg info working storage area */ 1 86 3 gl_area_ptr ptr, /* global list data work storage area */ 1 87 3 sl_area_ptr ptr, /* sublist data work storage area */ 1 88 2 parse_info_area_ptr ptr, /* parse interface work area storage */ 1 89 2 static_info_area_ptr ptr, /* directive, stmt and other static work storage area */ 1 90 2 variable_length_area_ptr ptr, /* varibale allocates work storage area */ 1 91 2 other_area_ptr ptr, /* unspecified work area storage */ 1 92 2 wa area (sys_info$max_seg_size - fixed (rel (addr (rsc.wa))) + 1); /* Work area */ 1 93 1 94 dcl rsc_ptr ptr; /* Pointer to base of rsc segment */ 1 95 1 96 1 97 1 98 /* END INCLUDE FILE mrds_rst_rsc.incl.pl1 */ 1 99 205 2 1 /* BEGIN INCLUDE FILE mrds_rst_parse_info.incl.pl1 -- oris, 6/30/78 */ 2 2 /* modified 9/6/78 -- jeg, for lrk parser - cmdb interface */ 2 3 /* modified 12/20/78 - - jeg, to add line number info for handlers */ 2 4 /* modified 3/15/79 - - jeg, to add scanner, semantic, and link handler variables to be allocated in rsc */ 2 5 /* Modified by Jim Gray - - 23-June-80, to separate max_string_size, 2 6* and max_line_size mrds_data_ items. */ 2 7 2 8 2 9 2 10 2 11 declare 1 domain aligned based (domain_ptr), 2 12 2 name char (32), /* name of this domain */ 2 13 2 descriptor bit (36), /* Multics pl1 descriptor for domain type */ 2 14 2 varying_avg_length fixed bin (24), /* average length of varying strings */ 2 15 2 options bit (1) unal, /* ON => some option is present */ 2 16 2 pad bit (35) unal, 2 17 2 check, 2 18 3 flag bit (1) unal, /* ON => check option present */ 2 19 3 pad bit (35) unal, 2 20 3 stack_ptr ptr, /* pointer to postfix stack 2 21* holding boolean expression */ 2 22 3 stack_size fixed binary, /* number of stack elements */ 2 23 2 check_proc, 2 24 3 flag bit (1) unal, /* ON => check_proc option is present */ 2 25 3 pad bit (35) unal, 2 26 3 path char (168), /* check procedure pathname */ 2 27 3 entry char (32), /* check procedure entryname */ 2 28 2 encode_proc, 2 29 3 flag bit (1) unal, /* ON => encode_proc option is present */ 2 30 3 pad bit (35) unal, 2 31 3 path char (168), /* encode procedure pathname */ 2 32 3 entry char (32), /* encode procedure entryname */ 2 33 2 decode_proc, 2 34 3 flag bit (1) unal, /* ON => decode_proc option is present */ 2 35 3 pad bit (35) unal, 2 36 3 path char (168), /* decode procedure pathname */ 2 37 3 entry char (32), /* decode procedure entryname */ 2 38 2 decode_dcl, 2 39 3 flag bit (1) unal, /* ON => decode declaration is present */ 2 40 3 pad bit (35) unal, 2 41 3 descriptor bit (36), /* decode declaration pl1 descriptor */ 2 42 2 line_num fixed bin (24) ; /* line of domain name in source */ 2 43 2 44 2 45 declare domain_ptr ptr ; 2 46 2 47 2 48 2 49 2 50 2 51 dcl 1 relation aligned based (relation_ptr), 2 52 2 a_ptr ptr, /* ptr to attribute list for this relation */ 2 53 2 name char (32), /* relation name */ 2 54 2 max_tup fixed bin, /* maximum tuples for this relation if a blocked file */ 2 55 2 num_items fixed bin, /* number of attributes in this relation */ 2 56 2 unused bit (36) unal, /* future flags */ 2 57 2 line_num fixed bin (24) ; /* line of relation name in source */ 2 58 2 59 2 60 dcl relation_ptr ptr; 2 61 2 62 2 63 dcl 1 attribute aligned based (attribute_ptr), 2 64 2 next ptr, /* ptr to next in list */ 2 65 2 name char (32), /* name of attribute */ 2 66 2 pr_key bit (1) unal, /* ON => part of primary key */ 2 67 2 pad bit (35) unal, 2 68 2 defn_order fixed bin, /* position within the relation */ 2 69 2 key_order fixed bin, /* position within the primary key, if a key */ 2 70 2 line_num fixed bin (24) ; /* line of attribute name in source */ 2 71 2 72 2 73 dcl attribute_ptr ptr; 2 74 2 75 2 76 2 77 dcl 1 attribute_domain aligned based (attdom_ptr), 2 78 2 attr char (32), /* attribute name */ 2 79 2 dom char (32), /* domain name */ 2 80 2 default bit (1) unal, /* on => defined as default attr, not by source */ 2 81 2 unused bit (35) unal, /* future flags */ 2 82 2 line_num fixed bin (24) ; /* line of attribute name in source */ 2 83 2 84 dcl attdom_ptr ptr; /* ptr to attribute_domain structure */ 2 85 2 86 2 87 2 88 2 89 dcl 1 file aligned based (file_ptr), 2 90 2 i_ptr ptr, /* ptr to item containing relation name */ 2 91 2 name char (30), /* file name */ 2 92 2 type fixed bin, /* blocked or unblocked */ 2 93 /* type = 1 => unblocked, 2 94* type = 2 => blocked */ 2 95 2 ppb fixed bin, /* pages per block, if blocked */ 2 96 2 hbh fixed bin, /* hash bucket headers per block */ 2 97 2 block fixed bin, /* blocks per hash bucket headers */ 2 98 2 num_items fixed bin, /* nbr. items -- relations -- in file */ 2 99 2 default bit (1) unal, /* on => defined as default file, not by source */ 2 100 2 unused bit (35) unal, /* future flags */ 2 101 2 line_num fixed bin (24) ; /* line of file name in source */ 2 102 2 103 2 104 dcl file_ptr ptr; /* ptr to file structure */ 2 105 2 106 2 107 dcl 1 rel_index aligned based (index_ptr), 2 108 2 i_ptr ptr, /* ptr. to item containing index attr. name */ 2 109 2 rel_name char (32), /* name of relation being indexed */ 2 110 2 num_items fixed bin, /* nbr. items -- attributes -- indexed for a relation */ 2 111 2 unused bit (36) unal, /* future flags */ 2 112 2 line_num fixed bin (24) ; /* line of relation name in source */ 2 113 2 114 2 115 dcl index_ptr ptr; /* ptr to index structure */ 2 116 2 117 2 118 dcl 1 link aligned based (link_ptr), 2 119 2 parent_ptr ptr, /* ptr to foreign_key structure cont. parent rel. name */ 2 120 2 children_ptr ptr, /* ptr. to list of children names for this link */ 2 121 2 clust_fl bit (1) unal, /* ON => link is clustered in one file */ 2 122 2 pad bit (35) unal, 2 123 2 name char (32), /* name of this link */ 2 124 2 num_children fixed bin, /* number of children for this link's parent */ 2 125 2 line_num fixed bin (24) ; /* line of link name occurence in source */ 2 126 2 127 2 128 dcl link_ptr ptr; /* ptr to link structure */ 2 129 2 130 2 131 dcl 1 children aligned based (children_ptr), 2 132 2 next ptr, /* ptr to next in list */ 2 133 2 child_ptr ptr; /* ptr. to foreign_key struct. containing child rel. name */ 2 134 2 135 2 136 dcl children_ptr ptr; /* ptr to children structure */ 2 137 2 138 2 139 dcl 1 foreign_key aligned based (forkey_ptr), 2 140 2 i_ptr ptr, /* ptr to item list containing foreign key attributes */ 2 141 2 rel_name char (32), /* name of parent/child relation */ 2 142 2 num_items fixed bin, /* nbr of attributes defining this foreign key */ 2 143 2 unused bit (36) unal, /* future flags */ 2 144 2 line_num fixed bin (24) ; /* line of relation occurence in source */ 2 145 2 146 2 147 dcl forkey_ptr ptr; /* ptr to foreign_key structure */ 2 148 2 149 2 150 dcl 1 item aligned based (item_ptr), 2 151 2 next ptr, /* ptr to next item in the list */ 2 152 2 name char (32), /* name of item -- relation name or attribute name */ 2 153 2 unused bit (36) unal, /* future flags */ 2 154 2 line_num fixed bin (24) ; /* line of item occurence in source */ 2 155 2 156 2 157 dcl item_ptr ptr; /* ptr to item structure */ 2 158 2 159 2 160 declare 1 delete_name aligned based (delete_name_ptr), /* overlay for undefine parse information */ 2 161 2 overlay char (32), /* name portion */ 2 162 2 unused bit (36) unal, /* future flags */ 2 163 2 line_num fixed bin (24) ; /* line number of name occurence in source */ 2 164 2 165 declare delete_name_ptr ptr ; 2 166 2 167 /* scanner variables */ 2 168 2 169 declare token char (mrds_data_$max_string_size) varying 2 170 based (accum_token_ptr) ; /* temp store for accumulating the token */ 2 171 declare accum_token_ptr ptr internal static ; /* pointer to allocated accumulator store */ 2 172 declare mrds_data_$max_string_size fixed bin (35) external ; /* max token size in chars */ 2 173 declare mrds_data_$max_line_size fixed bin (35) ext ; /* max output listing line size */ 2 174 declare token_length fixed binary (24) ; /* current length of token */ 2 175 declare output_text char (mrds_data_$max_line_size) varying 2 176 based (output_text_ptr) ; /* body of text for this line in output listing */ 2 177 declare output_text_ptr ptr internal static ; /* pointer to allocated output line storage */ 2 178 declare fixup_token char (token_length) based ; /* saved fixed up version of token */ 2 179 2 180 /* semantic variables */ 2 181 2 182 declare source_size fixed bin (35) ; /* length of source char string for any_to_any */ 2 183 declare string_source_ptr ptr ; /* pointer to source for any_to_any conversion */ 2 184 declare string_source char (source_size) based (string_source_ptr) ; /* storage for expanded string constant */ 2 185 2 186 /* link handler variable */ 2 187 2 188 declare dom_list_ptr ptr ; /* pointer to domain list element */ 2 189 declare 1 dom_list based (dom_list_ptr), /* element of parent attr domain ptr list */ 2 190 2 next ptr, /* pointer to next in order on list */ 2 191 2 attr_name char (32) aligned, /* parent attr's name */ 2 192 2 dom_info_ptr ptr ; /* parent attr's domain ptr */ 2 193 2 194 /* END INCLUDE FILE mrds_rst_parse_info.incl.pl1 */ 2 195 206 3 1 /* BEGIN INCLUDE FILE mrds_rst_tree.incl.pl1 jeg 7/19/78 */ 3 2 3 3 /* common declarations for threaded binary tree routines 3 4* 3 5* The tree maintains an inorder list of it's keys. 3 6* this means that for a given node, any key in it's left subtree 3 7* is "less" than the given node's key and that any key in it's 3 8* right subtree is "greater" than the given node's key. 3 9* 3 10* Threads are maintained to allow fast and easy traversal of the tree. 3 11* threads occupy the position of null pointers of an straight binary tree, 3 12* thus they only occur in leaf nodes. 3 13* left threads point to that nodes inorder predecessor. 3 14* right threads point to that nodes inorder successor. 3 15* 3 16* note: root_ptr must be passed by reference 3 17* ( not by value ) so it can be changed . 3 18* Also, each parameter must be a different 3 19* variable. The same variable used for two 3 20* or more arguments when any of the tree 3 21* routines are called will produce errors */ 3 22 3 23 3 24 declare key char (32) aligned ; /* data key directing search */ 3 25 3 26 declare root_ptr ptr ; /* pointer to head of desired list */ 3 27 declare node_ptr ptr ; /* pointer to key node, when success */ 3 28 declare parent_ptr ptr ; /* pointer to direct parent of current node */ 3 29 declare data_ptr ptr ; /* pointer from tree node to data structure headed by node */ 3 30 declare successor_ptr ptr ; /* pointer to inorder successor of current node in tree */ 3 31 declare successor_parent_ptr ptr ; /* pointer to immediate tree parent of inorder successor node */ 3 32 declare predecessor_ptr ptr ; /* pointer to inorder predecessor of current node */ 3 33 declare predecessor_parent_ptr ptr ; /* pointer to direct parent of predecessor */ 3 34 declare area_ptr ptr ; /* pointer to based area for node allocation/freeing */ 3 35 3 36 declare work_area area based (area_ptr) ; /* area of storage for tree */ 3 37 3 38 declare success bit (1) ; /* on if operation successful */ 3 39 declare thread bit (1) aligned ; /* current thread indicator, on = thread, off = pointer */ 3 40 3 41 declare 1 node based (node_ptr) aligned, /* tree element */ 3 42 2 data ptr, /* data field link */ 3 43 2 key char (32), /* data key */ 3 44 2 right, /* right branch link */ 3 45 3 thread bit (1), /* indicates whether link is thread or pointer */ 3 46 3 link ptr, /* pointer to right descendent or thread to successor */ 3 47 2 left, /* left branch link */ 3 48 3 thread bit (1), /* indicates whether link is thread or pointer */ 3 49 3 link ptr, /* pointer to left descendent or thread to predecessor */ 3 50 2 pad bit (34) ; /* reserved for future flags */ 3 51 3 52 /* END INCLUDE FILE mrds_rst_tree.incl.pl1 */ 3 53 3 54 3 55 3 56 207 4 1 /* BEGIN INCLUDE FILE mrds_rst_global_lists.incl.pl1 jeg 7/17/78 */ 4 2 4 3 /* note: mrds_rst_list_element$add and delete entries 4 4* makes use of the following structure type correspondence 4 5* 4 6* structure_type = 1 refers to gl (global list element) 4 7* 4 8* structure_type = 2 refers to sl (global sublist element) 4 9* 4 10* structure_type = 3 refers to seg_info(segment information element) 4 11* 4 12**/ 4 13 4 14 4 15 dcl 1 gl aligned based (gl_ptr), /* Template for global list entry */ 4 16 2 type fixed bin, /* structure_type, usefull when overlay used */ 4 17 2 name char (32), /* Item name */ 4 18 2 item_info_ptr ptr, /* Pointer to info structure for this item */ 4 19 2 parse_info_ptr ptr, /* Pointer to info obtained by parsing source */ 4 20 2 other_info_ptr ptr, /* Pointer to additional info str if needed */ 4 21 2 item_sub_list_ptr ptr, /* Pointer to sub list of items if neccessary for this his item */ 4 22 2 file_info_ptr ptr, /* Pointer to file info for this entry */ 4 23 2 file_model_ptr ptr, /* Pointer to file model for this entry */ 4 24 2 affected bit (1) unal, /* ON => affected by some directive */ 4 25 2 cmdb bit (1) unal, /* ON => affected by cmdb directive */ 4 26 2 undefine bit (1) unal, /* ON => affected by undefine directive */ 4 27 2 define bit (1) unal, /* ON => affected by define directive */ 4 28 2 redefine bit (1) unal, /* ON => affected by redefine directive */ 4 29 2 superior_assigned bit (1) unal, /* ON => has parent */ 4 30 2 inferior_assigned bit (1) unal, /* ON => child present */ 4 31 2 complete bit (1) unal, /* ON => all things present */ 4 32 2 consistant bit (1) unal, /* ON => correct model */ 4 33 2 reserved bit (26) unal, /* for future use */ 4 34 2 child_defined bit (1) unal ; /* ON => global element entered by child */ 4 35 4 36 dcl gl_ptr ptr; /* Pointer to gl structure */ 4 37 4 38 4 39 4 40 dcl 1 sl aligned based (sl_ptr), /* Template of sub list entry for global list */ 4 41 2 type fixed bin, /* structure_type, usefull when overlay used */ 4 42 2 name char (32), /* Name of item */ 4 43 2 item_info_ptr ptr, /* Pointer to info structure for this entry */ 4 44 2 parse_info_ptr ptr, /* Pointer to info obtained by parsing source */ 4 45 2 old_other_info_ptr ptr, /* Pointer to old version of other info */ 4 46 2 new_other_info_ptr ptr, /* Pointer to new version of other info */ 4 47 2 global_list_ptr ptr, /* pointer to corresponding global list element */ 4 48 2 reserved bit (36) unal; /* Reserved for future use */ 4 49 4 50 dcl sl_ptr ptr; /* Pointer to sub list structure */ 4 51 4 52 4 53 dcl 1 seg_info based (seg_info_ptr), /* Info about segment initiated */ 4 54 2 name char (32), /* Segment name */ 4 55 2 dir char (168), /* Absolute path of containing directory */ 4 56 2 seg_ptr ptr, /* Pointer to base of segment */ 4 57 2 bcnt fixed bin (24); /* Bit count of segment */ 4 58 4 59 dcl seg_info_ptr ptr; /* Pointer to seg_info str */ 4 60 4 61 4 62 4 63 dcl MAIN_LIST fixed bin internal static options (constant) init (1); 4 64 dcl SUB_LIST fixed bin internal static options (constant) init (2); 4 65 dcl SEG_INFO fixed bin internal static options (constant) init (3); 4 66 4 67 declare 1 list_ovrly aligned based (list_ovrly_ptr), /* overlay for top part of gl and sl list elements */ 4 68 2 type fixed bin, /* structure_type, 1 => gl, 2 => sl */ 4 69 2 name char (32), /* Name of item */ 4 70 2 item_info_ptr ptr, /* pointer to info structure for this entry */ 4 71 2 parse_info_ptr ptr, /* pointer to info obtained by parsing source */ 4 72 2 other_info_ptr ptr ; /* pointer to additional info structure if needed */ 4 73 4 74 declare list_ovrly_ptr ptr ; /* pointer to overlay structure */ 4 75 4 76 4 77 declare saved_child_count fixed bin based (saved_child_count_ptr) ; /* parent link structure child count */ 4 78 declare saved_child_count_ptr ptr ; /* pointer to remembered number of children */ 4 79 4 80 4 81 /* USES AND MEANING OF LIST ELEMENT ENTRIES 4 82* 4 83* DOMAIN GLOBAL LIST -------------------------- 4 84* 4 85* gl.type - - MAIN_LIST 4 86* gl.name - - 32 char domain name 4 87* gl.item_info_ptr - - pointer to domain_info for this domain 4 88* gl.parse_info_ptr - - pointer to parse info structure 4 89* gl.other_info_ptr - - dbm_ptr, pointer to mdbm_db_model 4 90* gl.item_sub_list_ptr - - pointer to sublist of attributes using this domain 4 91* gl.file_info_ptr - - null () 4 92* gl.file_model_ptr - - null () 4 93* gl.superior_assigned - - ON => domain referenced by some relation 4 94* gl.inferior_assigned - - ON => referencing attribute present 4 95* gl.complete - - ON => domain_info present 4 96* gl.consistant - - always ON 4 97* 4 98* DOMAIN GLOBAL LIST "REFERENCING ATTRIBUTES" SUBLIST ---------------- 4 99* 4 100* sl.type - - SUB_LIST 4 101* sl.name - - 32 char attribute name 4 102* sl.item_info_ptr - - pointer to this attribute's attribute_info 4 103* sl.parse_info_ptr - - pointer to parse info structure 4 104* sl.old_other_info_ptr - - null () 4 105* sl.new_other_info_ptr - - pointer to this domain's global list element 4 106* sl.global_list_ptr - - pointer to attribute's global list element 4 107* 4 108* ATTRIBUTE GLOBAL LIST ----------------- 4 109* 4 110* gl.type - - MAIN_LIST 4 111* gl.name - - 32 char attribute name 4 112* gl.item_info_ptr - - pointer to corresponding domain sublist element for this attribute 4 113* gl.parse_info_ptr - - pointer to parse info structure 4 114* gl.other_info_ptr - - domain_info of domain for this attribute 4 115* gl.item_sub_list_ptr - - pointer to sublist of relations that use this attribute 4 116* gl.file_info_ptr - - null (), use pointer(fm_ptr,file_model.fi_ptr) 4 117* gl.file_model_ptr - - null (), use pointer(ai_ptr,0), ai_ptr from corres. rel's attr sublist 4 118* gl.superior_assigned - - ON => relation contains this attribute 4 119* gl.inferior_assigned - - ON => attribute references known domain 4 120* gl.complete - - ON => attr_info present for this attribute 4 121* gl.consistant - - OFF => no domain for this attribute 4 122* 4 123* ATTRIBUTE GLOBAL LIST "USED IN RELATION" SUBLIST ------------------ 4 124* 4 125* sl.type - - SUB_LIST 4 126* sl.name - - 32 char relation name 4 127* sl.item_info_ptr - - pointer to this relation's rel_info 4 128* sl.parse_info_ptr - - pointer to parse info structure 4 129* sl.old_other_info_ptr - - pointer to attribute's attr_info in this relation 4 130* sl.new_other_info_ptr - - pointer to this attribute's global list element 4 131* sl.global_list_ptr - - pointer to relation's global list element 4 132* 4 133* RELATION GLOBAL LIST ------------------- 4 134* 4 135* gl.type - - MAIN_LIST 4 136* gl.name - - 32 char relation name 4 137* gl.item_info_ptr - - pointer to rel_info for this relation 4 138* gl.parse_info_ptr - - pointer to parse info structure 4 139* gl.other_info_ptr - - pointer to global list element of file containing this relation 4 140* gl.item_sub_list_ptr - - pointer to sublist of attributes in this relation 4 141* gl.file_info_ptr - - pointer to file_info of this relation's file 4 142* gl.file_model_ptr - - pointer to file_model of this relation's file 4 143* gl.superior_assigned - - ON => file present to hold this relation 4 144* gl.inferior_assigned - - ON => attribute's present in this relation 4 145* gl.complete - - ON => rel_info assigned to this relation 4 146* gl.consistant - - OFF => no attributes for this relation 4 147* 4 148* RELATION GLOBAL LIST "CONTAINED ATTRIBUTE" SUBLIST ---------------- 4 149* 4 150* sl.type - - SUB_LIST 4 151* sl.name - - 32 char attribute name 4 152* sl.item_info_ptr - - pointer to this attribute's attribute_info 4 153* sl.parse_info_ptr - - pointer to parse info structure 4 154* sl.old_other_info_ptr - - pointer to domain_info for this attribute in old model 4 155* sl.new_other_info_ptr - - pointer to domain_info for this attribute in new model 4 156* sl.global_list_ptr - - pointer to attribute's global list element 4 157* 4 158* FILE GLOBAL LIST ----------------------- 4 159* 4 160* gl.type - - MAIN_LIST 4 161* gl.name - - 30 char file name plus 2 trailing blanks 4 162* gl.item_info_ptr - - pointer to file_info for this file 4 163* gl.parse_info_ptr - - pointer to parse info structure 4 164* gl.other_info_ptr - - null () 4 165* gl.item_sub_list_ptr - - pointer to sublist of relations contained in this file 4 166* gl.file_info_ptr - - pointer to file_info for this file 4 167* gl.file_model_ptr - - pointer to file_model for this file 4 168* gl.superior_assigned - - ON => file_model present for this file 4 169* gl.inferior_assigned - - ON => relation present for this file 4 170* gl.complete - - OFF => not formatted yet 4 171* gl.consistant - - ON => no relations present 4 172* 4 173* FILE GLOBAL LIST "CONTAINED RELATION" SUBLIST ---------------- 4 174* 4 175* sl.type - - SUB_LIST 4 176* sl.name - - 32 char relation name 4 177* sl.item_info_ptr - - relation's rel_info pointer 4 178* sl.parse_info_ptr - - pointer to parse info structure 4 179* sl.old_other_info_ptr - - null () 4 180* sl.new_other_info_ptr - - pointer to file global list element 4 181* sl.global_list_ptr - - pointer to relation's global list element 4 182* 4 183* FOREIGN KEY GLOBAL LIST -------------------- 4 184* 4 185* gl.type - - MAIN_LIST 4 186* gl.name - - 32 char link(foreign key) name, parent_link_info.name 4 187* gl.item_info_ptr - - pointer to parent_link_info for this foreign key 4 188* gl.parse_info_ptr - - pointer to parse info structure 4 189* gl.other_info_ptr - - pointer to parent relation global list element 4 190* gl.item_sub_list_ptr - - pointer to sublist of child relations for this parent 4 191* gl.file_info_ptr - - pointer to file_info for parent relation's file 4 192* gl.file_model_ptr - - pointer to file_model for parent relation's file 4 193* gl.superior_assigned - - ON => parent present 4 194* gl.inferior_assigned - - ON => child present 4 195* gl.complete - - ON => pli_info and cli_info present 4 196* gl.consistant - - ON => rels/attrs found and corres domains match 4 197* gl.child_defined - - ON => not defined by parent, but by one of it's children 4 198* 4 199* FOREIGN KEY GLOBAL LIST CHILDREN SUBLIST 4 200* 4 201* sl.type - - SUB_LIST 4 202* sl.name - - 32 char name of relation representing this child 4 203* sl.item_info_ptr - - pointer to child_link_info for this child 4 204* sl.parse_info_ptr - - pointer to parse info structure 4 205* sl.old_other_info_ptr - - pointer to file_model holding this child relation 4 206* sl.new_other_info_ptr - - pointer to rel_info for this child 4 207* sl.global_list_ptr - - pointer to child relation global list element 4 208* 4 209* NOTE: all pointers are to the new model unless otherwise indicated 4 210* 4 211**/ 4 212 4 213 /* END INCLUDE FILE mrds_rst_global_lists.incl.pl1 */ 4 214 208 5 1 /* BEGIN INCLUDE FILE mrds_rst_semantics.incl.pl1 jeg 8/31/78 */ 5 2 5 3 /* structure to remember what directives have been seen and are active */ 5 4 5 5 declare 1 directive based (directive_ptr), 5 6 2 type fixed binary, /* stmt structure index for given directive */ 5 7 2 undefine, 5 8 3 active bit (1) unal, 5 9 3 seen bit (1) unal, 5 10 3 pad bit (34) unal, 5 11 2 define, 5 12 3 active bit (1) unal, 5 13 3 seen bit (1) unal, 5 14 3 pad bit (34) unal, 5 15 2 redefine, 5 16 3 active bit (1) unal, 5 17 3 seen bit (1) unal, 5 18 3 pad bit (34) unal, 5 19 2 cmdb, 5 20 3 active bit (1) unal, 5 21 3 seen bit (1) unal, 5 22 3 pad bit (34) unal ; 5 23 5 24 declare directive_ptr ptr internal static ; 5 25 5 26 /* encoding for directive types */ 5 27 5 28 declare UNDEFINE fixed bin internal static options (constant) init (1) ; 5 29 declare DEFINE fixed bin internal static options (constant) init (2) ; 5 30 declare REDEFINE fixed bin internal static options (constant) init (3) ; 5 31 declare CMDB fixed binary internal static options (constant) init (4) ; 5 32 5 33 5 34 /* structure to remember what statements have been seen, are active, 5 35* and how many items are in the statement, and how big the list for the last item was */ 5 36 5 37 declare 1 stmt (4) based (stmt_ptr), 5 38 2 domain, 5 39 3 active bit (1) unal, 5 40 3 pad bit (35) unal, 5 41 3 number fixed binary, 5 42 2 attribute, 5 43 3 active bit (1) unal, 5 44 3 pad bit (35) unal, 5 45 3 number fixed binary, 5 46 2 relation, 5 47 3 active bit (1) unal, 5 48 3 pad bit (35) unal, 5 49 3 number fixed binary, 5 50 2 file, 5 51 3 active bit (1) unal, 5 52 3 pad bit (35) unal, 5 53 3 number fixed binary, 5 54 2 foreign_key, 5 55 3 active bit (1) unal, 5 56 3 pad bit (35) unal, 5 57 3 number fixed binary, 5 58 2 index, 5 59 3 active bit (1) unal, 5 60 3 pad bit (35) unal, 5 61 3 number fixed binary ; 5 62 5 63 /* NOTE: 5 64* active ON => this stmt/directive is currently being processed 5 65* seen ON => this stmt/directive was or is being processed 5 66**/ 5 67 5 68 declare stmt_ptr ptr internal static ; 5 69 5 70 /* END INCLUDE FILE mrds_rst_semantics.incl.pl1 */ 5 71 209 6 1 /* BEGIN INCLUDE FILE mdbm_db_model.incl.pl1 -- jaw, 10/2/78 */ 6 2 6 3 6 4 /****^ HISTORY COMMENTS: 6 5* 1) change(79-02-01,Gray), approve(), audit(), install(): 6 6* modified to save space occupied by model 6 7* 2) change(80-11-03,Gray), approve(), audit(), install(): 6 8* to add mdbm_secured bit in db_model 6 9* 3) change(82-04-09,Davids), approve(), audit(), install(): 6 10* collapsed the following into an unused_offset array: 6 11* chng_before_path_ptr chng_err_path_ptr chng_after_path_ptr 6 12* copy_before_path_ptr copy_err_path_ptr copy_after_path_ptr 6 13* dsply_before_path_pt dsply_err_path_pt dsply_after_path_ptr 6 14* accs_before_path_ptr accs_err_path_ptr accs_after_path_ptr 6 15* unused_1 6 16* Also changed the name of unused_2 to restructuring_history_offset 6 17* and changed the comment on the changer structure to indicate 6 18* that it will contain on database creation information. 6 19* 4) change(82-04-14,Davids), approve(), audit(), install(): 6 20* used one of the unused_offsets to point to a message which indicates 6 21* why the db is inconsistent. The offset will be null when the db is created 6 22* and set the first time the message is used. this is so it will be 6 23* consistent with existing data bases. Also added the message structure. 6 24* 5) change(82-04-28,Davids), approve(), audit(), install(): 6 25* added the undo_request element to the message structure 6 26* 6) change(82-05-04,Davids), approve(), audit(), install(): 6 27* changed unused_offset (12) to last_restructruring_history_offset and 6 28* changed restructuring_history_offset to first_restructuring_history_offset 6 29* 7) change(82-08-19,Davids), approve(), audit(), install(): 6 30* changed the meaning of db_type from 1 => relational and 2 => CODASYL to 6 31* 1 => vfile database and 2 => page_file database. Up to this point all 6 32* database types were equal to 1. 6 33* 8) change(83-02-14,Davids), approve(), audit(), install(): 6 34* changed db_type from a fixed bin unal to a substructure of 18 bit (1) unal 6 35* flags. This will allow information about transactions and dm_file 6 36* concurrency to be independent of the db_type, i.e. vfile or dm_file. The 6 37* change is compatable with all datamodels created by the released version 6 38* of mrds. 6 39* 9) change(83-02-15,Davids), approve(), audit(), install(): 6 40* added the rollback_on flag to the db_type_flags since it appears that you 6 41* can have a dmfile database that requires transactions but does not have any 6 42* journalizing. Also switched the order of the transactions_needed and 6 43* concurrency_on flags - this makes the change compatable with existing 6 44* dmfile databases except when displaying the model since concurrency_on and 6 45* rollback_on will be off in the model even though the dmfile relations had 6 46* them on during creation. 6 47* 10) change(83-02-22,Kubicar), approve(), audit(), install(): 6 48* Removed ctl_file_path_ptr. 6 49* 11) change(85-11-08,Spitzer), approve(85-12-03,MCR7311), 6 50* audit(86-09-02,Blair), install(86-10-16,MR12.0-1187): 6 51* used 1 unused offset for unreferenced attribute linked lists in db_model, 6 52* 1 unused bit flag in domain_info to indicate an unreferenced domain, 1 bit 6 53* in the flag word for rmdb copying. 6 54* END HISTORY COMMENTS */ 6 55 6 56 6 57 /* this include file contains the structures that go into the make up 6 58* of the "db_model" segment in the model for the database. 6 59* in addition there file_model.m segments, 1 for each database file(see mdbm_file_model.incl.pl1) 6 60* 6 61* the db_model structure goes at the base of the segment, and contains items unique to 6 62* the whole databse. in addition, it has an area of size to fill the 6 63* rest of a segment, that holds the lists of files and domains in the database. 6 64* these lists are singly forward linked lists. all "pointers" in the database model 6 65* are maintained as offsets(bit (18)) from the base of the particular model segment 6 66* since actual pointers are process dependent on segment number. 6 67* the remaining structures are first a path_entry one to save pathnames in, 6 68* and the stack_item and constent structures, used to save a boolean 6 69* expression in polish form, with the stack represented by a linked list. 6 70* the final structure is one for identifying the status of version information */ 6 71 6 72 dcl 1 db_model aligned based (dbm_ptr),/* base of db_model segment, allocated once per database */ 6 73 2 version unal fixed bin, /* data base version, currently 4 */ 6 74 2 db_type_flags unal, 6 75 3 copy_good bit (1) unal, /* "1"b => copy of the db_model is the valid copy */ 6 76 3 unused (13) bit (1) unal, 6 77 3 rollback_on bit (1) unal, /* "1"b => before journaling is to be done */ 6 78 3 concurrency_on bit (1) unal, /* "1"b => dm_file concurrency is being used */ 6 79 3 transactions_needed bit (1) unal, /* "1"b => transactions are needed to reference data */ 6 80 3 vfile_type bit (1) unal, /* "1"b => vfile type relations, "0"b => dm_file type relations */ 6 81 2 uniq_sw_name char (32), /* per database unique attach switch name for files */ 6 82 2 consistant bit (1) unal, /* ON => correctly created/restructured database, ok to open */ 6 83 2 mdbm_secured bit (1) unal, /* on => database has been secured */ 6 84 2 reserved bit (34) unal, /* reserved for flags */ 6 85 2 blk_file_id_len unal fixed bin, /* no. bits required for blocked file id. */ 6 86 2 unblk_file_id_len unal fixed bin, /* number of file id bits, unblocked file */ 6 87 2 num_blk_files unal fixed bin, /* number of blocked files defined in db */ 6 88 2 num_unblk_files unal fixed bin, /* number of unblocked files defined in db */ 6 89 2 num_rels unal fixed bin, /* number of relations defined in db. */ 6 90 2 num_domains unal fixed bin, /* number of domains defined */ 6 91 2 num_dyn_links unal fixed bin, /* no. dynamic links defined */ 6 92 2 max_max_tuples unal fixed bin (35), /* maximum max_tuples across all files */ 6 93 2 pad_1 unal fixed bin (35), /* for future use */ 6 94 2 pad_2 unal fixed bin (35), /* for future use */ 6 95 2 version_ptr bit (18), /* offset to version structure */ 6 96 2 file_ptr unal bit (18), /* offset to first in threaded list of file_infos */ 6 97 2 domain_ptr unal bit (18), /* offset to first in list of domain_infos */ 6 98 2 unreferenced_attribute_ptr unal bit (18), /* offset to first in list of unreferenced attr_infos */ 6 99 2 unused_offsets (11) unal bit (18), /* extra offsets if needed */ 6 100 2 last_restructuring_history_offset unal bit (18), /* offset to last restructuring history entry */ 6 101 2 inconsistent_message_offset unal bit (18), /* offset to message indicating why db is inconsistent */ 6 102 2 first_restructuring_history_offset unal bit (18), /* offset to first restructuring history entry */ 6 103 2 changer_ptr unal bit (18), /* offset to information about db creation */ 6 104 2 dbm_area area (sys_info$max_seg_size - fixed (rel (addr (db_model.dbm_area))) - 1); 6 105 6 106 dcl dbm_ptr ptr; 6 107 6 108 /* the files in the database each have a file_info containing 6 109* their name, the file_model for each file is found by initiating the 6 110* segment "file_name.m" (i.e. the file's name with suffix ".m") 6 111* the file_info list is a singly linked list in definition order */ 6 112 6 113 dcl 1 file_info aligned based (fi_ptr), /* list of file names and numbers */ 6 114 2 file_name char (30), /* name of file */ 6 115 2 file_id bit (36), /* id number of file */ 6 116 2 fwd_ptr unal bit (18), /* thread to next in list */ 6 117 2 unused unal bit (18); /* for future expansion */ 6 118 6 119 dcl fi_ptr ptr; 6 120 6 121 /* each domain used in the database will have a domain info saved in the db_model 6 122* segment. it describes the domain of the given name, and it's options. 6 123* the domain_info's form a singly linked list in definition order */ 6 124 6 125 dcl 1 domain_info aligned based (di_ptr), /* one for each domain defined */ 6 126 2 name char (32), /* name of domain */ 6 127 2 db_desc_is_ptr bit (1) unal, /* on if descriptor is pointer to real desc. */ 6 128 2 user_desc_is_ptr bit (1) unal, /* on if user desc is ptr */ 6 129 2 no_conversion bit (1) unal, /* if no conversion allowed */ 6 130 2 procedures_present bit (1) unal, /* on => ids type procedures present */ 6 131 2 unreferenced bit (1) unal, /* on => this domain is not used in any attribute */ 6 132 2 reserved bit (31) unal, 6 133 2 db_desc bit (36), /* desc. for item in db, or ptr to it */ 6 134 2 user_desc bit (36), /* desc. for user-visible attr, or ptr */ 6 135 2 ave_len fixed bin (35), /* average length of varying string */ 6 136 2 nck_items unal fixed bin, /* no. items in check stack */ 6 137 2 fwd_thread unal bit (18), /* offset to next in list */ 6 138 2 check_path_ptr unal bit (18), /* integ. check proc. */ 6 139 2 ck_stack_ptr unal bit (18), /* to check stack */ 6 140 2 encd_path_ptr unal bit (18), /* encode procedure */ 6 141 2 decd_path_ptr unal bit (18), /* decode procedure */ 6 142 2 str_before_path_ptr unal bit (18), /* proc paths and entries */ 6 143 2 str_err_path_ptr unal bit (18), 6 144 2 str_after_path_ptr unal bit (18), 6 145 2 get_before_path_ptr unal bit (18), 6 146 2 get_err_path_ptr unal bit (18), 6 147 2 get_after_path_ptr unal bit (18), 6 148 2 mod_before_path_ptr unal bit (18), 6 149 2 mod_err_path_ptr unal bit (18), 6 150 2 mod_after_path_ptr unal bit (18), 6 151 2 unused_1 unal bit (18), /* for future expansion */ 6 152 2 unused_2 unal bit (18), 6 153 2 changer_ptr unal bit (18); /* pointer to change_id and chane_time structure */ 6 154 6 155 dcl di_ptr ptr; 6 156 6 157 /* information necessary for attributes that are not used in any relation */ 6 158 6 159 dcl 1 unreferenced_attribute aligned based (ua_ptr), 6 160 2 name char (32), /* name of attribute */ 6 161 2 domain_ptr bit (18) unal, /* to domain_info */ 6 162 2 fwd_thread bit (18) unal, /* to next in list */ 6 163 2 unused (2) bit (18) unal; 6 164 6 165 dcl ua_ptr ptr; 6 166 6 167 6 168 /* space saving pathname$entryname structure, to be allocated 6 169* only when a path$entry has to be saved, else only a bit(18) 6 170* offset takes up space in the main model structure */ 6 171 6 172 declare 1 path_entry based (path_entry_ptr), 6 173 2 path char (168), /* pathname portion of desired path$entry */ 6 174 2 entry char (32), /* entryname portion of desired path$entry */ 6 175 2 reserved unal bit (36); /* for future use */ 6 176 6 177 declare path_entry_ptr ptr; 6 178 6 179 6 180 6 181 6 182 6 183 /* declarations for model of postfix stack holding the check option boolean expression 6 184* the following encoding values indicate the corresponding type of stack element 6 185* 6 186* 1 = 6 187* 2 ^= 6 188* 3 > 6 189* 4 < 6 190* 5 >= 6 191* 6 <= 6 192* 6 193* 10 and 6 194* 20 or 6 195* 30 not 6 196* 6 197* 40 - (minus) 6 198* 6 199* 50 domain variable(same name as domain) 6 200* 6 201* 60 constant(number, bit string, or character string) 6 202* 6 203**/ 6 204 6 205 6 206 declare 1 stack_item based (stack_item_ptr), /* element of stack model list */ 6 207 2 next bit (18), /* link to next in list */ 6 208 2 type fixed binary, /* code for this element type */ 6 209 2 value_ptr bit (18); /* pointer to variable holding value, 6 210* if this is a constant element type */ 6 211 6 212 declare stack_item_ptr ptr; /* pointer to a stack element */ 6 213 6 214 6 215 6 216 declare 1 constant based (constant_ptr), /* variable size space for constant's value storage */ 6 217 2 length fixed bin (35), /* length allocated to hold value */ 6 218 2 value bit (alloc_length refer (constant.length)) aligned; /* value for this constant */ 6 219 6 220 declare constant_ptr ptr; /* pointer to constant's value space */ 6 221 6 222 declare alloc_length fixed binary (35) internal static; /* amount of space to allocate for constant's value */ 6 223 6 224 /* version structure, giving status of source for CMDB/RMDB, 6 225* status of model, and status of resultant */ 6 226 6 227 /* version number is in form MM.N.Y 6 228* where MM is the major version number, N is the minor version alteration, 6 229* and Y is the lastest modification to that alteration, 6 230* where M and N represent numbers 0-9, and Y is a letter */ 6 231 6 232 declare 1 version_status unal based (version_status_ptr), 6 233 2 cmdb_rmdb, 6 234 3 major fixed bin, 6 235 3 minor fixed bin, 6 236 3 modification char (4), 6 237 2 model, 6 238 3 major fixed bin, 6 239 3 minor fixed bin, 6 240 3 modification char (4), 6 241 2 resultant, 6 242 3 major fixed bin, 6 243 3 minor fixed bin, 6 244 3 modification char (4); 6 245 6 246 declare version_status_ptr ptr; 6 247 6 248 6 249 /* maintains information only about the db creation */ 6 250 6 251 declare 1 changer unal based (changer_ptr), 6 252 2 id char (32), 6 253 2 time fixed bin (71), 6 254 2 next bit (18); /* to next in the singly linked list */ 6 255 6 256 declare changer_ptr ptr; 6 257 6 258 6 259 dcl 01 message_str unal based (message_str_ptr), /* general purpose structure to hold messages */ 6 260 02 len fixed bin, /* length of the message */ 6 261 02 text char (message_str_len refer (message_str.len)), /* actual message */ 6 262 02 name char (32), /* name of thing that set the message */ 6 263 02 undo_request char (100), /* rmdb request that will undo the operation 6 264* that caused the database to become inconsistent */ 6 265 02 mbz bit (36); /* for possible extensions, like an offset to another message */ 6 266 6 267 dcl message_str_ptr ptr; /* pointer to the message_str structure */ 6 268 6 269 dcl message_str_len fixed bin; /* initail length of the text string in message_str */ 6 270 6 271 /* END INCLUDE FILE mdbm_db_model.incl.pl1 */ 6 272 6 273 210 211 212 end; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 10/16/86 1145.0 mrds_rst_consistancy_check.pl1 >special_ldd>install>MR12.0-1187>mrds_rst_consistancy_check.pl1 205 1 10/14/83 1609.1 mrds_rst_rsc.incl.pl1 >ldd>include>mrds_rst_rsc.incl.pl1 206 2 10/14/83 1608.6 mrds_rst_parse_info.incl.pl1 >ldd>include>mrds_rst_parse_info.incl.pl1 207 3 10/14/83 1608.6 mrds_rst_tree.incl.pl1 >ldd>include>mrds_rst_tree.incl.pl1 208 4 10/14/83 1608.4 mrds_rst_global_lists.incl.pl1 >ldd>include>mrds_rst_global_lists.incl.pl1 209 5 10/14/83 1608.4 mrds_rst_semantics.incl.pl1 >ldd>include>mrds_rst_semantics.incl.pl1 210 6 10/16/86 1139.3 mdbm_db_model.incl.pl1 >special_ldd>install>MR12.0-1187>mdbm_db_model.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. attdom_ptr 000214 automatic pointer dcl 2-84 set ref 161* 162 168 attribute_check parameter bit(1) unaligned dcl 153 ref 109 114 138 attribute_domain based structure level 1 dcl 2-77 char builtin function dcl 202 ref 168 cmdb 4 based structure level 2 packed unaligned dcl 5-5 data based pointer level 2 dcl 3-41 ref 129 default 20 based bit(1) level 2 packed unaligned dcl 2-77 ref 138 162 default_mesg 000101 automatic varying char(8) dcl 192 set ref 164* 167* 171* directive based structure level 1 unaligned dcl 5-5 directive_ptr 000010 internal static pointer dcl 5-24 in procedure "mrds_rst_consistancy_check" set ref 65* 71 79 directive_ptr 242 based pointer level 2 in structure "rsc" dcl 1-29 in procedure "mrds_rst_consistancy_check" ref 65 domain based structure level 1 dcl 2-11 gl based structure level 1 dcl 4-15 gl_ptr 000230 automatic pointer dcl 4-36 set ref 129* 133 138 161 171 182 182 h_gattr_ptr 222 based pointer level 2 dcl 1-29 ref 114 h_gdom_ptr 220 based pointer level 2 dcl 1-29 ref 116 ioa_$rs 000020 constant entry external dcl 195 ref 171 182 line_mesg 000104 automatic varying char(24) dcl 193 set ref 163* 168* 171* line_num 254 based fixed bin(24,0) level 2 in structure "domain" dcl 2-11 in procedure "mrds_rst_consistancy_check" set ref 182* line_num 21 based fixed bin(24,0) level 2 in structure "attribute_domain" dcl 2-77 in procedure "mrds_rst_consistancy_check" ref 168 ltrim builtin function dcl 202 ref 168 message 000113 automatic char(256) unaligned dcl 196 set ref 171* 174 182* 186 message_length 000213 automatic fixed bin(21,0) dcl 197 set ref 171* 182* meter_mesg 000100 automatic char(4) unaligned dcl 190 set ref 71* 73* 74* 107* mrds_error_$rst_unused_attr 000024 external static fixed bin(35,0) dcl 199 set ref 174* mrds_error_$rst_unused_attr_dom 000026 external static fixed bin(35,0) dcl 200 set ref 186* mrds_rst_error 000022 constant entry external dcl 198 ref 174 186 mrds_rst_meter 000014 constant entry external dcl 191 ref 74 107 mrds_rst_tree_successor 000016 constant entry external dcl 194 ref 124 name 1 based char(32) level 2 dcl 4-15 set ref 171* 182* node based structure level 1 dcl 3-41 node_ptr 000220 automatic pointer dcl 3-27 set ref 117* 124* 128* 129 parse_info_ptr 14 based pointer level 2 dcl 4-15 ref 138 161 182 root_ptr 000216 automatic pointer dcl 3-26 set ref 114* 116* 117 124* rsc based structure level 1 unaligned dcl 1-29 rsc_ptr parameter pointer dcl 1-94 set ref 32 64 65 69 74* 106 107* 114 116 174* 186* seen 4(01) based bit(1) level 3 packed unaligned dcl 5-5 ref 71 79 stmt_ptr 000012 internal static pointer dcl 5-68 in procedure "mrds_rst_consistancy_check" set ref 64* stmt_ptr 244 based pointer level 2 in structure "rsc" dcl 1-29 in procedure "mrds_rst_consistancy_check" ref 64 success 000226 automatic bit(1) unaligned dcl 3-38 set ref 118* 122 124* 126 successor_parent_ptr 000224 automatic pointer dcl 3-31 set ref 124* successor_ptr 000222 automatic pointer dcl 3-30 set ref 124* 128 superior_assigned 26(05) based bit(1) level 2 packed unaligned dcl 4-15 ref 133 trace_sw 206(07) based bit(1) level 2 packed unaligned dcl 1-29 ref 69 106 NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. CMDB internal static fixed bin(17,0) initial dcl 5-31 DEFINE internal static fixed bin(17,0) initial dcl 5-29 MAIN_LIST internal static fixed bin(17,0) initial dcl 4-63 REDEFINE internal static fixed bin(17,0) initial dcl 5-30 SEG_INFO internal static fixed bin(17,0) initial dcl 4-65 SUB_LIST internal static fixed bin(17,0) initial dcl 4-64 UNDEFINE internal static fixed bin(17,0) initial dcl 5-28 accum_token_ptr internal static pointer dcl 2-171 addr builtin function dcl 202 alloc_length internal static fixed bin(35,0) dcl 6-222 area_ptr automatic pointer dcl 3-34 attribute based structure level 1 dcl 2-63 attribute_ptr automatic pointer dcl 2-73 changer based structure level 1 packed unaligned dcl 6-251 changer_ptr automatic pointer dcl 6-256 children based structure level 1 dcl 2-131 children_ptr automatic pointer dcl 2-136 constant based structure level 1 unaligned dcl 6-216 constant_ptr automatic pointer dcl 6-220 data_ptr automatic pointer dcl 3-29 db_model based structure level 1 dcl 6-72 dbm_ptr automatic pointer dcl 6-106 delete_name based structure level 1 dcl 2-160 delete_name_ptr automatic pointer dcl 2-165 di_ptr automatic pointer dcl 6-155 dom_list based structure level 1 unaligned dcl 2-189 dom_list_ptr automatic pointer dcl 2-188 domain_info based structure level 1 dcl 6-125 domain_ptr automatic pointer dcl 2-45 fi_ptr automatic pointer dcl 6-119 file based structure level 1 dcl 2-89 file_info based structure level 1 dcl 6-113 file_ptr automatic pointer dcl 2-104 fixed builtin function dcl 202 fixup_token based char unaligned dcl 2-178 foreign_key based structure level 1 dcl 2-139 forkey_ptr automatic pointer dcl 2-147 index_ptr automatic pointer dcl 2-115 item based structure level 1 dcl 2-150 item_ptr automatic pointer dcl 2-157 key automatic char(32) dcl 3-24 link based structure level 1 dcl 2-118 link_ptr automatic pointer dcl 2-128 list_ovrly based structure level 1 dcl 4-67 list_ovrly_ptr automatic pointer dcl 4-74 message_str based structure level 1 packed unaligned dcl 6-259 message_str_len automatic fixed bin(17,0) dcl 6-269 message_str_ptr automatic pointer dcl 6-267 mrds_data_$max_line_size external static fixed bin(35,0) dcl 2-173 mrds_data_$max_string_size external static fixed bin(35,0) dcl 2-172 output_text based varying char dcl 2-175 output_text_ptr internal static pointer dcl 2-177 parent_ptr automatic pointer dcl 3-28 path_entry based structure level 1 packed unaligned dcl 6-172 path_entry_ptr automatic pointer dcl 6-177 predecessor_parent_ptr automatic pointer dcl 3-33 predecessor_ptr automatic pointer dcl 3-32 rel builtin function dcl 202 rel_index based structure level 1 dcl 2-107 relation based structure level 1 dcl 2-51 relation_ptr automatic pointer dcl 2-60 saved_child_count based fixed bin(17,0) dcl 4-77 saved_child_count_ptr automatic pointer dcl 4-78 seg_info based structure level 1 unaligned dcl 4-53 seg_info_ptr automatic pointer dcl 4-59 sl based structure level 1 dcl 4-40 sl_ptr automatic pointer dcl 4-50 source_size automatic fixed bin(35,0) dcl 2-182 stack_item based structure level 1 unaligned dcl 6-206 stack_item_ptr automatic pointer dcl 6-212 stmt based structure array level 1 unaligned dcl 5-37 string_source based char unaligned dcl 2-184 string_source_ptr automatic pointer dcl 2-183 sys_info$max_seg_size external static fixed bin(35,0) dcl 201 thread automatic bit(1) dcl 3-39 token based varying char dcl 2-169 token_length automatic fixed bin(24,0) dcl 2-174 ua_ptr automatic pointer dcl 6-165 unreferenced_attribute based structure level 1 dcl 6-159 version_status based structure level 1 packed unaligned dcl 6-232 version_status_ptr automatic pointer dcl 6-246 work_area based area(1024) dcl 3-36 NAMES DECLARED BY EXPLICIT CONTEXT. check_for_referencing_relation 000300 constant entry internal dcl 109 ref 83 85 96 98 mrds_rst_consistancy_check 000127 constant entry external dcl 32 unused_attribute_error 000405 constant entry internal dcl 157 ref 140 unused_domain_error 000636 constant entry internal dcl 178 ref 142 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 1102 1132 773 1112 Length 1450 773 30 301 107 4 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME mrds_rst_consistancy_check 468 external procedure is an external procedure. check_for_referencing_relation internal procedure shares stack frame of external procedure mrds_rst_consistancy_check. unused_attribute_error internal procedure shares stack frame of external procedure mrds_rst_consistancy_check. unused_domain_error internal procedure shares stack frame of external procedure mrds_rst_consistancy_check. STORAGE FOR INTERNAL STATIC VARIABLES. LOC IDENTIFIER BLOCK NAME 000010 directive_ptr mrds_rst_consistancy_check 000012 stmt_ptr mrds_rst_consistancy_check STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME mrds_rst_consistancy_check 000100 meter_mesg mrds_rst_consistancy_check 000101 default_mesg mrds_rst_consistancy_check 000104 line_mesg mrds_rst_consistancy_check 000113 message mrds_rst_consistancy_check 000213 message_length mrds_rst_consistancy_check 000214 attdom_ptr mrds_rst_consistancy_check 000216 root_ptr mrds_rst_consistancy_check 000220 node_ptr mrds_rst_consistancy_check 000222 successor_ptr mrds_rst_consistancy_check 000224 successor_parent_ptr mrds_rst_consistancy_check 000226 success mrds_rst_consistancy_check 000230 gl_ptr mrds_rst_consistancy_check THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. alloc_char_temp cat_realloc_chars call_ext_out_desc call_ext_out return_mac shorten_stack ext_entry THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. ioa_$rs mrds_rst_error mrds_rst_meter mrds_rst_tree_successor THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. mrds_error_$rst_unused_attr mrds_error_$rst_unused_attr_dom LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 32 000124 64 000134 65 000141 69 000143 71 000147 73 000155 74 000157 79 000210 83 000215 85 000221 88 000225 96 000226 98 000232 106 000236 107 000245 212 000277 109 000300 114 000302 116 000315 117 000322 118 000323 122 000325 124 000331 126 000350 128 000354 129 000356 133 000361 138 000365 140 000400 142 000402 150 000403 155 000404 157 000405 161 000406 162 000411 163 000414 164 000420 165 000424 167 000425 168 000426 169 000502 171 000503 174 000602 176 000635 178 000636 182 000637 186 000727 188 000762 ----------------------------------------------------------- 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