Initial import of the CDE 2.1.30 sources from the Open Group.
[oweals/cde.git] / cde / lib / tt / lib / dm / dm_enums.h
1 /*%%  (c) Copyright 1993, 1994 Hewlett-Packard Company                   */
2 /*%%  (c) Copyright 1993, 1994 International Business Machines Corp.     */
3 /*%%  (c) Copyright 1993, 1994 Sun Microsystems, Inc.                    */
4 /*%%  (c) Copyright 1993, 1994 Novell, Inc.                              */
5 /*%%  $XConsortium: dm_enums.h /main/3 1995/10/23 10:11:45 rswiston $                                                    */
6 /*
7  * Tool Talk Database Manager (DM) - dm_enums.h
8  *
9  * Copyright (c) 1990 by Sun Microsystems, Inc.
10  *
11  * This file contains all the enumerations type used by the DM.
12  */
13
14 #ifndef  _TT_DM_ENUMS_H
15 #define  _TT_DM_ENUMS_H
16
17 #include "tt_const.h"
18 #include "tt_options.h"
19 #if defined(OPT_BUG_SUNOS_4) && defined(__GNUG__)
20 #       include <stdlib.h>
21 #endif
22 #include "api/c/tt_c.h"
23
24 const int VER_NO_LENGTH = 4;
25 const int INITIAL_VERSION_NO = 0;
26 const int THIS_VERSION_NO = 1;
27 const int ETHER_ADDR_LEN = 6;
28 const int DEFAULT_KEY_VERSION = 0;
29
30 #define NSE_ENV "NSE_ENV"
31 #define TT_DB_DIR "TT_DB_DIR"
32
33 enum _Tt_dm_status
34 {
35         DM_OK = TT_OK,
36         DM_ERROR = TT_STATUS_LAST+1,
37         DM_INIT_FAILED,
38         DM_DBDESC_EXISTS,
39         DM_DB_EXISTS,
40         DM_CREATE_FAILED,
41         DM_OPEN_FAILED,
42         DM_NO_RECORD,
43         DM_READ_FAILED,
44         DM_WRITE_FAILED,
45         DM_DELETE_FAILED,
46         DM_CLOSE_FAILED,
47         DM_UNKNOWN_DBTABLE,
48         DM_UNKNOWN_INDEX,
49         DM_INVALID_VERSION_NUMBER,
50         DM_PATHMAP_FAILED,
51         DM_UPDATE_MFS_INFO_FAILED,
52         DM_CLEAR_LOCKS_FAILED,
53         DM_RECORD_LOCKED,
54         DM_NO_MFS,
55         DM_UNKNOWN_FS,
56         DM_CONVERSION_ERROR,
57         DM_RECORD_SET,
58         DM_ACCESS_DENIED
59 };
60
61 /* Database table identifiers */
62
63 enum _Tt_dbtable_id
64 {
65         DM_TABLE_OID_PROP,
66         DM_TABLE_OID_ACCESS,
67         DM_TABLE_OID_CONTAINER,
68         DM_TABLE_DOCOID_PATH,
69         DM_TABLE_MSG_QUEUE,
70         DM_TABLE_LINK_ENDS,
71         DM_TABLE_LINK_PROP,
72         DM_TABLE_LINK_ACCESS,
73         DM_TABLE_LAST
74 };
75
76 /* Database table key identifiers */
77
78 enum _Tt_key_id
79 {
80         DM_KEY_UNDEFINED,       /* for records read iterator */
81         DM_KEY_NONE,
82         DM_KEY_OID_PROP,
83         DM_KEY_OID,
84         DM_KEY_DOC,
85         DM_KEY_PATH,
86         DM_KEY_MSG_PART,
87         DM_KEY_LINK_DIR,
88         DM_KEY_END,
89         DM_KEY_LINK_PROP
90 };
91
92 /* Name spaces for oids' location */
93
94 enum _Tt_name_space
95 {
96         DM_NS_NFS,
97         DM_NS_NSE,
98         DM_NS_STANDALONE,     /* standalone mode, dbs path in TT_DB_DIR env var */
99         DM_NS_REDIRECT,
100         DM_NS_LAST
101 };
102
103 /* states of a property's value */
104
105 enum _Tt_propvalue_state
106 {
107         DM_PVS_OLD,
108         DM_PVS_NEW,
109         DM_PVS_DELETE
110 };
111
112 #define DM_LINKUR  0x1
113 #define DM_LINKUW  0x2
114 #define DM_LINKGR  0x4
115 #define DM_LINKGW  0x8
116 #define DM_LINKOR  0x10
117 #define DM_LINKOW  0x20
118
119 const char * _tt_enumname(_Tt_dm_status x);
120 const char * _tt_enumname(_Tt_dbtable_id x);
121 const char * _tt_enumname(_Tt_key_id x);
122 const char * _tt_enumname(_Tt_name_space x);
123 const char * _tt_enumname(_Tt_propvalue_state x);
124
125 #endif  /* _TT_DM_ENUMS_H */