2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
24 * COMPONENT_NAME: austext
26 * FUNCTIONS: alloc_dict
32 * This module contains IBM CONFIDENTIAL code. -- (IBM
33 * Confidential Restricted when combined with the aggregated
34 * modules for this product)
36 * OBJECT CODE ONLY SOURCE MATERIALS
37 * (C) COPYRIGHT International Business Machines Corp. 1995, 1996
39 * US Government Users Restricted Rights - Use, duplication or
40 * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
42 /*-----------------------------------------------------------------------
43 $XConsortium: inittab.c /main/5 1996/08/12 12:34:15 cde-ibm $
44 inittab.c -- db_VISTA table initialization module.
46 (C) Copyright 1987 by Raima Corporation.
47 -----------------------------------------------------------------------*/
49 /* ********************** EDIT HISTORY *******************************
51 SCR DATE INI DESCRIPTION
52 ----- --------- --- -----------------------------------------------------
53 101 21-Jun-88 RSC Initialized rn_type and rn_dba
54 23-Jun-88 RSC Make const_dbd, const_dbf unique to 7 chars
55 274 30-Jun-88 RSC Initialization of curr_rec was goofy (erroneous)
56 115 19-Jul-88 RSC Integrate VAX/VMS changes into code
57 04-Aug-88 RTK MULTI_TASK changes
58 18-Aug-88 RSC moved rn_type/dba to separate table.
59 417 31-Aug-88 RSC Initialized curr_rn_table.
60 420 19-Oct-88 RSC key_count was initialized wrong causing memory overwrites
61 438 06-Jan-89 RSC need to explicitly initialize size_xx
62 532 06-Jan-89 RSC Fixes to compile with ONE_DB
65 * Revision 1.3 1995/10/17 19:19:59 miker
66 * Changed .dbd file open mode from O_RDWR to O_RDONLY.
67 * When initializing tables only need to read .dbd file.
69 * Revision 1.2 1995/10/13 18:48:16 miker
70 * Change hardcoded dbfile[] size from 48 to DtSrFILENMLEN.
72 * Revision 1.1 1995/10/13 18:48:00 miker
73 * Original vista source.
84 int debugging_inittab = FALSE;
85 int dump_init_tables = FALSE;
88 /* Internal function prototypes */
89 static int alloc_dict(P0);
90 static int initcurr(P0);
95 /* Initialize database tables
99 register int dbt_lc; /* loop control */
101 int key_offset = 0, key_count;
102 char dbfile[DtSrFILENMLEN], dbd_ver[DBD_COMPAT_LEN + 1];
103 char dbname[FILENMLEN]; /* Temporary working space */
105 FILE_ENTRY FAR *file_ptr;
106 FIELD_ENTRY FAR *fld_ptr;
117 #if DB_ENABLE | TS_ENABLE
118 RECORD_ENTRY FAR *rec_ptr;
119 SET_ENTRY FAR *set_ptr;
122 MEMBER_ENTRY FAR *mem_ptr;
123 SORT_ENTRY FAR *srt_ptr;
124 KEY_ENTRY FAR *key_ptr;
128 db_tsrecs = db_tssets = FALSE;
130 size_ft = size_rt = size_st = size_mt = size_srt = size_fd = size_kt = 0;
132 /* compute individual dictionary sizes and offsets */
134 for (dbt_lc = 0, curr_db_table = &db_table[old_no_of_dbs];
135 dbt_lc < no_of_dbs; ++dbt_lc, ++curr_db_table) {
138 /* form database dictionary name */
139 if ( DB_REF(db_path[0]) )
140 strcpy(dbname, DB_REF(db_path));
145 if (debugging_inittab) {
146 printf (__FILE__"100 inittab: path='%s' dbname='%s'\n",
147 dbname, DB_REF(db_name));
151 if (strlen(dbname) + strlen(DB_REF(db_name)) >= FILENMLEN+4)
152 return( dberr(S_NAMELEN) );
153 strcat(dbname, DB_REF(db_name));
154 if (con_dbd(dbfile, dbname, get_element(dbdpath, dbt_lc)) != S_OKAY)
155 return( dberr(db_status) );
157 /*----------------- PASS 1 -------------------
158 * In this first pass, only opening to determine
159 * required table sizes, so opening read-only is ok.
161 if ( (dbf = open_b(dbfile, O_RDONLY)) < 0 )
162 return( dberr( S_INVDB ) );
164 /* Read in and verify the dictionary version */
165 DB_READ(dbf, dbd_ver, DBD_COMPAT_LEN);
166 dbd_ver[DBD_COMPAT_LEN] = '\0';
167 for ( i=0; i<size_compat; i++ ) {
168 if ( strcmp( dbd_ver, compat_dbd[i] ) == 0 ) goto goodver;
171 /* Incompatible dictionary file */
173 return( dberr( S_INCOMPAT ) );
176 /* Read in database page size */
177 DB_READ(dbf, (char FAR *)&DB_REF(Page_size), sizeof(INT));
178 NTOHS (DB_REF(Page_size));
180 /* Read in table sizes */
181 DB_READ(dbf, (char FAR *)&DB_REF(Size_ft), sizeof(INT));
182 NTOHS (DB_REF(Size_ft));
183 DB_READ(dbf, (char FAR *)&DB_REF(Size_rt), sizeof(INT));
184 NTOHS (DB_REF(Size_rt));
185 DB_READ(dbf, (char FAR *)&DB_REF(Size_fd), sizeof(INT));
186 NTOHS (DB_REF(Size_fd));
187 DB_READ(dbf, (char FAR *)&DB_REF(Size_st), sizeof(INT));
188 NTOHS (DB_REF(Size_st));
189 DB_READ(dbf, (char FAR *)&DB_REF(Size_mt), sizeof(INT));
190 NTOHS (DB_REF(Size_mt));
191 DB_READ(dbf, (char FAR *)&DB_REF(Size_srt), sizeof(INT));
192 NTOHS (DB_REF(Size_srt));
193 DB_READ(dbf, (char FAR *)&DB_REF(Size_kt), sizeof(INT));
194 NTOHS (DB_REF(Size_kt));
195 close(dbf); /* end of PASS 1 */
198 if (debugging_inittab) {
199 printf (__FILE__"152 sizes: pg=%d ft=%d rt=%d fd=%d\n"
200 " st=%d mt=%d srt=%d kt=%d\n",
201 (int) DB_REF(Page_size),
202 (int) DB_REF(Size_ft),
203 (int) DB_REF(Size_rt),
204 (int) DB_REF(Size_fd),
205 (int) DB_REF(Size_st),
206 (int) DB_REF(Size_mt),
207 (int) DB_REF(Size_srt),
208 (int) DB_REF(Size_kt)
214 DB_REF(sysdba) = NULL_DBA;
217 /* update merged dictionary offsets and sizes */
218 if ( curr_db_table->Page_size > page_size ) {
219 page_size = curr_db_table->Page_size;
221 if (debugging_inittab) {
222 printf (__FILE__"191 db's page_size-->%d (largest = %d)\n",
223 (int)page_size, (int)largest_page);
229 curr_db_table->ft_offset = size_ft;
230 size_ft += curr_db_table->Size_ft;
231 curr_db_table->rt_offset = size_rt;
232 size_rt += curr_db_table->Size_rt;
233 curr_db_table->fd_offset = size_fd;
234 size_fd += curr_db_table->Size_fd;
235 curr_db_table->st_offset = size_st;
236 size_st += curr_db_table->Size_st;
237 curr_db_table->mt_offset = size_mt;
238 size_mt += curr_db_table->Size_mt;
239 curr_db_table->srt_offset = size_srt;
240 size_srt += curr_db_table->Size_srt;
241 curr_db_table->kt_offset = size_kt;
242 size_kt += curr_db_table->Size_kt;
245 /* allocate dictionary space */
246 if ( alloc_dict() != S_OKAY ) return( db_status );
248 /* read in and adjust dictionary entries for each database */
250 for (dbt_lc = 0, curr_db_table = &db_table[old_no_of_dbs];
252 ++dbt_lc, ++curr_db_table) {
255 /* form database dictionary name */
256 if ( DB_REF(db_path[0]) )
257 strcpy(dbname, DB_REF(db_path));
260 if (strlen(dbname) + strlen(DB_REF(db_name)) >= FILENMLEN+4)
261 return( dberr(S_NAMELEN) );
262 strcat(dbname,DB_REF(db_name));
263 if (con_dbd(dbfile,dbname,get_element(dbdpath, dbt_lc)) != S_OKAY)
264 return( dberr(db_status) );
266 if (dump_init_tables) {
267 printf (__FILE__"247 Tables for database '%s':\n", dbfile);
272 /*----------------- PASS 2 -------------------
273 * Second pass just loads allocated tables,
274 * so opening .dbd file read-only is still ok.
276 dbf = open_b (dbfile, O_RDONLY);
277 DB_LSEEK(dbf, DBD_COMPAT_LEN + 8L*sizeof(INT), 0);
279 /*----------------- FILE TABLE -------------------*/
280 DB_READ(dbf, (char FAR *)&file_table[ORIGIN(ft_offset)],
281 (DB_REF(Size_ft)*sizeof(FILE_ENTRY)));
282 /* Invalid if sizeof(xxxx_ENTRY) diff on each machine */
283 for ( i = 0, file_ptr = &file_table[ORIGIN(ft_offset)];
286 /* Byte swap each INT on LITTLE_ENDIAN machines */
287 NTOHS (file_ptr->ft_slots);
288 NTOHS (file_ptr->ft_slsize);
289 NTOHS (file_ptr->ft_pgsize);
290 NTOHS (file_ptr->ft_flags);
292 if (dump_init_tables) {
293 printf (" FILE#%d: ty=%c slts=%2d slsz=%3d pgsz=%d '%s'\n",
296 (int)file_ptr->ft_slots,
297 (int)file_ptr->ft_slsize,
298 (int)file_ptr->ft_pgsize,
305 /*----------------- RECORD TABLE -------------------*/
306 DB_READ(dbf, (char FAR *)&record_table[ORIGIN(rt_offset)],
307 (DB_REF(Size_rt)*sizeof(RECORD_ENTRY)));
308 for ( i = 0, rec_ptr = &record_table[ORIGIN(rt_offset)];
311 /* Byte swap each INT on LITTLE_ENDIAN machines */
312 NTOHS (rec_ptr->rt_file);
313 NTOHS (rec_ptr->rt_len);
314 NTOHS (rec_ptr->rt_data);
315 NTOHS (rec_ptr->rt_fields);
316 NTOHS (rec_ptr->rt_fdtot);
317 NTOHS (rec_ptr->rt_flags);
319 if (dump_init_tables) {
321 " REC #%d: fil=%d len=%3d data=%2d fld1=%2d flds=%2d\n",
323 (int)rec_ptr->rt_file,
324 (int)rec_ptr->rt_len,
325 (int)rec_ptr->rt_data,
326 (int)rec_ptr->rt_fields,
327 (int)rec_ptr->rt_fdtot);
333 /*----------------- FIELD TABLE -------------------*/
334 DB_READ(dbf, (char FAR *)&field_table[ORIGIN(fd_offset)],
335 (DB_REF(Size_fd)*sizeof(FIELD_ENTRY)));
336 for ( i = 0, fld_ptr = &field_table[ORIGIN(fd_offset)];
339 /* Byte swap each INT on LITTLE_ENDIAN machines */
340 NTOHS (fld_ptr->fd_len);
341 NTOHS (fld_ptr->fd_keyfile);
342 NTOHS (fld_ptr->fd_keyno);
343 NTOHS (fld_ptr->fd_ptr);
344 NTOHS (fld_ptr->fd_rec);
345 NTOHS (fld_ptr->fd_flags);
346 for (j=0; j<MAXDIMS; j++)
347 NTOHS (fld_ptr->fd_dim[j]);
349 if (dump_init_tables) {
351 puts (" key typ len kfil key# ofs rec# flg dims");
353 " FLD#%2d %c %c %3d %d %d %3d %d %x",
357 (int)fld_ptr->fd_len,
358 (int)fld_ptr->fd_keyfile,
359 (int)fld_ptr->fd_keyno,
360 (int)fld_ptr->fd_ptr,
361 (int)fld_ptr->fd_rec,
362 (int)fld_ptr->fd_flags);
363 for (j=0; j<MAXDIMS; j++)
364 if (fld_ptr->fd_dim[j])
365 printf (" %d:%d", j, (int)fld_ptr->fd_dim[j]);
372 /*----------------- SET TABLE -------------------*/
373 DB_READ(dbf, (char FAR *)&set_table[ORIGIN(st_offset)],
374 (DB_REF(Size_st)*sizeof(SET_ENTRY)));
375 for ( i = 0, set_ptr = &set_table[ORIGIN(st_offset)];
378 /* Byte swap each INT on LITTLE_ENDIAN machines */
379 NTOHS (set_ptr->st_order);
380 NTOHS (set_ptr->st_own_rt);
381 NTOHS (set_ptr->st_own_ptr);
382 NTOHS (set_ptr->st_members);
383 NTOHS (set_ptr->st_memtot);
384 NTOHS (set_ptr->st_flags);
386 if (dump_init_tables) {
388 " SET #%d: ord=%c owner=%d ownofs=%2d mem1=%d mems=%d\n",
390 (char)set_ptr->st_order,
391 (int)set_ptr->st_own_rt,
392 (int)set_ptr->st_own_ptr,
393 (int)set_ptr->st_members,
394 (int)set_ptr->st_memtot);
400 /*----------------- MEMBER TABLE -------------------*/
401 DB_READ(dbf, (char FAR *)&member_table[ORIGIN(mt_offset)],
402 (DB_REF(Size_mt)*sizeof(MEMBER_ENTRY)));
403 for ( i = 0, mem_ptr = &member_table[ORIGIN(mt_offset)];
406 /* Byte swap each INT on LITTLE_ENDIAN machines */
407 NTOHS (mem_ptr->mt_record);
408 NTOHS (mem_ptr->mt_mem_ptr);
409 NTOHS (mem_ptr->mt_sort_fld);
410 NTOHS (mem_ptr->mt_totsf);
412 if (dump_init_tables) {
414 " MEM #%d: rec=%d ofs=%d sort1=%d sorts=%d\n",
416 (int)mem_ptr->mt_record,
417 (int)mem_ptr->mt_mem_ptr,
418 (int)mem_ptr->mt_sort_fld,
419 (int)mem_ptr->mt_totsf);
426 DB_READ(dbf, (char FAR *)&sort_table[ORIGIN(srt_offset)],
427 (DB_REF(Size_srt)*sizeof(SORT_ENTRY)));
428 /* Member sort tables not used by DtSearch @@@ */
429 if (DB_REF(Size_srt)) {
430 /* Byte swap each INT on LITTLE_ENDIAN machines */
431 srt_ptr = &sort_table[ORIGIN(srt_offset)];
432 NTOHS (srt_ptr->se_fld);
433 NTOHS (srt_ptr->se_set);
436 DB_READ(dbf, (char FAR *)&key_table[ORIGIN(kt_offset)],
437 (DB_REF(Size_kt)*sizeof(KEY_ENTRY)));
438 /* Compound key tables not used by DtSearch @@@ */
439 if (DB_REF(Size_kt)) {
440 /* Byte swap each INT on LITTLE_ENDIAN machines */
441 key_ptr = &key_table[ORIGIN(kt_offset)];
442 NTOHS (key_ptr->kt_key);
443 NTOHS (key_ptr->kt_field);
444 NTOHS (key_ptr->kt_ptr);
445 NTOHS (key_ptr->kt_sort);
448 close(dbf); /* end of PASS 2 */
450 dump_init_tables = FALSE;
453 curr_db_table->key_offset = key_offset;
456 /* update file table path entries */
457 if ( DB_REF(db_path[0]) || dbfpath[0] ) {
458 for (i = 0, file_ptr = &file_table[ORIGIN(ft_offset)];
462 /* Construct the data/key file name */
463 if ( DB_REF(db_path[0]) )
464 strcpy(dbname, DB_REF(db_path));
467 if (strlen(dbname) + strlen(DB_REF(db_name)) >= FILENMLEN+4)
468 return( dberr(S_NAMELEN) );
469 strcat(dbname, DB_REF(db_name));
470 if (con_dbf(dbfile, file_ptr->ft_name, dbname,
471 get_element(dbfpath, dbt_lc)) != S_OKAY)
472 return( dberr(db_status) );
474 /* Save new name in dictionary */
475 strcpy(file_ptr->ft_name, dbfile);
478 #if DB_ENABLE | TS_ENABLE
479 /* adjust record table entries */
480 for (i = ORIGIN(rt_offset), rec_ptr = &record_table[ORIGIN(rt_offset)];
481 i < ORIGIN(rt_offset) + DB_REF(Size_rt);
484 rec_ptr->rt_file += curr_db_table->ft_offset;
485 rec_ptr->rt_fields += curr_db_table->fd_offset;
488 if ( rec_ptr->rt_flags & TIMESTAMPED ) {
497 /* adjust field table entries */
498 for (key_count = 0, i = ORIGIN(fd_offset),
499 fld_ptr = &field_table[ORIGIN(fd_offset)];
500 i < ORIGIN(fd_offset) + DB_REF(Size_fd);
503 fld_ptr->fd_rec += curr_db_table->rt_offset;
505 if ( fld_ptr->fd_key != NOKEY ) {
506 fld_ptr->fd_keyno += key_offset;
509 fld_ptr->fd_keyfile += curr_db_table->ft_offset;
510 if ( fld_ptr->fd_type == 'k' )
511 fld_ptr->fd_ptr += curr_db_table->kt_offset;
515 key_offset += key_count;
517 #if DB_ENABLE | TS_ENABLE
518 /* adjust set table entries */
519 for (i = ORIGIN(st_offset), set_ptr = &set_table[ORIGIN(st_offset)];
520 i < ORIGIN(st_offset) + DB_REF(Size_st);
523 set_ptr->st_own_rt += curr_db_table->rt_offset;
524 set_ptr->st_members += curr_db_table->mt_offset;
527 if ( set_ptr->st_flags & TIMESTAMPED ) {
538 /* adjust member table entries */
539 for (i = curr_db_table->mt_offset,
540 mem_ptr = &member_table[curr_db_table->mt_offset];
541 i < curr_db_table->mt_offset + curr_db_table->Size_mt;
543 mem_ptr->mt_record += curr_db_table->rt_offset;
544 mem_ptr->mt_sort_fld += curr_db_table->srt_offset;
547 /* adjust sort table entries */
548 for (i = curr_db_table->srt_offset,
549 srt_ptr = &sort_table[curr_db_table->srt_offset];
550 i < curr_db_table->srt_offset + curr_db_table->Size_srt;
552 srt_ptr->se_fld += curr_db_table->fd_offset;
553 srt_ptr->se_set += curr_db_table->st_offset;
556 /* adjust key table entries */
557 for (i = curr_db_table->kt_offset,
558 key_ptr = &key_table[curr_db_table->kt_offset];
559 i < curr_db_table->kt_offset + curr_db_table->Size_kt;
561 key_ptr->kt_key += curr_db_table->fd_offset;
562 key_ptr->kt_field += curr_db_table->fd_offset;
564 } /* end loop for each database */
572 /* Allocate space for dictionary
574 static int alloc_dict()
580 DB_ENTRY FAR *db_ptr;
583 /* allocate and initialize file_table */
591 if ( old_no_of_dbs == 0 ) {
601 db_ptr = &db_table[old_no_of_dbs];
602 old_size_ft = db_ptr->Size_ft + db_ptr->ft_offset + extra_file;
603 old_size_fd = db_ptr->Size_fd + db_ptr->fd_offset;
604 old_size_st = db_ptr->Size_st + db_ptr->st_offset;
605 old_size_mt = db_ptr->Size_mt + db_ptr->mt_offset;
606 old_size_srt = db_ptr->Size_srt + db_ptr->srt_offset;
607 old_size_kt = db_ptr->Size_kt + db_ptr->kt_offset;
608 old_size_rt = db_ptr->Size_rt + db_ptr->rt_offset;
612 new_size = (size_ft + extra_file) * sizeof(FILE_ENTRY);
613 old_size = old_size_ft * sizeof(FILE_ENTRY);
614 if ( ALLOC_TABLE(&db_global.File_table, new_size, old_size, "file_table")
619 /* allocate record_table */
620 new_size = size_rt * sizeof(RECORD_ENTRY);
621 old_size = old_size_rt * sizeof(RECORD_ENTRY);
622 if ( ALLOC_TABLE(&db_global.Record_table, new_size, old_size, "record_table")
627 /* allocate field_table */
628 new_size = size_fd * sizeof(FIELD_ENTRY);
629 old_size = old_size_fd * sizeof(FIELD_ENTRY);
630 if ( ALLOC_TABLE(&db_global.Field_table, new_size, old_size, "field_table")
635 /* allocate set table */
637 new_size = size_st * sizeof(SET_ENTRY);
638 old_size = old_size_st * sizeof(SET_ENTRY);
639 if ( ALLOC_TABLE(&db_global.Set_table, new_size, old_size, "set_table")
643 } else set_table = NULL;
645 /* allocate member_table */
647 new_size = size_mt * sizeof(MEMBER_ENTRY);
648 old_size = old_size_mt * sizeof(MEMBER_ENTRY);
649 if ( ALLOC_TABLE(&db_global.Member_table, new_size, old_size, "member_table")
653 } else member_table = NULL;
655 /* allocate sort_table */
657 new_size = size_srt * sizeof(SORT_ENTRY);
658 old_size = old_size_srt * sizeof(SORT_ENTRY);
659 if ( ALLOC_TABLE(&db_global.Sort_table, new_size, old_size, "sort_table")
663 } else sort_table = NULL;
665 /* allocate key_table */
667 new_size = size_kt * sizeof(KEY_ENTRY);
668 old_size = old_size_kt * sizeof(KEY_ENTRY);
669 if ( ALLOC_TABLE(&db_global.Key_table, new_size, old_size, "key_table")
673 } else key_table = NULL;
675 return( db_status = S_OKAY );
678 /* Initialize currency tables
680 static int initcurr()
682 register int dbt_lc; /* loop control */
684 RECORD_ENTRY FAR *rec_ptr;
685 SET_ENTRY FAR *set_ptr;
690 /* Initialize current record and type */
692 for (dbt_lc = no_of_dbs, curr_db_table = &db_table[old_no_of_dbs],
693 curr_rn_table = &rn_table[old_no_of_dbs];
694 --dbt_lc >= 0; ++curr_db_table, ++curr_rn_table) {
695 DB_REF(curr_dbt_rec) = NULL_DBA;
697 RN_REF(rn_dba) = NULL_DBA;
698 RN_REF(rn_type) = -1;
704 new_size = size_st * sizeof(DB_ADDR);
705 old_size = old_size_st * sizeof(DB_ADDR);
706 if ( ALLOC_TABLE(&db_global.Curr_own, new_size, old_size, "curr_own")
710 if ( ALLOC_TABLE(&db_global.Curr_mem, new_size, old_size, "curr_mem")
715 new_size = size_st * sizeof(ULONG);
716 old_size = old_size_st * sizeof(ULONG);
718 if ( ALLOC_TABLE(&db_global.Co_time, new_size, old_size, "co_time")
722 if ( ALLOC_TABLE(&db_global.Cm_time, new_size, old_size, "cm_time")
728 if ( ALLOC_TABLE(&db_global.Cs_time, new_size, old_size, "cs_time")
734 /* for each db make system record as curr_own of its sets */
736 for (dbt_lc = no_of_dbs, curr_db_table = &db_table[old_no_of_dbs];
737 --dbt_lc >= 0; ++curr_db_table) {
739 for (rec = ORIGIN(rt_offset),
740 rec_ptr = &record_table[ORIGIN(rt_offset)];
741 rec < ORIGIN(rt_offset) + DB_REF(Size_rt);
743 if (rec_ptr->rt_fdtot == -1) {
744 /* found system record */
745 curr_rec = ((FILEMASK & NUM2EXT(rec_ptr->rt_file, ft_offset))
747 /* make system record current of sets it owns */
748 for (i = ORIGIN(st_offset),
749 set_ptr = &set_table[ORIGIN(st_offset)],
750 co_ptr = &curr_own[ORIGIN(st_offset)];
751 i < ORIGIN(st_offset) + DB_REF(Size_st);
752 ++i, ++set_ptr, ++co_ptr) {
753 if (set_ptr->st_own_rt == rec) {
757 DB_REF(sysdba) = curr_rec;
759 DB_REF(curr_dbt_rec) = curr_rec;
774 MEM_LOCK(&db_global.Db_table);
775 curr_db_table = db_table;
776 MEM_LOCK(&db_global.Rn_table);
777 curr_rn_table = rn_table;
779 curr_rec = DB_REF(curr_dbt_rec);
781 return( db_status = S_OKAY );
783 /* vpp -nOS2 -dUNIX -nBSD -nVANILLA_BSD -nVMS -nMEMLOCK -nWINDOWS -nFAR_ALLOC -f/usr/users/master/config/nonwin inittab.c */