xmllite: Use buffer offset instead of pointers.
[wine.git] / include / sqltypes.h
blob4f3f8fe9f1c839b9cd6a0d0af9fa09b77a035821
1 /*
2 * Copyright (C) 1999 Xiang Li
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #ifndef __SQLTYPES_H
20 #define __SQLTYPES_H
22 #ifndef ODBCVER
23 #define ODBCVER 0x0351
24 #endif
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
30 typedef unsigned char SQLCHAR;
31 #ifdef WINE_UNICODE_NATIVE
32 typedef wchar_t SQLWCHAR;
33 #else
34 typedef unsigned short SQLWCHAR;
35 #endif
36 #ifndef UNICODE
37 typedef SQLCHAR SQLTCHAR;
38 #else
39 typedef SQLWCHAR SQLTCHAR;
40 #endif
42 #if (ODBCVER >= 0x0300)
43 typedef unsigned char SQLDATE;
44 typedef unsigned char SQLDECIMAL;
45 typedef double SQLDOUBLE;
46 typedef double SQLFLOAT;
47 #endif
49 typedef int SQLINTEGER;
51 #if (ODBCVER >= 0x0300)
52 typedef unsigned char SQLNUMERIC;
53 #endif
55 typedef void * SQLPOINTER;
57 #if (ODBCVER >= 0x0300)
58 typedef float SQLREAL;
59 #endif
61 typedef signed short int SQLSMALLINT;
62 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
70 typedef SQLSMALLINT SQLRETURN;
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
84 typedef signed char SCHAR;
85 typedef SCHAR SQLSCHAR;
86 typedef int SDWORD;
87 typedef signed short int SWORD;
88 typedef unsigned int UDWORD;
89 typedef unsigned short int UWORD;
90 typedef UDWORD SQLUINTEGER;
91 typedef signed long SLONG;
92 typedef signed short SSHORT;
93 typedef double SDOUBLE;
94 typedef double LDOUBLE;
95 typedef float SFLOAT;
96 typedef void* PTR;
97 typedef signed short RETCODE;
98 typedef void* SQLHWND;
100 #ifdef _WIN64
101 typedef INT64 SQLLEN;
102 typedef UINT64 SQLULEN;
103 typedef UINT64 SQLSETPOSIROW;
104 #else
105 #define SQLLEN SQLINTEGER
106 #define SQLULEN SQLUINTEGER
107 #define SQLSETPOSIROW SQLUSMALLINT
108 #endif
110 typedef SQLHANDLE HENV;
111 typedef SQLHANDLE HDBC;
112 typedef SQLHANDLE HSTMT;
114 #ifndef __SQLDATE
115 #define __SQLDATE
116 typedef struct tagDATE_STRUCT
118 SQLSMALLINT year;
119 SQLUSMALLINT month;
120 SQLUSMALLINT day;
121 } DATE_STRUCT;
123 #if (ODBCVER >= 0x0300)
124 typedef DATE_STRUCT SQL_DATE_STRUCT;
125 #endif
127 typedef struct tagTIME_STRUCT
129 SQLUSMALLINT hour;
130 SQLUSMALLINT minute;
131 SQLUSMALLINT second;
132 } TIME_STRUCT;
134 #if (ODBCVER >= 0x0300)
135 typedef TIME_STRUCT SQL_TIME_STRUCT;
136 #endif
138 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;
149 #if (ODBCVER >= 0x0300)
150 typedef TIMESTAMP_STRUCT SQL_TIMESTAMP_STRUCT;
151 #endif
154 #if (ODBCVER >= 0x0300)
155 typedef enum
157 SQL_IS_YEAR = 1,
158 SQL_IS_MONTH = 2,
159 SQL_IS_DAY = 3,
160 SQL_IS_HOUR = 4,
161 SQL_IS_MINUTE = 5,
162 SQL_IS_SECOND = 6,
163 SQL_IS_YEAR_TO_MONTH = 7,
164 SQL_IS_DAY_TO_HOUR = 8,
165 SQL_IS_DAY_TO_MINUTE = 9,
166 SQL_IS_DAY_TO_SECOND = 10,
167 SQL_IS_HOUR_TO_MINUTE = 11,
168 SQL_IS_HOUR_TO_SECOND = 12,
169 SQL_IS_MINUTE_TO_SECOND = 13
170 } SQLINTERVAL;
172 #endif
174 #if (ODBCVER >= 0x0300)
175 typedef struct tagSQL_YEAR_MONTH
177 SQLUINTEGER year;
178 SQLUINTEGER month;
179 } SQL_YEAR_MONTH_STRUCT;
181 typedef struct tagSQL_DAY_SECOND
183 SQLUINTEGER day;
184 SQLUINTEGER hour;
185 SQLUINTEGER minute;
186 SQLUINTEGER second;
187 SQLUINTEGER fraction;
188 } SQL_DAY_SECOND_STRUCT;
190 typedef struct tagSQL_INTERVAL_STRUCT
192 SQLINTERVAL interval_type;
193 SQLSMALLINT interval_sign;
194 union {
195 SQL_YEAR_MONTH_STRUCT year_month;
196 SQL_DAY_SECOND_STRUCT day_second;
197 } intval;
199 } SQL_INTERVAL_STRUCT;
201 #endif
203 #endif
205 #if (ODBCVER >= 0x0300)
206 #define ODBCINT64 __int64
207 #define UODBCINT64 unsigned __int64
208 #ifdef ODBCINT64
209 typedef ODBCINT64 SQLBIGINT;
210 typedef unsigned ODBCINT64 SQLUBIGINT;
211 #endif
212 #endif
214 #if (ODBCVER >= 0x0300)
215 #define SQL_MAX_NUMERIC_LEN 16
216 typedef struct tagSQL_NUMERIC_STRUCT
218 SQLCHAR precision;
219 SQLSCHAR scale;
220 SQLCHAR sign; /* 1=pos 0=neg */
221 SQLCHAR val[SQL_MAX_NUMERIC_LEN];
222 } SQL_NUMERIC_STRUCT;
223 #endif
225 #if (ODBCVER >= 0x0350)
226 #ifdef GUID_DEFINED
227 typedef GUID SQLGUID;
228 #else
229 typedef struct tagSQLGUID
231 DWORD Data1;
232 WORD Data2;
233 WORD Data3;
234 BYTE Data4[ 8 ];
235 } SQLGUID;
236 #endif
237 #endif
240 typedef SQLULEN BOOKMARK;
242 #define SQL_WCHAR (-8)
243 #define SQL_C_WCHAR SQL_WCHAR
245 #ifdef __cplusplus
247 #endif
249 #endif