FreeTDS API
Loading...
Searching...
No Matches
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
26extern "C"
27{
28#if 0
29}
30#endif
31#endif
32
33typedef int32_t CS_INT;
34typedef uint32_t CS_UINT;
35typedef int64_t CS_BIGINT;
36typedef uint64_t CS_UBIGINT;
37typedef int16_t CS_SMALLINT;
38typedef uint16_t CS_USMALLINT;
39typedef unsigned char CS_TINYINT;
40typedef char CS_CHAR;
41typedef unsigned char CS_BYTE;
42typedef tds_sysdep_real32_type CS_REAL;
43typedef tds_sysdep_real64_type CS_FLOAT;
44typedef int32_t CS_BOOL;
45typedef void CS_VOID;
46typedef unsigned char CS_IMAGE;
47typedef unsigned char CS_TEXT;
48typedef unsigned char CS_LONGBINARY;
49typedef unsigned char CS_LONGCHAR;
50typedef long CS_LONG;
51typedef unsigned char CS_BINARY;
52typedef uint16_t CS_USHORT;
53typedef unsigned char CS_BIT;
54
55typedef CS_INT CS_RETCODE;
56
57#define CS_MAX_NAME 132
58#define CS_MAX_SCALE 77
59#define CS_MAX_PREC 77 /* used by php */
60#define CS_MAX_NUMLEN 33 /* used by roguewave */
61#define CS_MAX_MSG 1024
62#define CS_SQLSTATE_SIZE 8
63#define CS_OBJ_NAME 400
64#define CS_TP_SIZE 16 /* text pointer */
65#define CS_TS_SIZE 8 /* length of timestamp */
66
67
68typedef struct _cs_numeric
69{
70 unsigned char precision;
71 unsigned char scale;
72 unsigned char array[CS_MAX_NUMLEN];
74
76
77typedef struct _cs_varbinary
78{
79 CS_SMALLINT len;
80 CS_CHAR array[256];
82
83typedef struct _cs_varchar
84{
85 CS_SMALLINT len; /* length of the string */
86 CS_CHAR str[256]; /* string, no NULL terminator */
88
89typedef struct _cs_config CS_CONFIG;
90typedef struct _cs_context CS_CONTEXT;
91typedef struct _cs_connection CS_CONNECTION;
92typedef struct _cs_locale CS_LOCALE;
93typedef struct _cs_command CS_COMMAND;
94typedef struct _cs_blk_row CS_BLK_ROW;
95
96typedef struct _cs_iodesc
97{
98 CS_INT iotype;
99 CS_INT datatype;
100 CS_LOCALE *locale;
101 CS_INT usertype;
102 CS_INT total_txtlen;
103 CS_INT offset;
104 CS_BOOL log_on_update;
105 CS_CHAR name[CS_OBJ_NAME];
106 CS_INT namelen;
107 CS_BYTE timestamp[CS_TS_SIZE];
108 CS_INT timestamplen;
109 CS_BYTE textptr[CS_TP_SIZE];
110 CS_INT textptrlen;
111} CS_IODESC;
112
113typedef struct _cs_datafmt
114{
115 CS_CHAR name[CS_MAX_NAME];
116 CS_INT namelen;
117 CS_INT datatype;
118 CS_INT format;
119 CS_INT maxlength;
120 CS_INT scale;
121 CS_INT precision;
122 CS_INT status;
123 CS_INT count;
124 CS_INT usertype;
125 CS_LOCALE *locale;
126} CS_DATAFMT;
127
128typedef struct _cs_money
129{
130 CS_INT mnyhigh;
131 CS_UINT mnylow;
132} CS_MONEY;
133
134typedef struct _cs_money4
135{
136 CS_INT mny4;
137} CS_MONEY4;
138
139typedef CS_INT CS_DATE;
140
141typedef CS_INT CS_TIME;
142
143typedef CS_UBIGINT CS_BIGDATETIME;
144typedef CS_UBIGINT CS_BIGTIME;
145
146typedef struct _cs_datetime
147{
148 CS_INT dtdays;
149 CS_INT dttime;
151
152typedef struct _cs_datetime4
153{
154 CS_USHORT days;
155 CS_USHORT minutes;
157
158typedef 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_INT datesecfrac;
171 CS_INT datesecprec;
172} CS_DATEREC;
173
174typedef CS_INT CS_MSGNUM;
175
176typedef struct _cs_clientmsg
177{
178 CS_INT severity;
179 CS_MSGNUM msgnumber;
180 CS_CHAR msgstring[CS_MAX_MSG];
181 CS_INT msgstringlen;
182 CS_INT osnumber;
183 CS_CHAR osstring[CS_MAX_MSG];
184 CS_INT osstringlen;
185 CS_INT status;
186 CS_BYTE sqlstate[CS_SQLSTATE_SIZE];
187 CS_INT sqlstatelen;
189
190typedef struct _cs_servermsg
191{
192 CS_MSGNUM msgnumber;
193 CS_INT state;
194 CS_INT severity;
195 CS_CHAR text[CS_MAX_MSG];
196 CS_INT textlen;
197 CS_CHAR svrname[CS_MAX_NAME];
198 CS_INT svrnlen;
199 CS_CHAR proc[CS_MAX_NAME];
200 CS_INT proclen;
201 CS_INT line;
202 CS_INT status;
203 CS_BYTE sqlstate[CS_SQLSTATE_SIZE];
204 CS_INT sqlstatelen;
206
207#ifdef __cplusplus
208#if 0
209{
210#endif
211}
212#endif
213
214#endif
Definition: cstypes.h:69
Definition: cstypes.h:78
Definition: cstypes.h:84
Definition: cstypes.h:97
Definition: cstypes.h:114
Definition: cstypes.h:129
Definition: cstypes.h:135
Definition: cstypes.h:147
Definition: cstypes.h:153
Definition: cstypes.h:159
Definition: cstypes.h:177
Definition: cstypes.h:191
Definition: ctlib.h:45
Definition: ctlib.h:75
Definition: ctlib.h:117
Definition: ctlib.h:212
Definition: ctlib.h:248