1 /* BEGIN mdbm_users.incl.pl1   -- odf, 08/10/78  */
  2 
  3 
  4 
  5 /****^  HISTORY COMMENTS:
  6   1) change(86-10-03,Dupuis), approve(86-10-21,MCR7562), audit(86-10-22,Blair),
  7      install(86-10-23,MR12.0-1199):
  8      Deleted the DEFAULT_WAIT variable.
  9                                                    END HISTORY COMMENTS */
 10 
 11 
 12 /* HISTORY:
 13    Written by Oris Friesen August 10, 1978.
 14    Modified by M. Pierret 13 December 1979, changing wakeup messages.
 15    Modified by M. Pierret 13 April 1980 (Jason's birthday) to remove priority and wakeup structures
 16    Modified by M. Pierret 13 August 1980 to group like fields (ids, offsets...)
 17    Modified by Jim Gray - - 80-11-19, to add fields to fil_list to allow for complete
 18    r-u-s-m-d scope codes, instead of just r-u.
 19 
 20    80-12-10 Jim Gray : change names of fil_list prevent/permit modes
 21    store to append_tuple, retreive to read_attr, delete to delete_tuple, modify to modify_attr,
 22    and pad to mbz for consistency with MRDS access acl modes.
 23 
 24    80-12-12 Jim Gray : Changed DEFAULT_WAIT declaration to fixed bin 35 from 71,
 25    so that the wait_seconds fb35 overlay would not get 0 and thus never wait.
 26    This is currently only used in mrds_dsl_set_fscope.
 27 
 28    82-09-22 Davids: addede the opening_id element to the fil_list structure.
 29    Put it at the end to make the new structure compatable with the old so
 30    that testing could take place without having to recompile all the modules
 31    that use the structure.
 32 
 33    82-10-14 Davids: removed the opening_id element and added the rmri_ptr
 34    element. This was done because set_fscope must be able to open the
 35    relation if its not yet opened.
 36    ---------------------------------------------------------------------------
 37    DESCRIPTION:
 38 
 39    The dbc contains the following information in its static area.
 40    One group of information is composed of structures (user_list)
 41    threaded 3 ways to form 3 lists. They are the list of active
 42    scope users, of open users, and of users waiting to set scope.
 43    The beginning of each of these lists is pointed to by fields
 44    in the dbc proper.  All of these lists share the user_list structures,
 45    and are completely contained within these structures, i.e., there
 46    is no extraneous information in some knook in Scottsdale.
 47 
 48    Associated with each user_list structure is a linked list of
 49    fil_list structures.  The list is of all of the files (relations)
 50    included in the user's scope request.  Unlike the user_list
 51    structures which were shared by several different lists, the structures
 52    in a user's file list are exclusively hers.  The entries contain
 53    information about the scope request and the file name, and have
 54    no real connection with the actual files in the resultant model.
 55    --------------------------------------------------------------------------- */
 56 
 57 dcl 1 user_list based (ul_ptr),
 58     2 ids,
 59       3 group_id char (32),                                 /* group identifier of this user */
 60       3 process_id bit (36),                                /* process identifier of this user */
 61       3 db_lock_id bit (36) aligned,                        /* the unique lock id for this process --
 62                                                                used to identify dead processes */
 63       3 ev_chn_id fixed bin (71),                           /* event channel id for this process */
 64       3 rdbi_bits bit (72),                                 /* bit string of rdbi_ptr
 65                                                                to allow concurrent openings by same process */
 66     2 flags,
 67       3 open_mode fixed bin unal,                           /* the mode of the db. opening -- NORMAL or QUIESCE */
 68       3 passive_sw bit (1) unal,                            /* OFF => -permit update on some file */
 69       3 active_sw bit (1) unal,                             /* ON => user has a scope set */
 70       3 waiting_sw bit (1) unal,                            /* ON => user is waiting for scope to be set */
 71       3 priority_high bit (1) unal,                         /* obsolete */
 72       3 event_signal_sw bit (1) unal,                       /* ON => user has been signalled thru event wait channel */
 73       3 dead_proc bit (1) unal,                             /* ON => this user's process has died  and is inactive */
 74       3 dead_proc_conflict
 75      bit (1) unal,                                          /* this user's scope request conflicts with a dead process */
 76       3 queue_activ bit (1) unal,                           /* activated from the waiting queue */
 77       3 pad bit (28),                                       /* reserved for future use */
 78     2 allowance_count fixed bin,                            /* obsolete */
 79     2 bypass_count fixed bin,                               /* obsolete */
 80     2 offsets,
 81       3 fil_list_ofs bit (18) unal,                         /* bit offset to list of files in this user's scope request */
 82       3 next_active_ofs bit (18) unal,                      /* bit offset to next user in this list of active scope users */
 83       3 next_waiting_ofs bit (18) unal,                     /* bit offset to next user in user list waiting to set scope */
 84       3 next_open_ofs bit (18) unal,                        /* bit offset to next user who has data base open in any mode */
 85     2 num_filns fixed bin,                                  /* number of files potentially accessible by this user */
 86     2 file (num_filns refer (user_list.num_filns)) char (30);
 87                                                             /* names of files accessible by this user */
 88 
 89 dcl 1 fil_list based (fl_ptr),                              /* of files which a given user has specified for a scope  */
 90     2 name char (30),                                       /* data model name of the file specified in scope request */
 91     2 permits,                                              /* permit codes for scope setting or deleting */
 92       3 mbz1 bit (15) unal,
 93       3 modify_attr bit (1) unal,
 94       3 delete_tuple bit (1) unal,
 95       3 append_tuple bit (1) unal,
 96       3 update bit (1) unal,
 97       3 read_attr bit (1) unal,
 98     2 prevents,                                             /* prevent codes for scope setting or deleting */
 99       3 update bit (1) unal,
