1 /*  START OF:       rmdb_crossref_info.incl.pl1               *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  */
  2 
  3 /****^  HISTORY COMMENTS:
  4   1) change(85-12-03,Spitzer), approve(85-12-03,MCR7311),
  5      audit(86-09-15,Gilcrease), install(86-10-16,MR12.0-1187):
  6      written.
  7                                                    END HISTORY COMMENTS */
  8 
  9 /*DESCRIPTION
 10   The following structures are the definition of the records with the keyed
 11   vfile that is built during restructuring. This file serves as a crossreference
 12   of unique attributes and domains used within the specified MRDS database. Each
 13   object is a char (33); the first byte is set to an unprintable character so we
 14   can use the index builtin to find a specific object.
 15 */
 16 
 17 dcl crossref_info_record_ptr ptr;
 18 dcl crossref_info_record_count fixed bin (21);
 19 dcl 1 crossref_info_record based (crossref_info_record_ptr),
 20      2 offset bit (18) unal,
 21      2 pad bit (18) unal,
 22      2 count fixed bin (21),
 23      2 entry (crossref_info_record_count refer (crossref_info_record.count)) unaligned,
 24       3 object_head char (1),
 25       3 object char (32);
 26 
 27 dcl crossref_info_record_objects char (33*crossref_info_record.count)
 28                                  based (addr (crossref_info_record.entry(1)));
 29 dcl OBJECT_HEAD char (1) int static options (constant) init ("^@");
 30 
 31 dcl ATTRIBUTE_KEY_HEAD char (10) int static options (constant) init ("attribute:");
 32 dcl DOMAIN_KEY_HEAD char (7) int static options (constant) init ("domain:");
 33 dcl RELATION_KEY_HEAD char (9) int static options (constant) init ("relation:");
 34 
 35 /*DESCRIPTION
 36   The following structures are used to contain sufficient crossreference
 37   information for the delete_attribute and delete_domain requests. These
 38   requests require a more complete view of a crossreference tree, associating
 39   domains, attributes and relations in 2 directions.
 40 */
 41 
 42 dcl domain_list_ptr ptr;
 43 dcl domain_list_count fixed bin;
 44 dcl domain_list_names char (33*domain_list.count) based (addr (domain_list.name(1)));
 45 dcl 1 domain_list based (domain_list_ptr),
 46      2 count fixed bin,                                     /* number of domains in the list */
 47      2 name (domain_list_count refer (domain_list.count))
 48             char (33) unaligned,                            /* name of this domain */
 49      2 attribute_list_ptr (domain_list_count refer (domain_list.count))
 50                           ptr;                              /* -> attribute_list structure */
 51 
 52 dcl attribute_list_ptr ptr;
 53 dcl attribute_list_count fixed bin;
 54 dcl attribute_list_names char (33*attribute_list.count) based (addr (attribute_list.name(1)));
 55 dcl 1 attribute_list based (attribute_list_ptr),
 56      2 count fixed bin,                                     /* number of attributes in the list */
 57      2 name (attribute_list_count refer (attribute_list.count))
 58             char (33) unaligned,                            /* name of this attribute */
 59      2 domain_info_ptr (attribute_list_count refer (attribute_list.count))
 60                        bit (18) unal,                       /* offset in db_model of the domain_info structure for this attribute */
 61      2 attribute_ptr (attribute_list_count refer (attribute_list.count))
 62                      ptr;                                   /* -> attribute structure */
 63 
 64 dcl relation_list_ptr ptr;
 65 dcl relation_list_count fixed bin;
 66 dcl relation_list_names char (33*relation_list.count) based (addr (relation_list.name (1)));
 67 dcl 1 relation_list based (relation_list_ptr),
 68      2 count fixed bin,                                     /* number of relations that are to be touched in this operation */
 69      2 name (relation_list_count refer (relation_list.count))
 70             char (33) unaligned,                            /* name of this relation */
 71      2 relation_ptr (relation_list_count refer (relation_list.count))
 72                     ptr;                                    /* -> relation structure */
 73 
 74 dcl relation_ptr ptr;
 75 dcl relation_attribute_count fixed bin;
 76 dcl relation_attribute_names char (33*relation.attribute_count) based (addr (relation.attribute_names (1)));
 77 dcl 1 relation based (relation_ptr),
 78      2 name char (32),                                      /* name of the relation */
 79      2 file_model_ptr ptr,                                  /* -> relation.m segment */
 80      2 copy_file_model_ptr ptr,
 81      2 attribute_count fixed bin,                           /* number of attributes defined for this relation */
 82      2 mbz fixed bin (35),
 83      2 attribute (relation_attribute_count refer (relation.attribute_count)),
 84       3 flags aligned,
 85         4 delete bit (1) unaligned,                         /* ON: delete this attribute */
 86         4 new bit (1) unaligned,                            /* ON: this attribute is added to the relation */
 87         4 part_of_key bit (1) unaligned,                    /* ON: this attribute is part of the primary key */
 88         4 to_be_deleted bit (1) unaligned,
 89         4 pad bit (32) unaligned,
 90       3 domain_info_ptr bit (18) aligned,                   /* -> db_model domain_info structure */
 91       3 attribute_info_ptr ptr,                             /* -> file_model attribute_info structure */
 92       3 value_ptr ptr,                                      /* if flags.new, this -> the value of the column to be stored */
 93                                                             /*   it must be of the correct data type as specified by the domain */
 94      2 attribute_names (relation_attribute_count refer (relation.attribute_count))
 95                        char (33) unaligned;
 96 
 97 dcl attribute_ptr ptr;
 98 dcl attribute_count fixed bin;
 99 dcl 1 attribute based (attribute_ptr),
100      2 count fixed bin,                                     /* number of relations this attribute is used in */
101      2 relation_idx (attribute_count refer (attribute.count))
102                     fixed bin;                              /* index into list of relation names */
103 
104 /*  END OF:         rmdb_crossref_info.incl.pl1               *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  */