Products Support Documentation Download
sqltypes.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Raima Database Manager *
3  * *
4  * Copyright (c) 2010 Raima Inc. All rights reserved. *
5  * *
6  * Use of this software, whether in source code format, or in executable, *
7  * binary object code form, is governed by the Raima Inc. LICENSE *
8  * which is fully described in the LICENSE.TXT file, included within this *
9  * distribution of files. *
10  **************************************************************************/
11 
16 #if !defined(SQLTYPES_H_INCLUDED_)
17 #define SQLTYPES_H_INCLUDED_
18 
19 #if !defined(ODBCVER)
20 #define ODBCVER 0x0351
21 #endif
22 
23 #include "rdmtypes.h"
24 
25 #if defined(RDM_WINDOWS) && defined(RDM_ODBC_DRV)
26 #define WIN32_LEAN_AND_MEAN
27 #include <windows.h>
28 #endif
29 
30 #if defined(RDM_WINDOWS) && !defined(_WINDOWS_)
31 typedef void *HANDLE;
32 #define DECLARE_HANDLE(name) \
33  struct name##__ \
34  { \
35  int unused; \
36  }; \
37  typedef struct name##__ *name
38 DECLARE_HANDLE (HWND);
39 DECLARE_HANDLE (HINSTANCE);
40 #define _WINDOWS_
41 #endif
42 
43 #define SQL_API EXTERNAL_FCN
44 #define SQL_API_PTR EXTERNAL_FCN_PTR
45 
46 #if !defined(BOOL)
47 #define BOOL int32_t
48 #endif /* BOOL */
49 
50 typedef signed char SCHAR;
51 typedef SCHAR SQLSCHAR;
52 typedef uint8_t SQLCHAR;
53 typedef int16_t SQLSMALLINT;
54 typedef uint16_t SQLUSMALLINT;
55 typedef int32_t SQLINTEGER;
56 typedef uint32_t SQLUINTEGER;
57 typedef double SQLDOUBLE;
58 typedef double SQLFLOAT;
59 typedef uint8_t SQLNUMERIC;
60 typedef float SQLREAL;
61 typedef uint8_t SQLTIME;
62 typedef uint8_t SQLTIMESTAMP;
63 typedef uint8_t SQLVARCHAR;
64 typedef void *SQLPOINTER;
76 typedef int16_t SQLRETURN;
77 typedef wchar_t SQLWCHAR;
78 
79 #if defined(RDM_DOXYGEN)
80 #elif defined(_UNICODE)
81 typedef SQLWCHAR SQLTCHAR;
82 #else
83 typedef SQLCHAR SQLTCHAR;
84 #endif
85 
86 #if defined(RDM_64BIT)
87 typedef int64_t SQLLEN;
88 typedef uint64_t SQLULEN;
89 typedef uint64_t SQLSETPOSIROW;
90 #else
91 #define SQLLEN SQLINTEGER
92 #define SQLULEN SQLUINTEGER
93 #define SQLSETPOSIROW SQLUSMALLINT
94 #endif
95 
96 typedef SQLULEN BOOKMARK;
97 
98 typedef const void *SQLHANDLE;
99 #if !defined(RDM_DOXYGEN)
100 typedef const void *SQLHENV;
101 typedef const void *SQLHDBC;
102 typedef const void *SQLHSTMT;
103 typedef const void *SQLHDESC;
104 
105 /* define our own HWND if windows.h is not included already */
106 #if !defined(_WINDOWS_) && !defined(UNDER_CE)
107 typedef const void *HWND;
108 #endif
109 #endif
110 
111 typedef HWND SQLHWND;
112 
113 #if 0
114 /* SQL portable types for C */
115 typedef unsigned char UCHAR;
116 typedef long int SDWORD;
117 typedef int16_t SWORD;
118 typedef unsigned long int UDWORD;
119 typedef uint16_t UWORD;
120 
121 typedef signed long SLONG;
122 typedef int16_t SSHORT;
123 typedef unsigned long ULONG;
124 typedef uint16_t USHORT;
125 typedef double SDOUBLE;
126 typedef double LDOUBLE;
127 typedef float SFLOAT;
128 
129 typedef void *PTR;
130 
131 typedef void *HENV;
132 typedef void *HDBC;
133 /*typedef void *HSTMT; */
134 #endif
135 
136 typedef int16_t RETCODE;
137 
138 /* ----------------------------------------------------------------------------
139  standard structs for working with date/time
140 */
141 #if !defined(__SQLDATE)
142 #define __SQLDATE
143 
144 typedef struct tagDATE_STRUCT
145 {
149 } DATE_STRUCT;
150 
152 
153 typedef struct tagTIME_STRUCT
154 {
158 } TIME_STRUCT;
159 
161 
162 typedef struct tagTIMESTAMP_STRUCT
163 {
172 
174 
175 typedef enum
176 {
190 } SQLINTERVAL;
191 
192 typedef struct tagSQL_YEAR_MONTH
193 {
197 
198 typedef struct tagSQL_DAY_SECOND
199 {
206 
208 {
211  union
212  {
215  } intval;
217 
218 #endif /* __SQLDATE */
219 
220 /* ----------------------------------------------------------------------------
221  internal representation of numeric data types
222 */
223 #define SQL_MAX_NUMERIC_LEN 16
224 typedef struct tagSQL_NUMERIC_STRUCT
225 {
228  SQLCHAR sign; /* 1 if positive, 0 if negative */
231 
232 /* ----------------------------------------------------------------------------
233  BIGINT definitions
234 */
235 #define ODBCINT64 int64_t
236 #define ODBCUINT64 uint64_t
239 
240 /* ----------------------------------------------------------------------------
241  GUID definition
242 */
243 #if defined(GUID)
244 typedef GUID SQLGUID
245 #else
246 typedef struct tagSQLGUID
247 {
248  uint32_t Data1;
249  uint16_t Data2;
250  uint16_t Data3;
251  uint8_t Data4[8];
252 } SQLGUID;
253 #endif /* GUID */
254 
255 /* ----------------------------------------------------------------------------
256  OBDC function-related definitions
257 */
258 #if !defined(RDM_DOXYGEN)
259 #if !defined(RDM_WINDOWS) || defined(RDM_ODBC_DRV)
260 #define RDBC_EXPORT
261 #else
262 #define RDBC_EXPORT RDM_EXPORT
263 #endif
264 #endif
265 
266 #endif /* SQLTYPES_H_INCLUDED_ */
HWND SQLHWND
Definition: sqltypes.h:111
uint8_t SQLTIME
Definition: sqltypes.h:61
#define ODBCUINT64
Definition: sqltypes.h:236
SQLUSMALLINT second
Definition: sqltypes.h:169
SQLUINTEGER hour
Definition: sqltypes.h:201
uint16_t Data3
Definition: sqltypes.h:250
int32_t SQLINTEGER
Definition: sqltypes.h:55
SQLUSMALLINT second
Definition: sqltypes.h:157
#define ODBCINT64
Definition: sqltypes.h:235
SQLUSMALLINT hour
Definition: sqltypes.h:155
Header for the native RDM Runtime types.
uint8_t SQLVARCHAR
Definition: sqltypes.h:63
struct tagSQL_DAY_SECOND SQL_DAY_SECOND_STRUCT
TIMESTAMP_STRUCT SQL_TIMESTAMP_STRUCT
Definition: sqltypes.h:173
DATE_STRUCT SQL_DATE_STRUCT
Definition: sqltypes.h:151
SQL_YEAR_MONTH_STRUCT year_month
Definition: sqltypes.h:213
int16_t RETCODE
Definition: sqltypes.h:136
uint32_t Data1
Definition: sqltypes.h:248
int64_t SQLBIGINT
Definition: sqltypes.h:237
struct tagTIMESTAMP_STRUCT TIMESTAMP_STRUCT
float SQLREAL
Definition: sqltypes.h:60
uint32_t SQLUINTEGER
Definition: sqltypes.h:56
SQLUSMALLINT day
Definition: sqltypes.h:148
SQLSMALLINT interval_sign
Definition: sqltypes.h:210
SQLSMALLINT year
Definition: sqltypes.h:164
SQLUSMALLINT month
Definition: sqltypes.h:165
SQLUINTEGER year
Definition: sqltypes.h:194
double SQLFLOAT
Definition: sqltypes.h:58
uint8_t SQLTIMESTAMP
Definition: sqltypes.h:62
wchar_t SQLWCHAR
Definition: sqltypes.h:77
SQLUINTEGER minute
Definition: sqltypes.h:202
uint16_t Data2
Definition: sqltypes.h:249
struct tagTIME_STRUCT TIME_STRUCT
SQLINTERVAL
Definition: sqltypes.h:175
SCHAR SQLSCHAR
Definition: sqltypes.h:51
SQLUINTEGER fraction
Definition: sqltypes.h:204
SQLUSMALLINT month
Definition: sqltypes.h:147
int16_t SQLRETURN
SQL API Return Codes.
Definition: sqltypes.h:76
signed char SCHAR
Definition: sqltypes.h:50
SQLINTERVAL interval_type
Definition: sqltypes.h:209
SQLUSMALLINT minute
Definition: sqltypes.h:168
uint8_t SQLCHAR
Definition: sqltypes.h:52
const void * SQLHANDLE
Definition: sqltypes.h:98
struct tagSQL_INTERVAL_STRUCT SQL_INTERVAL_STRUCT
struct tagSQL_YEAR_MONTH SQL_YEAR_MONTH_STRUCT
void * SQLPOINTER
Definition: sqltypes.h:64
struct tagSQLGUID SQLGUID
SQLUINTEGER fraction
Definition: sqltypes.h:170
uint16_t SQLUSMALLINT
Definition: sqltypes.h:54
#define SQL_MAX_NUMERIC_LEN
Definition: sqltypes.h:223
#define SQLULEN
Definition: sqltypes.h:92
struct tagDATE_STRUCT DATE_STRUCT
SQLUSMALLINT minute
Definition: sqltypes.h:156
TIME_STRUCT SQL_TIME_STRUCT
Definition: sqltypes.h:160
struct tagSQL_NUMERIC_STRUCT SQL_NUMERIC_STRUCT
SQLUSMALLINT day
Definition: sqltypes.h:166
double SQLDOUBLE
Definition: sqltypes.h:57
#define SQLSETPOSIROW
Definition: sqltypes.h:93
SQLUSMALLINT hour
Definition: sqltypes.h:167
SQLSMALLINT year
Definition: sqltypes.h:146
SQL_DAY_SECOND_STRUCT day_second
Definition: sqltypes.h:214
uint64_t SQLUBIGINT
Definition: sqltypes.h:238
#define SQLLEN
Definition: sqltypes.h:91
SQLUINTEGER BOOKMARK
Definition: sqltypes.h:96
uint8_t SQLNUMERIC
Definition: sqltypes.h:59
int16_t SQLSMALLINT
Definition: sqltypes.h:53
SQLUINTEGER day
Definition: sqltypes.h:200
SQLUINTEGER second
Definition: sqltypes.h:203
SQLUINTEGER month
Definition: sqltypes.h:195