100       3 read_attr bit (1) unal,
101       3 append_tuple bit (1) unal,
102       3 delete_tuple bit (1) unal,
103       3 modify_attr bit (1) unal,
104       3 mbz2 bit (29) unal,
105     2 next_ofs bit (18) unal,                               /* bit offset to next file entry for this user's scope request */
106     2 rmri_ptr ptr;                                         /* pointer to the relation's rm_rel_info str */
107                                                             /* needed so that the relation can be opened if need be */
108 
109 dcl  ul_ptr ptr init (null ());
110 dcl  fl_ptr ptr init (null ());
111 
112 dcl  num_filns fixed bin;                                   /* number of files accessible by a given user */
113 
114 
115 dcl  WAIT init (0) fixed bin int static options (constant);
116                                                             /* the number of later user requests for which a user
117                                                                request will wait before it must be honored */
118 dcl  NULL_OFS bit (18) init ("111111111111111111"b) unal int static options (constant);
119 dcl  DQ_OPEN bit (1) unal init ("1"b) int static options (constant);
120                                                             /* dequeue from open list */
121 dcl  NO_DQ_OPEN bit (1) init ("0"b) int static options (constant);
122                                                             /*  do not dequeue from open list */
123 dcl  CHAR_Q_F char (8) init ("que_free") int static options (constant);
124 dcl  QUE_FREE fixed bin (71);
125 dcl  CHAR_ALARM char (8) init ("alarm___") int static options (constant);
126                                                             /* wakeup up signal for time-out */
127 dcl  ALARM fixed bin (71);
128 dcl  FIRST_QUEUE bit (1) init ("1"b) int static options (constant);
129                                                             /* this is the 1st time process will asleep */
130 dcl  QUEUE_AGAIN bit (1) init ("0"b) int static options (constant);
131                                                             /* being queued for the 2nd, 3rd ... time */
132 dcl  SET bit (1) unal init ("1"b) int static options (constant);
133                                                             /* check to see which scopes can be set */
134 dcl  DEL bit (1) unal init ("0"b) int static options (constant);
135                                                             /* check to see which scopes can be deleted */
136 dcl  ALIVE init ("1"b) bit (1) unal int static options (constant);
137                                                             /* process is alive */
138 dcl  DEAD init ("0"b) bit (1) unal int static options (constant);
139                                                             /* process is dead */
140 dcl  Q_PRM init (3) fixed bin (35) int static options (constant);
141                                                             /* permit retrieve, update */
142 dcl  Q_PRV init (3) fixed bin (35) int static options (constant);
143                                                             /* prevent retrieve, update */
144 dcl  Q_PRM_BITS bit (2) unal init ("11"b) int static options (constant);
145                                                             /* permit retrieve, update */
146 dcl  Q_PRV_BITS bit (2) unal init ("11"b) int static options (constant);
147                                                             /* prevent retrieve, update */
148 dcl  REL_SEC bit (2) init ("11"b) int static options (constant);
149                                                             /* measure wait time in relative seconds */
150 dcl  FREE_FIL_LIST bit (1) unal init ("1"b) int static options (constant);
151                                                             /* free this user's file lists */
152 dcl  SAVE_FIL_LIST bit (1) unal init ("0"b) int static options (constant);
153                                                             /* do not free this user's file lists */
154 
155 /* END mdbm_users.incl.pl1 */
156