FreeTDS API

cstypes.h
1 /* FreeTDS - Library of routines accessing Sybase and Microsoft databases
2 * Copyright (C) 1998-1999 Brian Bruns
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
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 * Library General Public License for more details.
13 *
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
18 */
19
20 #ifndef _cstypes_h_
21 #define _cstypes_h_
22
23 #include "tds_sysdep_public.h"
24
25 #ifdef __cplusplus
26 extern "C"
27 {
28 #if 0
29 }
30 #endif
31 #endif
32
33 static const char rcsid_cstypes_h[] = "$Id: cstypes.h,v 1.7 2008-05-06 00:14:02 jklowden Exp $";
34 static const void *const no_unused_cstypes_h_warn[] = { rcsid_cstypes_h, no_unused_cstypes_h_warn };
35
36 typedef tds_sysdep_int32_type CS_INT;
37 typedef unsigned tds_sysdep_int32_type CS_UINT;
38 typedef tds_sysdep_int64_type CS_BIGINT;
39 typedef unsigned tds_sysdep_int64_type CS_UBIGINT;
40 typedef tds_sysdep_int16_type CS_SMALLINT;
41 typedef unsigned tds_sysdep_int16_type CS_USMALLINT;
42 typedef unsigned char CS_TINYINT;
43 typedef char CS_CHAR;
44 typedef unsigned char CS_BYTE;
45 typedef tds_sysdep_real32_type CS_REAL;
46 typedef tds_sysdep_real64_type CS_FLOAT;
47 typedef tds_sysdep_int32_type CS_BOOL;
48 typedef void CS_VOID;
49 typedef unsigned char CS_IMAGE;
50 typedef unsigned char CS_TEXT;
51 typedef unsigned char CS_LONGBINARY;
52 typedef unsigned char CS_LONGCHAR;
53 typedef long CS_LONG;
54 typedef unsigned char CS_BINARY;
55 typedef unsigned tds_sysdep_int16_type CS_USHORT;
56 typedef unsigned char CS_BIT;
57
58 typedef CS_INT CS_RETCODE;
59
60 #define CS_MAX_NAME 132
61 #define CS_MAX_SCALE 77
62 #define CS_MAX_PREC 77 /* used by php */
63 #define CS_MAX_NUMLEN 33 /* used by roguewave */
64 #define CS_MAX_MSG 1024
65 #define CS_SQLSTATE_SIZE 8
66 #define CS_OBJ_NAME 400
67 #define CS_TP_SIZE 16 /* text pointer */
68 #define CS_TS_SIZE 8 /* length of timestamp */
69
70
71 typedef struct _cs_numeric
72 {
73 unsigned char precision;
74 unsigned char scale;
75 unsigned char array[CS_MAX_NUMLEN];
76 } CS_NUMERIC;
77
78 typedef CS_NUMERIC CS_DECIMAL;
79
80 typedef struct _cs_varbinary
81 {
82 CS_SMALLINT len;
83 CS_CHAR array[256];
84 } CS_VARBINARY;
85
86 typedef struct _cs_varchar
87 {
88 CS_SMALLINT len; /* length of the string */
89 CS_CHAR str[256]; /* string, no NULL terminator */
90 } CS_VARCHAR;
91
92 typedef struct _cs_config CS_CONFIG;
93 typedef struct _cs_context CS_CONTEXT;
94 typedef struct _cs_connection CS_CONNECTION;
95 typedef struct _cs_locale CS_LOCALE;
96 typedef struct _cs_command CS_COMMAND;
97 typedef struct _cs_blk_row CS_BLK_ROW;
98
99 typedef struct _cs_iodesc
100 {
101 CS_INT iotype;
102 CS_INT datatype;
103 CS_LOCALE *locale;
104 CS_INT usertype;
105 CS_INT total_txtlen;
106 CS_INT offset;
107 CS_BOOL log_on_update;
108 CS_CHAR name[CS_OBJ_NAME];
109 CS_INT namelen;
110 CS_BYTE timestamp[CS_TS_SIZE];
111 CS_INT timestamplen;
112 CS_BYTE textptr[CS_TP_SIZE];
113 CS_INT textptrlen;
114 } CS_IODESC;
115
116 typedef struct _cs_datafmt
117 {
118 CS_CHAR name[CS_MAX_NAME];
119 CS_INT namelen;
120 CS_INT datatype;
121 CS_INT format;
122 CS_INT maxlength;
123 CS_INT scale;
124 CS_INT precision;
125 CS_INT status;
126 CS_INT count;
127 CS_INT usertype;
128 CS_LOCALE *locale;
129 } CS_DATAFMT;
130
131 typedef struct _cs_money
132 {
133 CS_INT mnyhigh;
134 CS_UINT mnylow;
135 } CS_MONEY;
136
137 typedef struct _cs_money4
138 {
139 CS_INT mny4;
140 } CS_MONEY4;
141
142 typedef CS_INT CS_DATE;
143
144 typedef CS_INT CS_TIME;
145
146 typedef CS_UBIGINT CS_BIGDATETIME;
147 typedef CS_UBIGINT CS_BIGTIME;
148
149 typedef struct _cs_datetime
150 {
151 CS_INT dtdays;
152 CS_INT dttime;
153 } CS_DATETIME;
154
155 typedef struct _cs_datetime4
156 {
157 CS_USHORT days;
158 CS_USHORT minutes;
159 } CS_DATETIME4;
160
161 typedef struct _cs_daterec
162 {
163 CS_INT dateyear;
164 CS_INT datemonth;
165 CS_INT datedmonth;
166 CS_INT datedyear;
167 CS_INT datedweek;
168 CS_INT datehour;
169 CS_INT dateminute;
170 CS_INT datesecond;
171 CS_INT datemsecond;
172 CS_INT datetzone;
173 CS_INT datesecfrac;
174 CS_INT datesecprec;
175 } CS_DATEREC;
176
177 typedef CS_INT CS_MSGNUM;
178
179 typedef struct _cs_clientmsg
180 {
181 CS_INT severity;
182 CS_MSGNUM msgnumber;
183 CS_CHAR msgstring[CS_MAX_MSG];
184 CS_INT msgstringlen;
185 CS_INT osnumber;
186 CS_CHAR osstring[CS_MAX_MSG];
187 CS_INT osstringlen;
188 CS_INT status;
189 CS_BYTE sqlstate[CS_SQLSTATE_SIZE];
190 CS_INT sqlstatelen;
191 } CS_CLIENTMSG;
192
193 typedef struct _cs_servermsg
194 {
195 CS_MSGNUM msgnumber;
196 CS_INT state;
197 CS_INT severity;
198 CS_CHAR text[CS_MAX_MSG];
199 CS_INT textlen;
200 CS_CHAR svrname[CS_MAX_NAME];
201 CS_INT svrnlen;
202 CS_CHAR proc[CS_MAX_NAME];
203 CS_INT proclen;
204 CS_INT line;
205 CS_INT status;
206 CS_BYTE sqlstate[CS_SQLSTATE_SIZE];
207 CS_INT sqlstatelen;
208 } CS_SERVERMSG;
209
210 #ifdef __cplusplus
211 #if 0
212 {
213 #endif
214 }
215 #endif
216
217 #endif
_cs_money4
Definition: cstypes.h:137
_cs_datetime4
Definition: cstypes.h:155
_cs_connection
Definition: ctlib.h:114
_cs_clientmsg
Definition: cstypes.h:179
_cs_iodesc
Definition: cstypes.h:99
_cs_config
Definition: ctlib.h:44
_cs_daterec
Definition: cstypes.h:161
_cs_servermsg
Definition: cstypes.h:193
_cs_numeric
Definition: cstypes.h:71
_cs_command
Definition: ctlib.h:208
_cs_context
Definition: ctlib.h:74
_cs_money
Definition: cstypes.h:131
_cs_varchar
Definition: cstypes.h:86
_cs_locale
Definition: ctlib.h:244
_cs_datetime
Definition: cstypes.h:149
_cs_datafmt
Definition: cstypes.h:116
_cs_varbinary
Definition: cstypes.h:80