10 #ifndef COMPILE_FOR_CLR
28 #if !defined(DBTYPEDEFS) // Do not conflict with DBLIB definitions
29 #if !defined(MAXNUMERICLEN) // Do not conflict with ODBC definitions
65 #define MAXNUMERICLEN 16
75 #endif // #if !defined(MAXNUMERICLEN)
76 #endif // #if !defined( DBTYPEDEFS )
82 #define SRV_TDS_NULL (BYTE) 0x1f
83 #define SRV_TDS_TEXT (BYTE) 0x23
84 #define SRV_TDS_GUID (BYTE) 0x24
85 #define SRV_TDS_VARBINARY (BYTE) 0x25
86 #define SRV_TDS_INTN (BYTE) 0x26
87 #define SRV_TDS_VARCHAR (BYTE) 0x27
88 #define SRV_TDS_BINARY (BYTE) 0x2d
89 #define SRV_TDS_IMAGE (BYTE) 0x22
90 #define SRV_TDS_CHAR (BYTE) 0x2f
91 #define SRV_TDS_INT1 (BYTE) 0x30
92 #define SRV_TDS_BIT (BYTE) 0x32
93 #define SRV_TDS_INT2 (BYTE) 0x34
94 #define SRV_TDS_DECIMAL (BYTE) 0x37
95 #define SRV_TDS_INT4 (BYTE) 0x38
96 #define SRV_TDS_DATETIM4 (BYTE) 0x3a
97 #define SRV_TDS_FLT4 (BYTE) 0x3b
98 #define SRV_TDS_MONEY (BYTE) 0x3c
99 #define SRV_TDS_DATETIME (BYTE) 0x3d
100 #define SRV_TDS_FLT8 (BYTE) 0x3e
101 #define SRV_TDS_NUMERIC (BYTE) 0x3f
102 #define SRV_TDS_SSVARIANT (BYTE) 0x62
103 #define SRV_TDS_NTEXT (BYTE) 0x63
104 #define SRV_TDS_BITN (BYTE) 0x68
105 #define SRV_TDS_DECIMALN (BYTE) 0x6a
106 #define SRV_TDS_NUMERICN (BYTE) 0x6c
107 #define SRV_TDS_FLTN (BYTE) 0x6d
108 #define SRV_TDS_MONEYN (BYTE) 0x6e
109 #define SRV_TDS_DATETIMN (BYTE) 0x6f
110 #define SRV_TDS_MONEY4 (BYTE) 0x7a
111 #define SRV_TDS_INT8 (BYTE) 0x7f
112 #define SRV_TDS_BIGVARBINARY (BYTE) 0xA5
113 #define SRV_TDS_BIGVARCHAR (BYTE) 0xA7
114 #define SRV_TDS_BIGBINARY (BYTE) 0xAD
115 #define SRV_TDS_BIGCHAR (BYTE) 0xAF
116 #define SRV_TDS_NVARCHAR (BYTE) 0xe7
117 #define SRV_TDS_NCHAR (BYTE) 0xef
121 #define SRVNULL SRV_TDS_NULL
122 #define SRVTEXT SRV_TDS_TEXT
123 #define SRVGUID SRV_TDS_GUID
124 #define SRVVARBINARY SRV_TDS_VARBINARY
125 #define SRVINTN SRV_TDS_INTN
126 #define SRVVARCHAR SRV_TDS_VARCHAR
127 #define SRVBINARY SRV_TDS_BINARY
128 #define SRVIMAGE SRV_TDS_IMAGE
129 #define SRVCHAR SRV_TDS_CHAR
130 #define SRVINT1 SRV_TDS_INT1
131 #define SRVBIT SRV_TDS_BIT
132 #define SRVINT2 SRV_TDS_INT2
133 #define SRVDECIMAL SRV_TDS_DECIMAL
134 #define SRVINT4 SRV_TDS_INT4
135 #define SRVDATETIM4 SRV_TDS_DATETIM4
136 #define SRVFLT4 SRV_TDS_FLT4
137 #define SRVMONEY SRV_TDS_MONEY
138 #define SRVDATETIME SRV_TDS_DATETIME
139 #define SRVFLT8 SRV_TDS_FLT8
140 #define SRVNUMERIC SRV_TDS_NUMERIC
141 #define SRVSSVARIANT SRV_TDS_SSVARIANT
142 #define SRVNTEXT SRV_TDS_NTEXT
143 #define SRVBITN SRV_TDS_BITN
144 #define SRVDECIMALN SRV_TDS_DECIMALN
145 #define SRVNUMERICN SRV_TDS_NUMERICN
146 #define SRVFLTN SRV_TDS_FLTN
147 #define SRVMONEYN SRV_TDS_MONEYN
148 #define SRVDATETIMN SRV_TDS_DATETIMN
149 #define SRVMONEY4 SRV_TDS_MONEY4
150 #define SRVINT8 SRV_TDS_INT8
151 #define SRVBIGVARBINARY SRV_TDS_BIGVARBINARY
152 #define SRVBIGVARCHAR SRV_TDS_BIGVARCHAR
153 #define SRVBIGBINARY SRV_TDS_BIGBINARY
154 #define SRVBIGCHAR SRV_TDS_BIGCHAR
155 #define SRVNVARCHAR SRV_TDS_NVARCHAR
156 #define SRVNCHAR SRV_TDS_NCHAR
161 #define SRV_DATATYPE 2
165 #define SRV_ENO_OS_ERR 0
167 #define SRV_FATAL_PROCESS 10
168 #define SRV_FATAL_SERVER 19
172 #define SRV_CONTINUE 0
173 #define SRV_LANGUAGE 1
174 #define SRV_CONNECT 2
176 #define SRV_RESTART 4
177 #define SRV_DISCONNECT 5
178 #define SRV_ATTENTION 6
183 #define SRV_CANCEL 11
187 #define SRV_PRERROR 15
188 #define SRV_ATTENTION_ACK 16
189 #define SRV_CONNECT_V7 16 // TDS type for TDS 7 clients. Overloaded with SRV_ATTENTION_ACK
191 #define SRV_TRANSMGR 18
192 #define SRV_PRELOGIN 19
194 #define SRV_INTERNAL_HANDLER 99
195 #define SRV_PROGRAMMER_DEFINED 100
198 #define SRV_SERVERNAME 0
199 #define SRV_VERSION 6
202 #define SRV_NULLTERM -1
205 #define SRV_MSG_INFO 1
206 #define SRV_MSG_ERROR 2
210 #define SRV_DONE_FINAL (USHORT) 0x0000
211 #define SRV_DONE_MORE (USHORT) 0x0001
212 #define SRV_DONE_ERROR (USHORT) 0x0002
213 #define SRV_DONE_COUNT (USHORT) 0x0010
214 #define SRV_DONE_RPC_IN_BATCH (USHORT) 0x0080
217 #define SRV_PARAMRETURN 0x0001
218 #define SRV_PARAMDEFAULT 0x0002
219 #define SRV_PARAMSORTORDER 0x0004
222 #define SRV_RECOMPILE 0x0001
223 #define SRV_NOMETADATA 0x0002
229 #define SRV_NETSPID 11
231 #define SRV_STATUS 13
232 #define SRV_RMTSERVER 14
237 #define SRV_APPLNAME 19
240 #define SRV_LIBVERS 22
241 #define SRV_ROWSENT 23
242 #define SRV_BCPFLAG 24
243 #define SRV_NATLANG 25
244 #define SRV_PIPEHANDLE 26
245 #define SRV_NETWORK_MODULE 27
246 #define SRV_NETWORK_VERSION 28
247 #define SRV_NETWORK_CONNECTION 29
248 #define SRV_LSECURE 30
250 #define SRV_UNICODE_USER 33
251 #define SRV_UNICODE_PWD 35
252 #define SRV_SPROC_CODEPAGE 36
253 #define SRV_MSGLCID 37
254 #define SRV_INSTANCENAME 38
255 #define SRV_HASHPWD 39
256 #define SRV_UNICODE_CURRENTLOGIN 40
259 #define SRV_TDS_NONE 0
260 #define SRV_TDS_2_0 1
261 #define SRV_TDS_3_4 2
262 #define SRV_TDS_4_2 3
263 #define SRV_TDS_6_0 4
264 #define SRV_TDS_7_0 5
272 #if !defined( SUCCEED )
273 #define SUCCEED 1 // Successful return value
277 #define FAIL 0 // Unsuccessful return value
280 #define SRV_DUPLICATE_HANDLER 2 // additional return value for srv_pre/post_handle
282 #ifndef COMPILE_FOR_CLR
328 #define SRV_GETSERVER(a) srv_getserver ( a )
329 #define SRV_GOT_ATTENTION(a) srv_got_attention ( a )
330 #define SRV_TDSVERSION(a) srv_tdsversion ( a )
336 void* __cdecl
srv_alloc(
long int ulSize);
413 char* __cdecl
srv_symbol(
int type,
int symbol,
int* len);
448 #endif // #ifndef COMPILE_FOR_CLR
456 #define SS_MAJOR_VERSION 7
457 #define SS_MINOR_VERSION 00
458 #define SS_LEVEL_VERSION 0000
459 #define SS_MINIMUM_VERSION "7.00.00.0000"
460 #define ODS_VERSION ((SS_MAJOR_VERSION << 24) | (SS_MINOR_VERSION << 16))
struct dbdatetime4 DBDATETIM4
unsigned short nummins
Definition: srv.h:62
unsigned char DBTINYINT
Definition: srv.h:35
BYTE scale
Definition: srv.h:69
char *__cdecl srv_rpcname(SRV_PROC *srvproc, int *len)
#define MAXNUMERICLEN
Definition: srv.h:65
int __cdecl srv_describe(SRV_PROC *, int, char *, int, long int, long int, long int, long int, void *)
int __cdecl srv_tdsversion(SRV_PROC *srvproc)
int __cdecl srv_returnval(SRV_PROC *srvproc, char *valuename, int len, BYTE status, long int type, long int maxlen, long int datalen, void *value)
long mnyhigh
Definition: srv.h:52
unsigned long dttime
Definition: srv.h:47
void *__cdecl srv_getuserdata(SRV_PROC *srvproc)
DBNUMERIC DBDECIMAL
Definition: srv.h:73
BYTE precision
Definition: srv.h:68
int __cdecl srv_bzero(void *location, long int count)
char *__cdecl srv_sfield(SRV_SERVER *server, int field, int *len)
int __cdecl srv_revert_to_self(SRV_PROC *srvproc)
char DBCHAR
Definition: srv.h:39
int __cdecl srv_terminatethread(SRV_PROC *srvproc)
int __cdecl srv_rpcnumber(SRV_PROC *srvproc)
int(* EventHandler)(void *)
Definition: srv.h:350
int __cdecl srv_log(SRV_SERVER *server, BOOL datestamp, char *msg, int msglen)
int __cdecl srv_free(void *ptr)
int __cdecl srv_paramsetoutput(SRV_PROC *, int, BYTE *, ULONG, BOOL)
int __cdecl srv_paramtype(SRV_PROC *, int)
unsigned char DBBYTE
Definition: srv.h:34
unsigned short numdays
Definition: srv.h:61
file_status status(const path &)
Definition: filesystem:3137
int __cdecl srv_wsendmsg(SRV_PROC *srvproc, long int msgnum, BYTE msgclass, WCHAR *message, int msglen)
int __cdecl srv_clearstatistics(SRV_PROC *srvproc)
BYTE sign
Definition: srv.h:70
int __cdecl srv_paramnumber(SRV_PROC *, char *, int)
char *__cdecl srv_paramname(SRV_PROC *, int, int *)
char *__cdecl srv_rpcowner(SRV_PROC *srvproc, int *len)
char *__cdecl srv_rpcdb(SRV_PROC *srvproc, int *len)
struct srv_config SRV_CONFIG
Definition: srv.h:290
unsigned short DBUSMALLINT
Definition: srv.h:37
_Iter_diff_t< _InIt > count(_InIt _First, _InIt _Last, const _Ty &_Val)
Definition: xutility:3318
int __cdecl srv_sendmsg(SRV_PROC *srvproc, int msgtype, long int msgnum, BYTE msgclass, BYTE state, char *rpcname, int rpcnamelen, USHORT linenum, char *message, int msglen)
unsigned char DBBINARY
Definition: srv.h:40
void *__cdecl srv_alloc(long int ulSize)
int __cdecl srv_setcoldata(SRV_PROC *srvproc, int column, void *data)
short DBSMALLINT
Definition: srv.h:36
void *__cdecl srv_pfieldex(SRV_PROC *srvproc, int field, int *len)
long DBINT
Definition: srv.h:38
int __cdecl srv_paramset(SRV_PROC *, int, void *, int)
int __cdecl srv_sendrow(SRV_PROC *srvproc)
BYTE val[MAXNUMERICLEN]
Definition: srv.h:71
struct srv_datetime DBDATETIME
BOOL __cdecl srv_got_attention(SRV_PROC *srvproc)
int __cdecl srv_senddone(SRV_PROC *srvproc, USHORT status, USHORT curcmd, long int count)
int __cdecl srv_paraminfo(SRV_PROC *, int, BYTE *, ULONG *, ULONG *, BYTE *, BOOL *)
struct CXPData SRV_PROC
Definition: srv.h:293
long __cdecl srv_langlen(SRV_PROC *srvproc)
unsigned char DBBOOL
Definition: srv.h:33
int RETCODE
Definition: srv.h:269
long __cdecl srv_langcpy(SRV_PROC *srvproc, long start, long nbytes, char *buffer)
void *__cdecl srv_paramdata(SRV_PROC *, int)
int SRVRETCODE
Definition: srv.h:267
int __cdecl srv_setuserdata(SRV_PROC *srvproc, void *ptr)
char *__cdecl srv_symbol(int type, int symbol, int *len)
int __cdecl srv_sendstatus(SRV_PROC *srvproc, long int status)
int __cdecl srv_getdtcxact(SRV_PROC *srvproc, void **ppv)
SRV_SERVER *__cdecl srv_getserver(SRV_PROC *srvproc)
constexpr auto data(_Container &_Cont) -> decltype(_Cont.data())
Definition: xutility:1513
int __cdecl srv_pre_handle(SRV_SERVER *server, SRV_PROC *srvproc, long int event, EventHandler handler, BOOL remove)
int __cdecl srv_setutype(SRV_PROC *srvproc, int column, long int usertype)
int __cdecl srv_impersonate_client(SRV_PROC *srvproc)
void *__cdecl srv_langptr(SRV_PROC *srvproc)
int __cdecl srv_paramstatus(SRV_PROC *, int)
double DBFLT8
Definition: srv.h:42
int __cdecl srv_rpcparams(SRV_PROC *)
unsigned long mnylow
Definition: srv.h:53
BOOL __cdecl srv_willconvert(int srctype, int desttype)
float DBFLT4
Definition: srv.h:56
long dtdays
Definition: srv.h:46
int __cdecl srv_getbindtoken(SRV_PROC *srvproc, char *token_buf)
unsigned char DBBIT
Definition: srv.h:41
struct srv_server SRV_SERVER
Definition: srv.h:287
int __cdecl srv_setcollen(SRV_PROC *srvproc, int column, int len)
int __cdecl srv_post_handle(SRV_SERVER *server, SRV_PROC *srvproc, long int event, EventHandler handler, BOOL remove)
int __cdecl srv_IgnoreAnsiToOem(SRV_PROC *srvproc, BOOL bTF)
USHORT __cdecl srv_rpcoptions(SRV_PROC *srvproc)
int __cdecl srv_convert(SRV_PROC *, int, void *, long int, int, void *, long int)
int __cdecl srv_message_handler(SRV_PROC *srvproc, int errornum, BYTE severity, BYTE state, int oserrnum, char *errtext, int errtextlen, char *oserrtext, int oserrtextlen)
long DBMONEY4
Definition: srv.h:57
int __cdecl srv_bmove(void *from, void *to, long int count)
int __cdecl srv_parammaxlen(SRV_PROC *, int)
int __cdecl srv_sendstatistics(SRV_PROC *srvproc)
int __cdecl srv_paramlen(SRV_PROC *, int)
struct dbnumeric DBNUMERIC
char *__cdecl srv_pfield(SRV_PROC *srvproc, int field, int *len)