FreeTDS API

- Main Page
- Related Pages
- Modules
- Classes
- Files

- File List
- File Members

All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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 struct _cs_datetime
147 {
148 CS_INT dtdays;
149 CS_INT dttime;
150 } CS_DATETIME;
151
152 typedef struct _cs_datetime4
153 {
154 CS_USHORT days;
155 CS_USHORT minutes;
156 } CS_DATETIME4;
157
158 typedef struct _cs_daterec
159 {
160 CS_INT dateyear;
161 CS_INT datemonth;
162 CS_INT datedmonth;
163 CS_INT datedyear;
164 CS_INT datedweek;
165 CS_INT datehour;
166 CS_INT dateminute;
167 CS_INT datesecond;
168 CS_INT datemsecond;
169 CS_INT datetzone;
170 } CS_DATEREC;
171
172 typedef CS_INT CS_MSGNUM;
173
174 typedef struct _cs_clientmsg
175 {
176 CS_INT severity;
177 CS_MSGNUM msgnumber;
178 CS_CHAR msgstring[CS_MAX_MSG];
179 CS_INT msgstringlen;
180 CS_INT osnumber;
181 CS_CHAR osstring[CS_MAX_MSG];
182 CS_INT osstringlen;
183 CS_INT status;
184 CS_BYTE sqlstate[CS_SQLSTATE_SIZE];
185 CS_INT sqlstatelen;
186 } CS_CLIENTMSG;
187
188 typedef struct _cs_servermsg
189 {
190 CS_MSGNUM msgnumber;
191 CS_INT state;
192 CS_INT severity;
193 CS_CHAR text[CS_MAX_MSG];
194 CS_INT textlen;
195 CS_CHAR svrname[CS_MAX_NAME];
196 CS_INT svrnlen;
197 CS_CHAR proc[CS_MAX_NAME];
198 CS_INT proclen;
199 CS_INT line;
200 CS_INT status;
201 CS_BYTE sqlstate[CS_SQLSTATE_SIZE];
202 CS_INT sqlstatelen;
203 } CS_SERVERMSG;
204
205 #ifdef __cplusplus
206 #if 0
207 {
208 #endif
209 }
210 #endif
211
212 #endif