dbdefs.h
Go to the documentation of this file.
1 /*--------------------------------------------------------------------------------------+
2 |
3 | Supplied under applicable software license agreement.
4 |
5 | Copyright (c) 2018 Bentley Systems, Incorporated. All rights reserved.
6 |
7 +---------------------------------------------------------------------------------------*/
8 #pragma once
9 
10 #include "mstypes.h"
11 #include <Mstn\MicroStation.r.h>
12 #include "dbdefs.r.h"
13 
14 /*----------------------------------------------------------------------+
15 | |
16 | Linkage generation modes. |
17 | |
18 +----------------------------------------------------------------------*/
19 #define NOLINK -1 /* null linkage mode */
20 #define NEWLINK 0 /* new linkage generation mode */
21 #define INFOLINK 1 /* informational linkage mode */
22 #define DUPLINK 2 /* duplicate linkage mode */
23 
24 /*----------------------------------------------------------------------+
25 | |
26 | Linkage types recognized by MicroStation servers. |
27 | |
28 +----------------------------------------------------------------------*/
29 // #define INFORMIX_LINKAGE 1
30 // #define DMRS_LINKAGE 2
31 // #define XBASE_LINKAGE 4
32 /* DBASE_LINKAGE only exists for backwards compatibility, in future use XBASE_LINKAGE */
33 // #define DBASE_LINKAGE 4
34 // #define ORACLE_LINKAGE 8
35 // #define RIS_LINKAGE 16
36 // #define INGRES_LINKAGE 32
37 // #define SYBASE_LINKAGE 64
38 // #define ODBC_LINKAGE 128
39 // #define OLEDB_LINKAGE 256
40 // #define BUDBC_LINKAGE 512
41 
42 /*----------------------------------------------------------------------+
43 | |
44 | Signature words used for user data linkages. |
45 | |
46 +----------------------------------------------------------------------*/
47 // #define INFORMIX_ID 0x3948 /* Informix user data signature */
48 // #define XBASE_ID 0x1971 /* Xbase(dBASE) user data signature */
49 // #define DBASE_ID 0x1971 /* exists for backwards compatibility to Xbase */
50 // #define RIS_ID 0x71fb /* RIS user data signature */
51 // #define ORACLE_ID 0x6091 /* Oracle user data signature */
52 // #define INGRES_ID 0x3a77 /* INGRES user data signature (ING) */
53 // #define SYBASE_ID 0x4F58 /* Sybase user data signature (C.G)? */
54 // #define ODBC_ID 0x5e62 /* ODBC user data signature (ODB) */
55 // #define OLEDB_ID 0x5800 /* OLEDB user data signature */
56 // #define BUDBC_ID 0x5834 /* BUDBC user data signature */
57 //
58 // #define PRIMARY_ID 0x6091 /* ID for Oracle linkage */
59 // #define SECONDARY_ID 0xf81 /* Secondary ID link (BSI radix 50) */
60 
61 /*----------------------------------------------------------------------+
62 | |
63 | Masks for user attribute properties word. |
64 | |
65 +----------------------------------------------------------------------*/
66 #define DB_PROP_INFO 0x8000
67 #define DB_PROP_REMOTE 0x4000
68 #define DB_PROP_MODIFIED 0x2000
69 #define DB_PROP_USER 0x1000
70 #define DB_PROPERTY_MASK 0xf000
71 
72 #define USER_LINKAGE 0x1000 /* user data linkage */
73 #define INFO_LINKAGE 0x8000 /* informational linkage */
74 
75 /*----------------------------------------------------------------------+
76 | |
77 | Miscellaneous constants - some of these are related to the |
78 | size of mscatalog columns. They should be kept in synch. |
79 | |
80 +----------------------------------------------------------------------*/
81 // #define MAX_SCREEN_FORM 64
82 // #define MAX_FORM_TABLE 64
83 // #define MAX_FORM_TYPE 64
84 // #define MAX_REPORT_TABLE 64
85 // #define MAX_SQL_REVIEW 2048
86 // #define MAX_FENCE_FILTER 2048
87 // #define MAX_DAS_TABLE 32
88 // #define MAX_FORM_TYPE 64
89 
90 /*----------------------------------------------------------------------+
91 | |
92 | Form Types. |
93 | |
94 +----------------------------------------------------------------------*/
95 #define FORM_TYPE_REVIEW 1
96 #define FORM_TYPE_EDIT 2
97 
98 /*----------------------------------------------------------------------+
99 | |
100 | Miscellaneous masks. |
101 | |
102 +----------------------------------------------------------------------*/
103 #define NULL_MASK 0x8000 /* null/not null in type descriptor */
104 #define TYPE_MASK 0x7fff /* mask type off type descriptor */
105 
106 /*----------------------------------------------------------------------+
107 | |
108 | MicroStation message resource defines. |
109 | |
110 +----------------------------------------------------------------------*/
111 //MsgList_MESSAGES
112 #define SERVER_INIT 353 /* database server initialized */
113 #define DBLOAD 354 /* loading and initializing database */
114 #define SELECT_SOURCE_LINK 601 /* select element to provide linkage */
115 
116 //MsgList_ERRORS
117 #define DBSERVER_NOT_ACTIVE 143 /* server not active */
118 #define SERVER_INIT_ERROR 157 /* unable to initialize server */
119 #define MSG_SEND_ERROR 158 /* unable to send database request */
120 #define MSG_RCV_ERROR 159 /* unable to receive database response */
121 #define SERVER_STARTUP_ERROR 160 /* unable to startup database server */
122 #define DB_NOT_CONFIGURED 161 /* not configured with the database. */
123 #define MAX_ADATA 162 /* maximum user data size exceeded */
124 #define DB_NO_DATYPE 200 /* no display attribute type specified */
125 #define SERVER_DIED 254 /* database server died */
126 
127 /*----------------------------------------------------------------------+
128 | |
129 | Server state change types |
130 | |
131 +----------------------------------------------------------------------*/
132 
133 #define SERVER_STATE_LINKTYPE_DEFINED 1 /* MS_LINKTYPES was (re)defined */
134 #define SERVER_STATE_UNLOADED 2 /* server.ma was unloaded */
135 #define SERVER_STATE_PACKED_DATA 3 /* database server is returning packed data */
136 #define SERVER_STATE_SQLDA_DATA 4 /* database server is returning SQLDA structure */
137 
138 /*----------------------------------------------------------------------+
139 | |
140 | Column data types. |
141 | |
142 +----------------------------------------------------------------------*/
143 // #define DB_CHAR 1
144 // #define DB_NUMBER 2
145 // #define DB_REAL 2
146 // #define DB_DATE 3
147 // #define DB_INTEGER 4
148 // #define DB_RAW 5
149 // #define DB_BINARY 6
150 // #define DB_OBJECT 7
151 // #define DB_ARRAY 8
152 // #define DB_ROWID 9
153 // #define DB_UNDEFINED 99
154 
155 /*----------------------------------------------------------------------+
156 | |
157 | Defines for mdlDB_fetchRow (). |
158 | |
159 +----------------------------------------------------------------------*/
160 #define QUERY_NOT_FINISHED 0 /* current query is not finished */
161 #define QUERY_FINISHED 1 /* currey query has finished */
162 
163 /*----------------------------------------------------------------------+
164 | |
165 | Cursor typedef |
166 | |
167 +----------------------------------------------------------------------*/
168 typedef long CursorID;
169 
170 /*----------------------------------------------------------------------+
171 | |
172 | Structure typedefs. |
173 | |
174 +----------------------------------------------------------------------*/
175 struct User_Link
176  {
177 #if defined (BITFIELDS_REVERSED)
178  unsigned short info:1; /* boolean: informational linkage */
179  unsigned short remote:1; /* boolean: remote linkage */
180  unsigned short modified:1; /* boolean: user linkage has been modified */
181  unsigned short user:1; /* boolean: user data linkage */
182  unsigned short linkageClass:4; /* linkage family class */
183  unsigned short words:8; /* words to follow in linkage */
184 #else
185  unsigned short words:8; /* words to follow in linkage */
186  unsigned short linkageClass:4; /* linkage family class */
187  unsigned short user:1; /* boolean: user data linkage */
188  unsigned short modified:1; /* boolean: user linkage has been modified */
189  unsigned short remote:1; /* boolean: remote linkage */
190  unsigned short info:1; /* boolean: informational linkage */
191 #endif
192  UShort id; /* User ID number */
193  };
194 
195 struct LinkProps
196  {
197  UShort information; /* informational linkage */
198  UShort remote; /* remote linkage */
199  UShort modified; /* user linkage has been modified */
200  UShort user; /* user data linkage */
201  UShort linkageClass; /* linkage family class */
202  };
203 
205  {
206  UShort linkSize; /* total size (bytes) of linkage */
207  UShort linkType; /* type (ORACLE, DMRS, XBASE...) */
208  UShort entity; /* entity number */
209  WChar tablename[64]; /* database table */
210  UInt32 mslink; /* MSLINK key of linkage */
211  LinkProps props; /* properties */
212  UShort dasType; /* displayable attributes */
213  };
214 
216  {
217  WChar name[MAX_COLUMN_LENGTH]; /* column name */
218  short type; /* column type */
219  short length; /* column length */
220  short scale; /* numeric scale */
221  short prec; /* numeric precision */
222  short null; /* nulls permitted */
223  };
224 
225 struct LinkInfo
226  {
232  int elemType;
233  };
234 
235 
Definition: MicroStation.r.h:171
Definition: dbdefs.h:215
UShort user
Definition: dbdefs.h:200
wchar_t WChar
Definition: Bentley.h:223
UShort linkageClass
Definition: dbdefs.h:201
UShort information
Definition: dbdefs.h:197
UInt32 filePos
Definition: dbdefs.h:230
UShort modified
Definition: dbdefs.h:199
UInt32 information
Definition: dbdefs.h:231
WChar name[MAX_COLUMN_LENGTH]
Definition: dbdefs.h:217
uint32_t UInt32
Definition: Bentley.r.h:128
short length
Definition: dbdefs.h:219
short null
Definition: dbdefs.h:222
DgnModelRefP modelRef
Definition: dbdefs.h:229
short type
Definition: dbdefs.h:218
unsigned short UShort
Definition: Bentley.r.h:133
Definition: dbdefs.h:195
Definition: dbdefs.h:225
long CursorID
Definition: dbdefs.h:168
short scale
Definition: dbdefs.h:220
UShort remote
Definition: dbdefs.h:198
int elemType
Definition: dbdefs.h:232
struct DgnPlatform::DgnModelRef * DgnModelRefP
Definition: DgnPlatform.h:223
UShort entity
Definition: dbdefs.h:227
short prec
Definition: dbdefs.h:221
UInt32 mslink
Definition: dbdefs.h:228

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.