Add GNU LGPL headers to all .c .C and .h files
[oweals/cde.git] / cde / lib / DtSearch / raima / setdb.c
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
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)
10  * any later version.
11  *
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
16  * details.
17  *
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
22  */
23 /* $XConsortium: setdb.c /main/2 1996/05/09 04:16:53 drk $ */
24 /*
25  *   COMPONENT_NAME: austext
26  *
27  *   FUNCTIONS: d_setdb
28  *
29  *   ORIGINS: 157
30  *
31  *   OBJECT CODE ONLY SOURCE MATERIALS
32  */
33 /*-----------------------------------------------------------------------
34    setdb.c -- db_VISTA current database set module.
35
36    (C) Copyright 1987 by Raima Corporation.
37 -----------------------------------------------------------------------*/
38
39 /* ********************** EDIT HISTORY *******************************
40
41  SCR    DATE    INI                   DESCRIPTION
42 ----- --------- --- -----------------------------------------------------
43       04-Aug-88 RTK MULTI_TASK changes
44   419 05-Oct-88 RSC also need to set curr_rn_table
45   420 06-Dec-88 WLW Updated Curr_db_table when using setdb.
46 */
47
48 #include <stdio.h>
49 #include "vista.h"
50 #include "dbtype.h"
51
52 #ifndef  ONE_DB
53 /* Set current database
54 */
55 d_setdb(dbn TASK_PARM)
56 int dbn;   /* database number */
57 TASK_DECL
58 {
59    DB_ENTER(DB_ID TASK_ID LOCK_SET(RECORD_NOIO));
60
61 /* For WINDOWS, all that needs to happen here is the dbn_check() which
62    DB_ENTER results in */
63    if ( dbn < 0 || dbn >= no_of_dbs )
64       RETURN( dberr( S_INVDB ) );
65    
66    setdb_on = TRUE;
67    curr_db_table->curr_dbt_rec = curr_rec;
68    curr_db_table = &db_table[curr_db = dbn];
69    curr_rn_table = &rn_table[dbn];            /*[419]*/
70    curr_rec = curr_db_table->curr_dbt_rec;
71
72    RETURN( db_status = S_OKAY );
73 }
74 #endif
75 /* vpp -nOS2 -dUNIX -nBSD -nVANILLA_BSD -nVMS -nMEMLOCK -nWINDOWS -nFAR_ALLOC -f/usr/users/master/config/nonwin setdb.c */