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 libraries 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
100 register int dbt_lc; /* loop control */
102 int key_offset = 0, key_count;
103 char dbfile[DtSrFILENMLEN], dbd_ver[DBD_COMPAT_LEN + 1];
104 char dbname[FILENMLEN]; /* Temporary working space */
106 FILE_ENTRY FAR *file_ptr;
107 FIELD_ENTRY FAR *fld_ptr;
118 #if DB_ENABLE | TS_ENABLE
119 RECORD_ENTRY FAR *rec_ptr;
120 SET_ENTRY FAR *set_ptr;
123 MEMBER_ENTRY FAR *mem_ptr;
124 SORT_ENTRY FAR *srt_ptr;
125 KEY_ENTRY FAR *key_ptr;
129 db_tsrecs = db_tssets = FALSE;
131 size_ft = size_rt = size_st = size_mt = size_srt = size_fd = size_kt = 0;
133 /* compute individual dictionary sizes and offsets */
135 for (dbt_lc = 0, curr_db_table = &db_table[old_no_of_dbs];
136 dbt_lc < no_of_dbs; ++dbt_lc, ++curr_db_table) {
139 /* form database dictionary name */
140 if ( DB_REF(db_path[0]) )
141 strcpy(dbname, DB_REF(db_path));
146 if (debugging_inittab) {
147 printf (__FILE__"100 inittab: path='%s' dbname='%s'\n",
148 dbname, DB_REF(db_name));
152 if (strlen(dbname) + strlen(DB_REF(db_name)) >= FILENMLEN+4)
153 return( dberr(S_NAMELEN) );
154 strcat(dbname, DB_REF(db_name));
155 if (con_dbd(dbfile, dbname, get_element(dbdpath, dbt_lc)) != S_OKAY)
156 return( dberr(db_status) );
158 /*----------------- PASS 1 -------------------
159 * In this first pass, only opening to determine
160 * required table sizes, so opening read-only is ok.
162 if ( (dbf = open_b(dbfile, O_RDONLY)) < 0 )
163 return( dberr( S_INVDB ) );
165 /* Read in and verify the dictionary version */
166 DB_READ(dbf, dbd_ver, DBD_COMPAT_LEN);
167 dbd_ver[DBD_COMPAT_LEN] = '\0';
168 for ( i=0; i<size_compat; i++ ) {
169 if ( strcmp( dbd_ver, compat_dbd[i] ) == 0 ) goto goodver;
172 /* Incompatible dictionary file */
174 return( dberr( S_INCOMPAT ) );
177 /* Read in database page size */
178 DB_READ(dbf, (char FAR *)&DB_REF(Page_size), sizeof(INT));
179 NTOHS (DB_REF(Page_size));
181 /* Read in table sizes */
182 DB_READ(dbf, (char FAR *)&DB_REF(Size_ft), sizeof(INT));
183 NTOHS (DB_REF(Size_ft));
184 DB_READ(dbf, (char FAR *)&DB_REF(Size_rt), sizeof(INT));
185 NTOHS (DB_REF(Size_rt));
186 DB_READ(dbf, (char FAR *)&DB_REF(Size_fd), sizeof(INT));
187 NTOHS (DB_REF(Size_fd));
188 DB_READ(dbf, (char FAR *)&DB_REF(Size_st), sizeof(INT));
189 NTOHS (DB_REF(Size_st));
190 DB_READ(dbf, (char FAR *)&DB_REF(Size_mt), sizeof(INT));
191 NTOHS (DB_REF(Size_mt));
192 DB_READ(dbf, (char FAR *)&DB_REF(Size_srt), sizeof(INT));
193 NTOHS (DB_REF(Size_srt));
194 DB_READ(dbf, (char FAR *)&DB_REF(Size_kt), sizeof(INT));
195 NTOHS (DB_REF(Size_kt));
196 close(dbf); /* end of PASS 1 */
199 if (debugging_inittab) {
200 printf (__FILE__"152 sizes: pg=%d ft=%d rt=%d fd=%d\n"
201 " st=%d mt=%d srt=%d kt=%d\n",
202 (int) DB_REF(Page_size),
203 (int) DB_REF(Size_ft),
204 (int) DB_REF(Size_rt),
205 (int) DB_REF(Size_fd),
206 (int) DB_REF(Size_st),
207 (int) DB_REF(Size_mt),
208 (int) DB_REF(Size_srt),
209 (int) DB_REF(Size_kt)
215 DB_REF(sysdba) = NULL_DBA;
218 /* update merged dictionary offsets and sizes */
219 if ( curr_db_table->Page_size > page_size ) {
220 page_size = curr_db_table->Page_size;
222 if (debugging_inittab) {
223 printf (__FILE__"191 db's page_size-->%d (largest = %d)\n",
224 (int)page_size, (int)largest_page);
230 curr_db_table->ft_offset = size_ft;
231 size_ft += curr_db_table->Size_ft;
232 curr_db_table->rt_offset = size_rt;
233 size_rt += curr_db_table->Size_rt;
234 curr_db_table->fd_offset = size_fd;
235 size_fd += curr_db_table->Size_fd;
236 curr_db_table->st_offset = size_st;
237 size_st += curr_db_table->Size_st;
238 curr_db_table->mt_offset = size_mt;
239 size_mt += curr_db_table->Size_mt;
240 curr_db_table->srt_offset = size_srt;
241 size_srt += curr_db_table->Size_srt;
242 curr_db_table->kt_offset = size_kt;
243 size_kt += curr_db_table->Size_kt;
246 /* allocate dictionary space */
247 if ( alloc_dict() != S_OKAY ) return( db_status );
249 /* read in and adjust dictionary entries for each database */
251 for (dbt_lc = 0, curr_db_table = &db_table[old_no_of_dbs];
253 ++dbt_lc, ++curr_db_table) {
256 /* form database dictionary name */
257 if ( DB_REF(db_path[0]) )
258 strcpy(dbname, DB_REF(db_path));
261 if (strlen(dbname) + strlen(DB_REF(db_name)) >= FILENMLEN+4)
262 return( dberr(S_NAMELEN) );
263 strcat(dbname,DB_REF(db_name));
264 if (con_dbd(dbfile,dbname,get_element(dbdpath, dbt_lc)) != S_OKAY)
265 return( dberr(db_status) );
267 if (dump_init_tables) {
268 printf (__FILE__"247 Tables for database '%s':\n", dbfile);
273 /*----------------- PASS 2 -------------------
274 * Second pass just loads allocated tables,
275 * so opening .dbd file read-only is still ok.
277 dbf = open_b (dbfile, O_RDONLY);
278 DB_LSEEK(dbf, (off_t)(DBD_COMPAT_LEN + 8L*sizeof(INT)), 0);
280 /*----------------- FILE TABLE -------------------*/
281 DB_READ(dbf, (char FAR *)&file_table[ORIGIN(ft_offset)],
282 (DB_REF(Size_ft)*sizeof(FILE_ENTRY)));
283 /* Invalid if sizeof(xxxx_ENTRY) diff on each machine */
284 for ( i = 0, file_ptr = &file_table[ORIGIN(ft_offset)];
287 /* Byte swap each INT on LITTLE_ENDIAN machines */
288 NTOHS (file_ptr->ft_slots);
289 NTOHS (file_ptr->ft_slsize);
290 NTOHS (file_ptr->ft_pgsize);
291 NTOHS (file_ptr->ft_flags);
293 if (dump_init_tables) {
294 printf (" FILE#%d: ty=%c slts=%2d slsz=%3d pgsz=%d '%s'\n",
297 (int)file_ptr->ft_slots,
298 (int)file_ptr->ft_slsize,
299 (int)file_ptr->ft_pgsize,
306 /*----------------- RECORD TABLE -------------------*/
307 DB_READ(dbf, (char FAR *)&record_table[ORIGIN(rt_offset)],
308 (DB_REF(Size_rt)*sizeof(RECORD_ENTRY)));
309 for ( i = 0, rec_ptr = &record_table[ORIGIN(rt_offset)];
312 /* Byte swap each INT on LITTLE_ENDIAN machines */
313 NTOHS (rec_ptr->rt_file);
314 NTOHS (rec_ptr->rt_len);
315 NTOHS (rec_ptr->rt_data);
316 NTOHS (rec_ptr->rt_fields);
317 NTOHS (rec_ptr->rt_fdtot);
318 NTOHS (rec_ptr->rt_flags);
320 if (dump_init_tables) {
322 " REC #%d: fil=%d len=%3d data=%2d fld1=%2d flds=%2d\n",
324 (int)rec_ptr->rt_file,
325 (int)rec_ptr->rt_len,
326 (int)rec_ptr->rt_data,
327 (int)rec_ptr->rt_fields,
328 (int)rec_ptr->rt_fdtot);
334 /*----------------- FIELD TABLE -------------------*/
335 DB_READ(dbf, (char FAR *)&field_table[ORIGIN(fd_offset)],
336 (DB_REF(Size_fd)*sizeof(FIELD_ENTRY)));
337 for ( i = 0, fld_ptr = &field_table[ORIGIN(fd_offset)];
340 /* Byte swap each INT on LITTLE_ENDIAN machines */
341 NTOHS (fld_ptr->fd_len);
342 NTOHS (fld_ptr->fd_keyfile);
343 NTOHS (fld_ptr->fd_keyno);
344 NTOHS (fld_ptr->fd_ptr);
345 NTOHS (fld_ptr->fd_rec);
346 NTOHS (fld_ptr->fd_flags);
347 for (j=0; j<MAXDIMS; j++)
348 NTOHS (fld_ptr->fd_dim[j]);
350 if (dump_init_tables) {
352 puts (" key typ len kfil key# ofs rec# flg dims");
354 " FLD#%2d %c %c %3d %d %d %3d %d %x",
358 (int)fld_ptr->fd_len,
359 (int)fld_ptr->fd_keyfile,
360 (int)fld_ptr->fd_keyno,
361 (int)fld_ptr->fd_ptr,
362 (int)fld_ptr->fd_rec,
363 (int)fld_ptr->fd_flags);
364 for (j=0; j<MAXDIMS; j++)
365 if (fld_ptr->fd_dim[j])
366 printf (" %d:%d", j, (int)fld_ptr->fd_dim[j]);
373 /*----------------- SET TABLE -------------------*/
374 DB_READ(dbf, (char FAR *)&set_table[ORIGIN(st_offset)],
375 (DB_REF(Size_st)*sizeof(SET_ENTRY)));
376 for ( i = 0, set_ptr = &set_table[ORIGIN(st_offset)];
379 /* Byte swap each INT on LITTLE_ENDIAN machines */
380 NTOHS (set_ptr->st_order);
381 NTOHS (set_ptr->st_own_rt);
382 NTOHS (set_ptr->st_own_ptr);
383 NTOHS (set_ptr->st_members);
384 NTOHS (set_ptr->st_memtot);
385 NTOHS (set_ptr->st_flags);
387 if (dump_init_tables) {
389 " SET #%d: ord=%c owner=%d ownofs=%2d mem1=%d mems=%d\n",
391 (char)set_ptr->st_order,
392 (int)set_ptr->st_own_rt,
393 (int)set_ptr->st_own_ptr,
394 (int)set_ptr->st_members,
395 (int)set_ptr->st_memtot);
401 /*----------------- MEMBER TABLE -------------------*/
402 DB_READ(dbf, (char FAR *)&member_table[ORIGIN(mt_offset)],
403 (DB_REF(Size_mt)*sizeof(MEMBER_ENTRY)));
404 for ( i = 0, mem_ptr = &member_table[ORIGIN(mt_offset)];
407 /* Byte swap each INT on LITTLE_ENDIAN machines */
408 NTOHS (mem_ptr->mt_record);
409 NTOHS (mem_ptr->mt_mem_ptr);
410 NTOHS (mem_ptr->mt_sort_fld);
411 NTOHS (mem_ptr->mt_totsf);
413 if (dump_init_tables) {
415 " MEM #%d: rec=%d ofs=%d sort1=%d sorts=%d\n",
417 (int)mem_ptr->mt_record,
418 (int)mem_ptr->mt_mem_ptr,
419 (int)mem_ptr->mt_sort_fld,
420 (int)mem_ptr->mt_totsf);
427 DB_READ(dbf, (char FAR *)&sort_table[ORIGIN(srt_offset)],
428 (DB_REF(Size_srt)*sizeof(SORT_ENTRY)));
429 /* Member sort tables not used by DtSearch @@@ */
430 if (DB_REF(Size_srt)) {
431 /* Byte swap each INT on LITTLE_ENDIAN machines */
432 srt_ptr = &sort_table[ORIGIN(srt_offset)];
433 NTOHS (srt_ptr->se_fld);
434 NTOHS (srt_ptr->se_set);
437 DB_READ(dbf, (char FAR *)&key_table[ORIGIN(kt_offset)],
438 (DB_REF(Size_kt)*sizeof(KEY_ENTRY)));
439 /* Compound key tables not used by DtSearch @@@ */
440 if (DB_REF(Size_kt)) {
441 /* Byte swap each INT on LITTLE_ENDIAN machines */
442 key_ptr = &key_table[ORIGIN(kt_offset)];
443 NTOHS (key_ptr->kt_key);
444 NTOHS (key_ptr->kt_field);
445 NTOHS (key_ptr->kt_ptr);
446 NTOHS (key_ptr->kt_sort);
449 close(dbf); /* end of PASS 2 */
451 dump_init_tables = FALSE;
454 curr_db_table->key_offset = key_offset;
457 /* update file table path entries */
458 if ( DB_REF(db_path[0]) || dbfpath[0] ) {
459 for (i = 0, file_ptr = &file_table[ORIGIN(ft_offset)];
463 /* Construct the data/key file name */
464 if ( DB_REF(db_path[0]) )
465 strcpy(dbname, DB_REF(db_path));
468 if (strlen(dbname) + strlen(DB_REF(db_name)) >= FILENMLEN+4)
469 return( dberr(S_NAMELEN) );
470 strcat(dbname, DB_REF(db_name));
471 if (con_dbf(dbfile, file_ptr->ft_name, dbname,
472 get_element(dbfpath, dbt_lc)) != S_OKAY)
473 return( dberr(db_status) );
475 /* Save new name in dictionary */
476 strcpy(file_ptr->ft_name, dbfile);
479 #if DB_ENABLE | TS_ENABLE
480 /* adjust record table entries */
481 for (i = ORIGIN(rt_offset), rec_ptr = &record_table[ORIGIN(rt_offset)];
482 i < ORIGIN(rt_offset) + DB_REF(Size_rt);
485 rec_ptr->rt_file += curr_db_table->ft_offset;
486 rec_ptr->rt_fields += curr_db_table->fd_offset;
489 if ( rec_ptr->rt_flags & TIMESTAMPED ) {
498 /* adjust field table entries */
499 for (key_count = 0, i = ORIGIN(fd_offset),
500 fld_ptr = &field_table[ORIGIN(fd_offset)];
501 i < ORIGIN(fd_offset) + DB_REF(Size_fd);
504 fld_ptr->fd_rec += curr_db_table->rt_offset;
506 if ( fld_ptr->fd_key != NOKEY ) {
507 fld_ptr->fd_keyno += key_offset;
510 fld_ptr->fd_keyfile += curr_db_table->ft_offset;
511 if ( fld_ptr->fd_type == 'k' )
512 fld_ptr->fd_ptr += curr_db_table->kt_offset;
516 key_offset += key_count;
518 #if DB_ENABLE | TS_ENABLE
519 /* adjust set table entries */
520 for (i = ORIGIN(st_offset), set_ptr = &set_table[ORIGIN(st_offset)];
521 i < ORIGIN(st_offset) + DB_REF(Size_st);
524 set_ptr->st_own_rt += curr_db_table->rt_offset;
525 set_ptr->st_members += curr_db_table->mt_offset;
528 if ( set_ptr->st_flags & TIMESTAMPED ) {
539 /* adjust member table entries */
540 for (i = curr_db_table->mt_offset,
541 mem_ptr = &member_table[curr_db_table->mt_offset];
542 i < curr_db_table->mt_offset + curr_db_table->Size_mt;
544 mem_ptr->mt_record += curr_db_table->rt_offset;
545 mem_ptr->mt_sort_fld += curr_db_table->srt_offset;
548 /* adjust sort table entries */
549 for (i = curr_db_table->srt_offset,
550 srt_ptr = &sort_table[curr_db_table->srt_offset];
551 i < curr_db_table->srt_offset + curr_db_table->Size_srt;
553 srt_ptr->se_fld += curr_db_table->fd_offset;
554 srt_ptr->se_set += curr_db_table->st_offset;
557 /* adjust key table entries */
558 for (i = curr_db_table->kt_offset,
559 key_ptr = &key_table[curr_db_table->kt_offset];
560 i < curr_db_table->kt_offset + curr_db_table->Size_kt;
562 key_ptr->kt_key += curr_db_table->fd_offset;
563 key_ptr->kt_field += curr_db_table->fd_offset;
565 } /* end loop for each database */
573 /* Allocate space for dictionary
575 static int alloc_dict()
581 DB_ENTRY FAR *db_ptr;
584 /* allocate and initialize file_table */
592 if ( old_no_of_dbs == 0 ) {
602 db_ptr = &db_table[old_no_of_dbs];
603 old_size_ft = db_ptr->Size_ft + db_ptr->ft_offset + extra_file;
604 old_size_fd = db_ptr->Size_fd + db_ptr->fd_offset;
605 old_size_st = db_ptr->Size_st + db_ptr->st_offset;
606 old_size_mt = db_ptr->Size_mt + db_ptr->mt_offset;
607 old_size_srt = db_ptr->Size_srt + db_ptr->srt_offset;
608 old_size_kt = db_ptr->Size_kt + db_ptr->kt_offset;
609 old_size_rt = db_ptr->Size_rt + db_ptr->rt_offset;
613 new_size = (size_ft + extra_file) * sizeof(FILE_ENTRY);
614 old_size = old_size_ft * sizeof(FILE_ENTRY);
615 if ( ALLOC_TABLE(&db_global.File_table, new_size, old_size, "file_table")
620 /* allocate record_table */
621 new_size = size_rt * sizeof(RECORD_ENTRY);
622 old_size = old_size_rt * sizeof(RECORD_ENTRY);
623 if ( ALLOC_TABLE(&db_global.Record_table, new_size, old_size, "record_table")
628 /* allocate field_table */
629 new_size = size_fd * sizeof(FIELD_ENTRY);
630 old_size = old_size_fd * sizeof(FIELD_ENTRY);
631 if ( ALLOC_TABLE(&db_global.Field_table, new_size, old_size, "field_table")
636 /* allocate set table */
638 new_size = size_st * sizeof(SET_ENTRY);
639 old_size = old_size_st * sizeof(SET_ENTRY);
640 if ( ALLOC_TABLE(&db_global.Set_table, new_size, old_size, "set_table")
644 } else set_table = NULL;
646 /* allocate member_table */
648 new_size = size_mt * sizeof(MEMBER_ENTRY);
649 old_size = old_size_mt * sizeof(MEMBER_ENTRY);
650 if ( ALLOC_TABLE(&db_global.Member_table, new_size, old_size, "member_table")
654 } else member_table = NULL;
656 /* allocate sort_table */
658 new_size = size_srt * sizeof(SORT_ENTRY);
659 old_size = old_size_srt * sizeof(SORT_ENTRY);
660 if ( ALLOC_TABLE(&db_global.Sort_table, new_size, old_size, "sort_table")
664 } else sort_table = NULL;
666 /* allocate key_table */
668 new_size = size_kt * sizeof(KEY_ENTRY);
669 old_size = old_size_kt * sizeof(KEY_ENTRY);
670 if ( ALLOC_TABLE(&db_global.Key_table, new_size, old_size, "key_table")
674 } else key_table = NULL;
676 return( db_status = S_OKAY );
679 /* Initialize currency tables
681 static int initcurr()
683 register int dbt_lc; /* loop control */
685 RECORD_ENTRY FAR *rec_ptr;
686 SET_ENTRY FAR *set_ptr;
691 /* Initialize current record and type */
693 for (dbt_lc = no_of_dbs, curr_db_table = &db_table[old_no_of_dbs],
694 curr_rn_table = &rn_table[old_no_of_dbs];
695 --dbt_lc >= 0; ++curr_db_table, ++curr_rn_table) {
696 DB_REF(curr_dbt_rec) = NULL_DBA;
698 RN_REF(rn_dba) = NULL_DBA;
699 RN_REF(rn_type) = -1;
705 new_size = size_st * sizeof(DB_ADDR);
706 old_size = old_size_st * sizeof(DB_ADDR);
707 if ( ALLOC_TABLE(&db_global.Curr_own, new_size, old_size, "curr_own")
711 if ( ALLOC_TABLE(&db_global.Curr_mem, new_size, old_size, "curr_mem")
716 new_size = size_st * sizeof(ULONG);
717 old_size = old_size_st * sizeof(ULONG);
719 if ( ALLOC_TABLE(&db_global.Co_time, new_size, old_size, "co_time")
723 if ( ALLOC_TABLE(&db_global.Cm_time, new_size, old_size, "cm_time")
729 if ( ALLOC_TABLE(&db_global.Cs_time, new_size, old_size, "cs_time")
735 /* for each db make system record as curr_own of its sets */
737 for (dbt_lc = no_of_dbs, curr_db_table = &db_table[old_no_of_dbs];
738 --dbt_lc >= 0; ++curr_db_table) {
740 for (rec = ORIGIN(rt_offset),
741 rec_ptr = &record_table[ORIGIN(rt_offset)];
742 rec < ORIGIN(rt_offset) + DB_REF(Size_rt);
744 if (rec_ptr->rt_fdtot == -1) {
745 /* found system record */
746 curr_rec = ((FILEMASK & NUM2EXT(rec_ptr->rt_file, ft_offset))
748 /* make system record current of sets it owns */
749 for (i = ORIGIN(st_offset),
750 set_ptr = &set_table[ORIGIN(st_offset)],
751 co_ptr = &curr_own[ORIGIN(st_offset)];
752 i < ORIGIN(st_offset) + DB_REF(Size_st);
753 ++i, ++set_ptr, ++co_ptr) {
754 if (set_ptr->st_own_rt == rec) {
758 DB_REF(sysdba) = curr_rec;
760 DB_REF(curr_dbt_rec) = curr_rec;
775 MEM_LOCK(&db_global.Db_table);
776 curr_db_table = db_table;
777 MEM_LOCK(&db_global.Rn_table);
778 curr_rn_table = rn_table;
780 curr_rec = DB_REF(curr_dbt_rec);
782 return( db_status = S_OKAY );
784 /* vpp -nOS2 -dUNIX -nBSD -nVANILLA_BSD -nVMS -nMEMLOCK -nWINDOWS -nFAR_ALLOC -f/usr/users/master/config/nonwin inittab.c */