tt/mini_isam: remove all ancient sccsid blocks
[oweals/cde.git] / cde / lib / tt / mini_isam / isperm.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 libraries 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 /*%%  (c) Copyright 1993, 1994 Hewlett-Packard Company                   */
24 /*%%  (c) Copyright 1993, 1994 International Business Machines Corp.     */
25 /*%%  (c) Copyright 1993, 1994 Sun Microsystems, Inc.                    */
26 /*%%  (c) Copyright 1993, 1994 Novell, Inc.                              */
27 /*%%  $XConsortium: isperm.c /main/3 1995/10/23 11:43:03 rswiston $                                                      */
28 /*
29  * Copyright (c) 1988 by Sun Microsystems, Inc.
30  */
31
32 /*
33  * isperm.c
34  *
35  * Description:
36  *      Extract permissions from mode functions.
37  */
38
39 #include "isam_impl.h"
40
41
42 /*
43  * _getopenmode(mode)
44  *
45  * Extract open mode (ISINPUT, ISOUTPUT, ISINOUT) from mode.
46  */
47
48 enum openmode
49 _getopenmode(int mode)
50 {
51     switch (mode & ISOPENMODE) {
52     case ISINPUT:
53         return (OM_INPUT);
54     case ISOUTPUT:
55         return (OM_OUTPUT);
56     case ISINOUT:
57         return (OM_INOUT);
58     default:
59         return (OM_BADMODE);
60     }
61 }
62
63 /*
64  * _getreadmode(mode)
65  *
66  * Extract read mode from mode.
67  */
68
69 enum readmode
70 _getreadmode(int mode)
71 {
72     switch (mode & ISREADMODE) {
73     case ISFIRST:
74         return (RM_FIRST);
75     case ISLAST:
76         return (RM_LAST);
77     case ISNEXT:
78         return (RM_NEXT);
79     case ISPREV:
80         return (RM_PREV);
81     case ISCURR:
82         return (RM_CURR);
83     case ISEQUAL:
84         return (RM_EQUAL);
85     case ISGREAT:
86         return (RM_GREAT);
87     case ISGTEQ:
88         return (RM_GTEQ);
89     case ISLESS:
90         return (RM_LESS);
91     case ISLTEQ:
92         return (RM_LTEQ);
93     default:
94         return (RM_BADMODE);
95     }
96 }