1 | /**
|
---|
2 | * This file has no copyright assigned and is placed in the Public Domain.
|
---|
3 | * This file is part of the mingw-w64 runtime package.
|
---|
4 | * No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
---|
5 | */
|
---|
6 | #ifndef __SQLTYPES
|
---|
7 | #define __SQLTYPES
|
---|
8 |
|
---|
9 | #ifndef ODBCVER
|
---|
10 | #define ODBCVER 0x0351
|
---|
11 | #endif
|
---|
12 |
|
---|
13 | #ifdef __cplusplus
|
---|
14 | extern "C" {
|
---|
15 | #endif
|
---|
16 |
|
---|
17 | #ifndef EXPORT
|
---|
18 | #define EXPORT
|
---|
19 | #endif
|
---|
20 |
|
---|
21 | #if defined(_ARM_)
|
---|
22 | #define SQL_API
|
---|
23 | #else
|
---|
24 | #define SQL_API __stdcall
|
---|
25 | #endif
|
---|
26 |
|
---|
27 | #ifndef RC_INVOKED
|
---|
28 |
|
---|
29 | typedef unsigned char SQLCHAR;
|
---|
30 | #if (ODBCVER >= 0x0300)
|
---|
31 | typedef signed char SQLSCHAR;
|
---|
32 | typedef unsigned char SQLDATE;
|
---|
33 | typedef unsigned char SQLDECIMAL;
|
---|
34 | typedef double SQLDOUBLE;
|
---|
35 | typedef double SQLFLOAT;
|
---|
36 | #endif
|
---|
37 | typedef __LONG32 SQLINTEGER;
|
---|
38 | typedef unsigned __LONG32 SQLUINTEGER;
|
---|
39 |
|
---|
40 | #ifdef _WIN64
|
---|
41 | typedef INT64 SQLLEN;
|
---|
42 | typedef UINT64 SQLULEN;
|
---|
43 | typedef UINT64 SQLSETPOSIROW;
|
---|
44 | #else
|
---|
45 | #define SQLLEN SQLINTEGER
|
---|
46 | #define SQLULEN SQLUINTEGER
|
---|
47 | #define SQLSETPOSIROW SQLUSMALLINT
|
---|
48 | #endif
|
---|
49 |
|
---|
50 | typedef SQLULEN SQLROWCOUNT;
|
---|
51 | typedef SQLULEN SQLROWSETSIZE;
|
---|
52 | typedef SQLULEN SQLTRANSID;
|
---|
53 | typedef SQLLEN SQLROWOFFSET;
|
---|
54 |
|
---|
55 | #if (ODBCVER >= 0x0300)
|
---|
56 | typedef unsigned char SQLNUMERIC;
|
---|
57 | #endif
|
---|
58 | typedef void *SQLPOINTER;
|
---|
59 | #if (ODBCVER >= 0x0300)
|
---|
60 | typedef float SQLREAL;
|
---|
61 | #endif
|
---|
62 | typedef short SQLSMALLINT;
|
---|
63 | typedef unsigned short SQLUSMALLINT;
|
---|
64 | #if (ODBCVER >= 0x0300)
|
---|
65 | typedef unsigned char SQLTIME;
|
---|
66 | typedef unsigned char SQLTIMESTAMP;
|
---|
67 | typedef unsigned char SQLVARCHAR;
|
---|
68 | #endif
|
---|
69 |
|
---|
70 | typedef SQLSMALLINT SQLRETURN;
|
---|
71 |
|
---|
72 | #if (ODBCVER >= 0x0300)
|
---|
73 | typedef void *SQLHANDLE;
|
---|
74 | typedef SQLHANDLE SQLHENV;
|
---|
75 | typedef SQLHANDLE SQLHDBC;
|
---|
76 | typedef SQLHANDLE SQLHSTMT;
|
---|
77 | typedef SQLHANDLE SQLHDESC;
|
---|
78 | #else
|
---|
79 | typedef void *SQLHENV;
|
---|
80 | typedef void *SQLHDBC;
|
---|
81 | typedef void *SQLHSTMT;
|
---|
82 | #endif
|
---|
83 |
|
---|
84 | #ifndef BASETYPES
|
---|
85 | #define BASETYPES
|
---|
86 | typedef unsigned __LONG32 ULONG;
|
---|
87 | typedef ULONG *PULONG;
|
---|
88 | typedef unsigned short USHORT;
|
---|
89 | typedef USHORT *PUSHORT;
|
---|
90 | typedef unsigned char UCHAR;
|
---|
91 | typedef UCHAR *PUCHAR;
|
---|
92 | typedef char *PSZ;
|
---|
93 | #endif
|
---|
94 |
|
---|
95 | typedef signed char SCHAR;
|
---|
96 | #if (ODBCVER < 0x0300)
|
---|
97 | typedef SCHAR SQLSCHAR;
|
---|
98 | #endif
|
---|
99 | typedef __LONG32 SDWORD;
|
---|
100 | typedef short int SWORD;
|
---|
101 | typedef unsigned __LONG32 UDWORD;
|
---|
102 | typedef unsigned short int UWORD;
|
---|
103 |
|
---|
104 | typedef signed __LONG32 SLONG;
|
---|
105 | typedef signed short SSHORT;
|
---|
106 | typedef double SDOUBLE;
|
---|
107 | typedef double LDOUBLE;
|
---|
108 | typedef float SFLOAT;
|
---|
109 | typedef void *PTR;
|
---|
110 | typedef void *HENV;
|
---|
111 | typedef void *HDBC;
|
---|
112 | typedef void *HSTMT;
|
---|
113 | typedef signed short RETCODE;
|
---|
114 | typedef HWND SQLHWND;
|
---|
115 |
|
---|
116 | #ifndef __SQLDATE
|
---|
117 | #define __SQLDATE
|
---|
118 |
|
---|
119 | typedef struct tagDATE_STRUCT {
|
---|
120 | SQLSMALLINT year;
|
---|
121 | SQLUSMALLINT month;
|
---|
122 | SQLUSMALLINT day;
|
---|
123 | } DATE_STRUCT;
|
---|
124 |
|
---|
125 | #if (ODBCVER >= 0x0300)
|
---|
126 | typedef DATE_STRUCT SQL_DATE_STRUCT;
|
---|
127 | #endif
|
---|
128 |
|
---|
129 | typedef struct tagTIME_STRUCT {
|
---|
130 | SQLUSMALLINT hour;
|
---|
131 | SQLUSMALLINT minute;
|
---|
132 | SQLUSMALLINT second;
|
---|
133 | } TIME_STRUCT;
|
---|
134 |
|
---|
135 | #if (ODBCVER >= 0x0300)
|
---|
136 | typedef TIME_STRUCT SQL_TIME_STRUCT;
|
---|
137 | #endif
|
---|
138 |
|
---|
139 | typedef struct tagTIMESTAMP_STRUCT {
|
---|
140 | SQLSMALLINT year;
|
---|
141 | SQLUSMALLINT month;
|
---|
142 | SQLUSMALLINT day;
|
---|
143 | SQLUSMALLINT hour;
|
---|
144 | SQLUSMALLINT minute;
|
---|
145 | SQLUSMALLINT second;
|
---|
146 | SQLUINTEGER fraction;
|
---|
147 | } TIMESTAMP_STRUCT;
|
---|
148 |
|
---|
149 | #if (ODBCVER >= 0x0300)
|
---|
150 | typedef TIMESTAMP_STRUCT SQL_TIMESTAMP_STRUCT;
|
---|
151 | #endif
|
---|
152 |
|
---|
153 | #if (ODBCVER >= 0x0300)
|
---|
154 | typedef enum {
|
---|
155 | SQL_IS_YEAR = 1,SQL_IS_MONTH = 2,SQL_IS_DAY = 3,SQL_IS_HOUR = 4,SQL_IS_MINUTE = 5,SQL_IS_SECOND = 6,SQL_IS_YEAR_TO_MONTH = 7,
|
---|
156 | SQL_IS_DAY_TO_HOUR = 8,SQL_IS_DAY_TO_MINUTE = 9,SQL_IS_DAY_TO_SECOND = 10,SQL_IS_HOUR_TO_MINUTE = 11,SQL_IS_HOUR_TO_SECOND = 12,
|
---|
157 | SQL_IS_MINUTE_TO_SECOND = 13
|
---|
158 | } SQLINTERVAL;
|
---|
159 | #endif
|
---|
160 |
|
---|
161 | #if (ODBCVER >= 0x0300)
|
---|
162 | typedef struct tagSQL_YEAR_MONTH {
|
---|
163 | SQLUINTEGER year;
|
---|
164 | SQLUINTEGER month;
|
---|
165 | } SQL_YEAR_MONTH_STRUCT;
|
---|
166 |
|
---|
167 | typedef struct tagSQL_DAY_SECOND {
|
---|
168 | SQLUINTEGER day;
|
---|
169 | SQLUINTEGER hour;
|
---|
170 | SQLUINTEGER minute;
|
---|
171 | SQLUINTEGER second;
|
---|
172 | SQLUINTEGER fraction;
|
---|
173 | } SQL_DAY_SECOND_STRUCT;
|
---|
174 |
|
---|
175 | typedef struct tagSQL_INTERVAL_STRUCT {
|
---|
176 | SQLINTERVAL interval_type;
|
---|
177 | SQLSMALLINT interval_sign;
|
---|
178 | union {
|
---|
179 | SQL_YEAR_MONTH_STRUCT year_month;
|
---|
180 | SQL_DAY_SECOND_STRUCT day_second;
|
---|
181 | } intval;
|
---|
182 | } SQL_INTERVAL_STRUCT;
|
---|
183 | #endif
|
---|
184 | #endif
|
---|
185 |
|
---|
186 | #if (ODBCVER >= 0x0300)
|
---|
187 | #define ODBCINT64 /* __MINGW_EXTENSION */ __int64
|
---|
188 | __MINGW_EXTENSION typedef ODBCINT64 SQLBIGINT;
|
---|
189 | __MINGW_EXTENSION typedef unsigned ODBCINT64 SQLUBIGINT;
|
---|
190 | #endif
|
---|
191 |
|
---|
192 | #if (ODBCVER >= 0x0300)
|
---|
193 | #define SQL_MAX_NUMERIC_LEN 16
|
---|
194 | typedef struct tagSQL_NUMERIC_STRUCT {
|
---|
195 | SQLCHAR precision;
|
---|
196 | SQLSCHAR scale;
|
---|
197 | SQLCHAR sign;
|
---|
198 | SQLCHAR val[SQL_MAX_NUMERIC_LEN];
|
---|
199 | } SQL_NUMERIC_STRUCT;
|
---|
200 | #endif
|
---|
201 |
|
---|
202 | #if (ODBCVER >= 0x0350)
|
---|
203 | #ifdef GUID_DEFINED
|
---|
204 | typedef GUID SQLGUID;
|
---|
205 | #else
|
---|
206 |
|
---|
207 | typedef struct tagSQLGUID {
|
---|
208 | DWORD Data1;
|
---|
209 | WORD Data2;
|
---|
210 | WORD Data3;
|
---|
211 | BYTE Data4[8 ];
|
---|
212 | } SQLGUID;
|
---|
213 | #endif
|
---|
214 | #endif
|
---|
215 |
|
---|
216 | typedef SQLULEN BOOKMARK;
|
---|
217 |
|
---|
218 | #ifdef _WCHAR_T_DEFINED
|
---|
219 | typedef wchar_t SQLWCHAR;
|
---|
220 | #else
|
---|
221 | typedef unsigned short SQLWCHAR;
|
---|
222 | #endif
|
---|
223 |
|
---|
224 | #if defined(UNICODE)
|
---|
225 | typedef SQLWCHAR SQLTCHAR;
|
---|
226 | #else
|
---|
227 | typedef SQLCHAR SQLTCHAR;
|
---|
228 | #endif
|
---|
229 | #endif
|
---|
230 |
|
---|
231 | #ifdef __cplusplus
|
---|
232 | }
|
---|
233 | #endif
|
---|
234 | #endif
|
---|