Add GNU LGPL headers to all .c .C and .h files
[oweals/cde.git] / cde / lib / DtSearch / raima / cotype.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: cotype.c /main/2 1996/05/09 03:57:15 drk $ */
24 /*
25  *   COMPONENT_NAME: austext
26  *
27  *   FUNCTIONS: d_cotype
28  *
29  *   ORIGINS: 157
30  *
31  *   OBJECT CODE ONLY SOURCE MATERIALS
32  */
33 /*-----------------------------------------------------------------------
34    cotype.c -- db_VISTA owner type 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 */
45
46 #include <stdio.h>
47 #include "vista.h"
48 #include "dbtype.h"
49
50
51 /* Get current owner type
52 */
53 d_cotype(set, cotype TASK_PARM DBN_PARM)
54 int set;
55 int FAR *cotype;
56 TASK_DECL
57 DBN_DECL
58 {
59    char FAR *orec;
60    INT crt;
61 #ifndef SINGLE_USER
62    int dbopen_sv;
63 #endif
64    SET_ENTRY FAR *set_ptr;
65
66    DB_ENTER(DB_ID TASK_ID LOCK_SET(SET_IO));
67
68    if (nset_check(set, &set, (SET_ENTRY FAR * FAR *)&set_ptr) != S_OKAY)
69       RETURN( db_status );
70
71    if ( ! curr_own[set] )
72       RETURN( dberr( S_NOCO ) );
73
74    /* set up to allow unlocked read */
75 #ifndef SINGLE_USER
76    dbopen_sv = dbopen;
77    dbopen = 2;
78 #endif
79
80    /* Read current owner */
81    dio_read(curr_own[set], (char FAR * FAR *)&orec, NOPGHOLD);
82 #ifndef SINGLE_USER
83    dbopen = dbopen_sv;
84 #endif
85    if (db_status != S_OKAY)
86       RETURN( db_status );
87
88    /* Fetch record type from record header */
89    bytecpy(&crt, orec, sizeof(INT));
90    crt &= ~RLBMASK; /* mask off rlb */
91    *cotype = (int)crt + RECMARK;
92
93    RETURN( db_status );
94 }
95 /* vpp -nOS2 -dUNIX -nBSD -nVANILLA_BSD -nVMS -nMEMLOCK -nWINDOWS -nFAR_ALLOC -f/usr/users/master/config/nonwin cotype.c */