source: Daodan/MinGW/include/sqltypes.h@ 1089

Last change on this file since 1089 was 1046, checked in by alloc, 8 years ago

Daodan: Added Windows MinGW and build batch file

File size: 3.9 KB
Line 
1#ifndef _SQLTYPES_H
2#define _SQLTYPES_H
3#if __GNUC__ >=3
4#pragma GCC system_header
5#endif
6
7#ifdef __cplusplus
8extern "C" {
9#endif
10#define SQL_API __stdcall
11#ifndef RC_INVOKED
12#define __need_wchar_t
13#include <stddef.h>
14typedef signed char SCHAR;
15typedef long SDWORD;
16typedef short SWORD;
17typedef ULONG UDWORD;
18typedef USHORT UWORD;
19typedef signed long SLONG;
20typedef signed short SSHORT;
21typedef double SDOUBLE;
22typedef double LDOUBLE;
23typedef float SFLOAT;
24typedef PVOID PTR;
25typedef PVOID HENV;
26typedef PVOID HDBC;
27typedef PVOID HSTMT;
28typedef short RETCODE;
29typedef UCHAR SQLCHAR;
30typedef SCHAR SQLSCHAR;
31typedef SDWORD SQLINTEGER;
32typedef SWORD SQLSMALLINT;
33#ifndef __WIN64
34typedef UDWORD SQLUINTEGER;
35#endif
36typedef UWORD SQLUSMALLINT;
37typedef PVOID SQLPOINTER;
38#if (ODBCVER >= 0x0300)
39typedef void* SQLHANDLE;
40typedef SQLHANDLE SQLHENV;
41typedef SQLHANDLE SQLHDBC;
42typedef SQLHANDLE SQLHSTMT;
43typedef SQLHANDLE SQLHDESC;
44#else
45typedef void* SQLHENV;
46typedef void* SQLHDBC;
47typedef void* SQLHSTMT;
48#endif
49typedef SQLSMALLINT SQLRETURN;
50typedef HWND SQLHWND;
51typedef ULONG BOOKMARK;
52#ifdef _WIN64
53typedef INT64 SQLLEN;
54typedef INT64 SQLROWOFFSET;
55typedef UINT64 SQLROWCOUNT;
56typedef UINT64 SQLULEN;
57typedef UINT64 SQLTRANSID;
58typedef unsigned long SQLSETPOSIROW;
59#else
60#define SQLLEN SQLINTEGER
61#define SQLROWOFFSET SQLINTEGER
62#define SQLROWCOUNT SQLUINTEGER
63#define SQLULEN SQLUINTEGER
64#define SQLTRANSID DWORD
65#define SQLSETPOSIROW SQLUSMALLINT
66#endif
67typedef wchar_t SQLWCHAR;
68#ifdef UNICODE
69typedef SQLWCHAR SQLTCHAR;
70#else
71typedef SQLCHAR SQLTCHAR;
72#endif /* UNICODE */
73#if (ODBCVER >= 0x0300)
74typedef unsigned char SQLDATE;
75typedef unsigned char SQLDECIMAL;
76typedef double SQLDOUBLE;
77typedef double SQLFLOAT;
78typedef unsigned char SQLNUMERIC;
79typedef float SQLREAL;
80typedef unsigned char SQLTIME;
81typedef unsigned char SQLTIMESTAMP;
82typedef unsigned char SQLVARCHAR;
83#define ODBCINT64 __int64
84typedef __int64 SQLBIGINT;
85typedef unsigned __int64 SQLUBIGINT;
86#endif
87
88typedef struct tagDATE_STRUCT {
89 SQLSMALLINT year;
90 SQLUSMALLINT month;
91 SQLUSMALLINT day;
92} DATE_STRUCT;
93typedef struct tagTIME_STRUCT {
94 SQLUSMALLINT hour;
95 SQLUSMALLINT minute;
96 SQLUSMALLINT second;
97} TIME_STRUCT;
98typedef struct tagTIMESTAMP_STRUCT {
99 SQLSMALLINT year;
100 SQLUSMALLINT month;
101 SQLUSMALLINT day;
102 SQLUSMALLINT hour;
103 SQLUSMALLINT minute;
104 SQLUSMALLINT second;
105 SQLUINTEGER fraction;
106} TIMESTAMP_STRUCT;
107#if (ODBCVER >= 0x0300)
108typedef DATE_STRUCT SQL_DATE_STRUCT;
109typedef TIME_STRUCT SQL_TIME_STRUCT;
110typedef TIMESTAMP_STRUCT SQL_TIMESTAMP_STRUCT;
111typedef enum {
112 SQL_IS_YEAR = 1,SQL_IS_MONTH,SQL_IS_DAY,SQL_IS_HOUR,
113 SQL_IS_MINUTE,SQL_IS_SECOND,SQL_IS_YEAR_TO_MONTH,SQL_IS_DAY_TO_HOUR,
114 SQL_IS_DAY_TO_MINUTE,SQL_IS_DAY_TO_SECOND,SQL_IS_HOUR_TO_MINUTE,
115 SQL_IS_HOUR_TO_SECOND,SQL_IS_MINUTE_TO_SECOND
116} SQLINTERVAL;
117typedef struct tagSQL_YEAR_MONTH {
118 SQLUINTEGER year;
119 SQLUINTEGER month;
120} SQL_YEAR_MONTH_STRUCT;
121typedef struct tagSQL_DAY_SECOND {
122 SQLUINTEGER day;
123 SQLUINTEGER hour;
124 SQLUINTEGER minute;
125 SQLUINTEGER second;
126 SQLUINTEGER fraction;
127} SQL_DAY_SECOND_STRUCT;
128typedef struct tagSQL_INTERVAL_STRUCT {
129 SQLINTERVAL interval_type;
130 SQLSMALLINT interval_sign;
131 union {
132 SQL_YEAR_MONTH_STRUCT year_month;
133 SQL_DAY_SECOND_STRUCT day_second;
134 } intval;
135} SQL_INTERVAL_STRUCT;
136#define SQL_MAX_NUMERIC_LEN 16
137typedef struct tagSQL_NUMERIC_STRUCT {
138 SQLCHAR precision;
139 SQLSCHAR scale;
140 SQLCHAR sign;
141 SQLCHAR val[SQL_MAX_NUMERIC_LEN];
142} SQL_NUMERIC_STRUCT;
143#endif /* ODBCVER >= 0x0300 */
144#if (ODBCVER >= 0x0350)
145
146#ifdef _GUID_DEFINED
147# warning _GUID_DEFINED is deprecated, use GUID_DEFINED instead
148#endif
149
150#if defined _GUID_DEFINED || defined GUID_DEFINED
151typedef GUID SQLGUID;
152#else
153typedef struct tagSQLGUID{
154 DWORD Data1;
155 WORD Data2;
156 WORD Data3;
157 BYTE Data4[ 8 ];
158} SQLGUID;
159#endif /* GUID_DEFINED */
160#endif /* ODBCVER >= 0x0350 */
161#endif /* RC_INVOKED */
162#ifdef __cplusplus
163}
164#endif
165#endif
Note: See TracBrowser for help on using the repository browser.