00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00027 #ifndef _sybdb_h_
00028 #define _sybdb_h_
00029
00030 #include "tds_sysdep_public.h"
00031
00032 #undef TDS_STATIC_CAST
00033 #ifdef __cplusplus
00034 #define TDS_STATIC_CAST(type, a) static_cast<type>(a)
00035 extern "C"
00036 {
00037 #if 0
00038 }
00039 #endif
00040 #else
00041 #define TDS_STATIC_CAST(type, a) ((type)(a))
00042 #endif
00043
00044 static const char rcsid_sybdb_h[] = "$Id: sybdb.h,v 1.85 2007/12/02 23:01:37 jklowden Exp $";
00045 static const void *const no_unused_sybdb_h_warn[] = { rcsid_sybdb_h, no_unused_sybdb_h_warn };
00046
00047 #ifdef FALSE
00048 #undef FALSE
00049 #endif
00050 #ifdef TRUE
00051 #undef TRUE
00052 #endif
00053 #define FALSE 0
00054 #define TRUE 1
00055
00056 #define DBSAVE 1
00057 #define DBNOSAVE 0
00058 #define DBNOERR -1
00059
00060 #define INT_EXIT 0
00061 #define INT_CONTINUE 1
00062 #define INT_CANCEL 2
00063 #define INT_TIMEOUT 3
00064
00065 #define DBMAXNUMLEN 33
00066 #define DBMAXNAME 30
00067
00071 #define DBVERSION_UNKNOWN 0
00072 #define DBVERSION_46 1
00073 #define DBVERSION_100 2
00074 #define DBVERSION_42 3
00075 #define DBVERSION_70 4
00076 #define DBVERSION_80 5
00077
00078
00079 #define DBVER42 DBVERSION_42
00080 #define DBVER60 DBVERSION_70
00081
00086 #define DBTDS_UNKNOWN 0
00087 #define DBTDS_2_0 1
00088 #define DBTDS_3_4 2
00089 #define DBTDS_4_0 3
00090 #define DBTDS_4_2 4
00091 #define DBTDS_4_6 5
00092 #define DBTDS_4_9_5 6
00093 #define DBTDS_5_0 7
00094 #define DBTDS_7_0 8
00095 #define DBTDS_8_0 9
00096 #define DBTDS_9_0 10
00097
00098 #define DBTXPLEN 16
00099
00100 #define BCPMAXERRS 1
00101 #define BCPFIRST 2
00102 #define BCPLAST 3
00103 #define BCPBATCH 4
00104 #define BCPKEEPIDENTITY 8
00105
00106 #define BCPLABELED 5
00107 #define BCPHINTS 6
00108
00109 #define DBCMDNONE 0
00110 #define DBCMDPEND 1
00111 #define DBCMDSENT 2
00112
00113 typedef int RETCODE;
00114
00115 typedef void DBCURSOR;
00116 typedef void DBXLATE;
00117 typedef void DBSORTORDER;
00118 typedef void DBLOGINFO;
00119 typedef void *DBVOIDPTR;
00120 typedef short SHORT;
00121 typedef unsigned short USHORT;
00122 typedef int (*INTFUNCPTR) (void *, ...);
00123 typedef int (*DBWAITFUNC) (void);
00124 typedef DBWAITFUNC(*DB_DBBUSY_FUNC) (void *dbproc);
00125 typedef void (*DB_DBIDLE_FUNC) (DBWAITFUNC dfunc, void *dbproc);
00126 typedef int (*DB_DBCHKINTR_FUNC) (void *dbproc);
00127 typedef int (*DB_DBHNDLINTR_FUNC) (void *dbproc);
00128
00129 #ifndef __INCvxWorksh
00130
00131
00132
00133
00134 #ifdef STATUS
00135
00136
00137
00138 #undef STATUS
00139 #endif
00140 typedef int STATUS;
00141 #if !defined(_WINDEF_) && !defined(_WINDEF_H) && !defined(DOS32X)
00142 typedef int BOOL;
00143 #endif
00144 #endif
00145
00146 #if !defined(_FREETDS_LIBRARY_SOURCE) || !defined(_tds_h_)
00147
00148
00149 enum
00150 {
00151 SYBCHAR = 47,
00152 #define SYBCHAR SYBCHAR
00153 SYBVARCHAR = 39,
00154 #define SYBVARCHAR SYBVARCHAR
00155 SYBINTN = 38,
00156 #define SYBINTN SYBINTN
00157 SYBINT1 = 48,
00158 #define SYBINT1 SYBINT1
00159 SYBINT2 = 52,
00160 #define SYBINT2 SYBINT2
00161 SYBINT4 = 56,
00162 #define SYBINT4 SYBINT4
00163 SYBINT8 = 127,
00164 #define SYBINT8 SYBINT8
00165 SYBFLT8 = 62,
00166 #define SYBFLT8 SYBFLT8
00167 SYBDATETIME = 61,
00168 #define SYBDATETIME SYBDATETIME
00169 SYBBIT = 50,
00170 #define SYBBIT SYBBIT
00171 SYBTEXT = 35,
00172 #define SYBTEXT SYBTEXT
00173 SYBIMAGE = 34,
00174 #define SYBIMAGE SYBIMAGE
00175 SYBMONEY4 = 122,
00176 #define SYBMONEY4 SYBMONEY4
00177 SYBMONEY = 60,
00178 #define SYBMONEY SYBMONEY
00179 SYBDATETIME4 = 58,
00180 #define SYBDATETIME4 SYBDATETIME4
00181 SYBREAL = 59,
00182 #define SYBREAL SYBREAL
00183 SYBBINARY = 45,
00184 #define SYBBINARY SYBBINARY
00185 SYBVARBINARY = 37,
00186 #define SYBVARBINARY SYBVARBINARY
00187 SYBNUMERIC = 108,
00188 #define SYBNUMERIC SYBNUMERIC
00189 SYBDECIMAL = 106,
00190 #define SYBDECIMAL SYBDECIMAL
00191 SYBFLTN = 109,
00192 #define SYBFLTN SYBFLTN
00193 SYBMONEYN = 110,
00194 #define SYBMONEYN SYBMONEYN
00195 SYBDATETIMN = 111
00196 #define SYBDATETIMN SYBDATETIMN
00197 };
00198
00199 #define SYBAOPCNT 0x4b
00200 #define SYBAOPCNTU 0x4c
00201 #define SYBAOPSUM 0x4d
00202 #define SYBAOPSUMU 0x4e
00203 #define SYBAOPAVG 0x4f
00204 #define SYBAOPAVGU 0x50
00205 #define SYBAOPMIN 0x51
00206 #define SYBAOPMAX 0x52
00207
00208
00209 #define SYBAOPCNT_BIG 0x09
00210 #define SYBAOPSTDEV 0x30
00211 #define SYBAOPSTDEVP 0x31
00212 #define SYBAOPVAR 0x32
00213 #define SYBAOPVARP 0x33
00214 #define SYBAOPCHECKSUM_AGG 0x72
00215
00216 #endif
00217
00218 typedef unsigned char DBBOOL;
00219 typedef char DBCHAR;
00220 typedef unsigned char DBBIT;
00221 typedef unsigned char DBTINYINT;
00222 typedef tds_sysdep_int16_type DBSMALLINT;
00223 typedef tds_sysdep_int32_type DBINT;
00224 typedef unsigned char DBBINARY;
00225 typedef tds_sysdep_real32_type DBREAL;
00226 typedef tds_sysdep_real64_type DBFLT8;
00227 typedef unsigned tds_sysdep_int16_type DBUSMALLINT;
00228
00229 typedef struct
00230 {
00231 DBINT len;
00232 char str[256];
00233 } DBVARYCHAR;
00234
00235 typedef struct
00236 {
00237 unsigned char precision;
00238 unsigned char scale;
00239 unsigned char array[33];
00240 } DBNUMERIC;
00241
00242 typedef DBNUMERIC DBDECIMAL;
00243
00244 typedef struct
00245 {
00246 DBINT mnyhigh;
00247 unsigned tds_sysdep_int32_type mnylow;
00248 } DBMONEY;
00249
00250 typedef struct
00251 {
00252 DBINT mny4;
00253 } DBMONEY4;
00254
00255 typedef struct
00256 {
00257 DBINT dtdays;
00258 DBINT dttime;
00259 } DBDATETIME;
00260
00261 typedef struct
00262 {
00263 DBUSMALLINT days;
00264 DBUSMALLINT minutes;
00265 } DBDATETIME4;
00266
00267 #ifdef MSDBLIB
00268 #define SQLCHAR SYBCHAR
00269 #endif
00270
00271 typedef struct tds_dblib_loginrec LOGINREC;
00272
00273 #ifndef DOS32X
00274 typedef unsigned char BYTE;
00275 #endif
00276
00277 typedef struct dbtypeinfo
00278 {
00279 DBINT precision;
00280 DBINT scale;
00281 } DBTYPEINFO;
00282
00283 struct dbstring
00284 {
00285 BYTE *strtext;
00286 DBINT strtotlen;
00287 struct dbstring *strnext;
00288 };
00289 typedef struct dbstring DBSTRING;
00290
00291
00292 enum
00293 { MAXCOLNAMELEN = 512 };
00294 typedef enum { CI_REGULAR=1, CI_ALTERNATE=2, CI_CURSOR=3 } CI_TYPE;
00295
00296 typedef struct
00297 {
00298 DBINT SizeOfStruct;
00299 DBCHAR Name[MAXCOLNAMELEN+2];
00300 DBCHAR ActualName[MAXCOLNAMELEN+2];
00301 DBCHAR TableName[MAXCOLNAMELEN+2];
00302 SHORT Type;
00303 DBINT UserType;
00304 DBINT MaxLength;
00305 BYTE Precision;
00306 BYTE Scale;
00307 BOOL VarLength;
00308 BYTE Null;
00309 BYTE CaseSensitive;
00310 BYTE Updatable;
00311 BOOL Identity;
00312
00313 } DBCOL;
00314
00315
00316
00317
00318
00319 #define DBPARSEONLY 0
00320 #define DBESTIMATE 1
00321 #define DBSHOWPLAN 2
00322 #define DBNOEXEC 3
00323 #define DBARITHIGNORE 4
00324 #define DBNOCOUNT 5
00325 #define DBARITHABORT 6
00326 #define DBTEXTLIMIT 7
00327 #define DBBROWSE 8
00328 #define DBOFFSET 9
00329 #define DBSTAT 10
00330 #define DBERRLVL 11
00331 #define DBCONFIRM 12
00332 #define DBSTORPROCID 13
00333 #define DBBUFFER 14
00334 #define DBNOAUTOFREE 15
00335 #define DBROWCOUNT 16
00336 #define DBTEXTSIZE 17
00337 #define DBNATLANG 18
00338 #define DBDATEFORMAT 19
00339 #define DBPRPAD 20
00340 #define DBPRCOLSEP 21
00341 #define DBPRLINELEN 22
00342 #define DBPRLINESEP 23
00343 #define DBLFCONVERT 24
00344 #define DBDATEFIRST 25
00345 #define DBCHAINXACTS 26
00346 #define DBFIPSFLAG 27
00347 #define DBISOLATION 28
00348 #define DBAUTH 29
00349 #define DBIDENTITY 30
00350 #define DBNOIDCOL 31
00351 #define DBDATESHORT 32
00352 #define DBCLIENTCURSORS 33
00353 #define DBSETTIME 34
00354 #define DBQUOTEDIDENT 35
00355
00356 #define DBNUMOPTIONS 36
00357
00358 #define DBPADOFF 0
00359 #define DBPADON 1
00360
00361 #define OFF 0
00362 #define ON 1
00363
00364 #define NOSUCHOPTION 2
00365
00366 #define MAXOPTTEXT 32
00367
00368 typedef struct tds_dblib_dbprocess DBPROCESS;
00369
00370 typedef struct dbdaterec
00371 {
00372 #ifdef MSDBLIB
00373 DBINT year;
00374 DBINT month;
00375 DBINT day;
00376 DBINT dayofyear;
00377 DBINT weekday;
00378 DBINT hour;
00379 DBINT minute;
00380 DBINT second;
00381 DBINT millisecond;
00382 DBINT tzone;
00383 #else
00384 DBINT dateyear;
00385 DBINT datemonth;
00386 DBINT datedmonth;
00387 DBINT datedyear;
00388 DBINT datedweek;
00389 DBINT datehour;
00390 DBINT dateminute;
00391 DBINT datesecond;
00392 DBINT datemsecond;
00393 DBINT datetzone;
00394 #endif
00395 } DBDATEREC;
00396
00397 typedef int (*EHANDLEFUNC) (DBPROCESS * dbproc, int severity, int dberr, int oserr, char *dberrstr, char *oserrstr);
00398
00399 typedef int (*MHANDLEFUNC) (DBPROCESS * dbproc, DBINT msgno, int msgstate, int severity, char *msgtext, char *srvname,
00400 char *proc, int line);
00401
00402
00403 #define DBRESULT 1
00404 #define DBNOTIFICATION 2
00405 #define DBTIMEOUT 3
00406 #define DBINTERRUPT 4
00407
00408
00409 #define DBTXTSLEN 8
00410
00411
00412 #define CHARBIND 0
00413 #define STRINGBIND 1
00414 #define NTBSTRINGBIND 2
00415 #define VARYCHARBIND 3
00416 #define VARYBINBIND 4
00417 #define TINYBIND 6
00418 #define SMALLBIND 7
00419 #define INTBIND 8
00420 #define FLT8BIND 9
00421 #define REALBIND 10
00422 #define DATETIMEBIND 11
00423 #define SMALLDATETIMEBIND 12
00424 #define MONEYBIND 13
00425 #define SMALLMONEYBIND 14
00426 #define BINARYBIND 15
00427 #define BITBIND 16
00428 #define NUMERICBIND 17
00429 #define DECIMALBIND 18
00430 #define MAXBINDTYPES 19
00431
00432 #define DBPRCOLSEP 21
00433 #define DBPRLINELEN 22
00434 #define DBRPCRETURN 1
00435 #define DBRPCDEFAULT 2
00436
00437 #define REG_ROW -1
00438 #define MORE_ROWS -1
00439 #define NO_MORE_ROWS -2
00440 #define BUF_FULL -3
00441 #define NO_MORE_RESULTS 2
00442 #define SUCCEED 1
00443 #define FAIL 0
00444
00445 #define DB_IN 1
00446 #define DB_OUT 2
00447 #define DB_QUERYOUT 3
00448
00449 #define DBSINGLE 0
00450 #define DBDOUBLE 1
00451 #define DBBOTH 2
00452
00453
00454 #define DBRPCRECOMPILE TDS_STATIC_CAST(DBSMALLINT, 0x0001)
00455 #define DBRPCRESET TDS_STATIC_CAST(DBSMALLINT, 0x0002)
00456 #define DBRPCCURSOR TDS_STATIC_CAST(DBSMALLINT, 0x0008)
00457
00458 DBBOOL db12hour(DBPROCESS * dbprocess, char *language);
00459 BYTE *dbadata(DBPROCESS * dbproc, int computeid, int column);
00460 DBINT dbadlen(DBPROCESS * dbproc, int computeid, int column);
00461 RETCODE dbaltbind(DBPROCESS * dbprocess, int computeid, int column, int vartype, DBINT varlen, BYTE * varaddr);
00462 RETCODE dbaltbind_ps(DBPROCESS * dbprocess, int computeid, int column, int vartype, DBINT varlen, BYTE * varaddr,
00463 DBTYPEINFO * typeinfo);
00464 int dbaltcolid(DBPROCESS * dbproc, int computeid, int column);
00465 RETCODE dbaltlen(DBPROCESS * dbproc, int computeid, int column);
00466 int dbaltop(DBPROCESS * dbproc, int computeid, int column);
00467 int dbalttype(DBPROCESS * dbproc, int computeid, int column);
00468 RETCODE dbaltutype(DBPROCESS * dbproc, int computeid, int column);
00469 RETCODE dbanullbind(DBPROCESS * dbprocess, int computeid, int column, DBINT * indicator);
00470 RETCODE dbbind(DBPROCESS * dbproc, int column, int vartype, DBINT varlen, BYTE * varaddr);
00471 RETCODE dbbind_ps(DBPROCESS * dbprocess, int column, int vartype, DBINT varlen, BYTE * varaddr, DBTYPEINFO * typeinfo);
00472 int dbbufsize(DBPROCESS * dbprocess);
00473 BYTE *dbbylist(DBPROCESS * dbproc, int computeid, int *size);
00474 RETCODE dbcancel(DBPROCESS * dbproc);
00475 RETCODE dbcanquery(DBPROCESS * dbproc);
00476 char *dbchange(DBPROCESS * dbprocess);
00477 DBBOOL dbcharsetconv(DBPROCESS * dbprocess);
00478 void dbclose(DBPROCESS * dbproc);
00479 void dbclrbuf(DBPROCESS * dbproc, DBINT n);
00480 RETCODE dbclropt(DBPROCESS * dbproc, int option, char *param);
00481 RETCODE dbcmd(DBPROCESS * dbproc, const char *cmdstring);
00482 RETCODE dbcmdrow(DBPROCESS * dbproc);
00483
00484 #define DBCMDROW(x) dbcmdrow((x))
00485 DBBOOL dbcolbrowse(DBPROCESS * dbprocess, int colnum);
00486 RETCODE dbcolinfo (DBPROCESS *dbproc, CI_TYPE type, DBINT column, DBINT computeid, DBCOL *pdbcol);
00487 RETCODE dbtablecolinfo (DBPROCESS *dbproc, DBINT column, DBCOL *pdbcol );
00488 DBINT dbcollen(DBPROCESS * dbproc, int column);
00489 char *dbcolname(DBPROCESS * dbproc, int column);
00490 char *dbcolsource(DBPROCESS * dbproc, int colnum);
00491 int dbcoltype(DBPROCESS * dbproc, int column);
00492 DBTYPEINFO *dbcoltypeinfo(DBPROCESS * dbproc, int column);
00493 DBINT dbcolutype(DBPROCESS * dbprocess, int column);
00494 DBINT dbconvert(DBPROCESS * dbproc, int srctype, const BYTE * src, DBINT srclen, int desttype, BYTE * dest, DBINT destlen);
00495 DBINT dbconvert_ps(DBPROCESS * dbprocess, int srctype, BYTE * src, DBINT srclen, int desttype, BYTE * dest, DBINT destlen,
00496 DBTYPEINFO * typeinfo);
00497 DBINT dbcount(DBPROCESS * dbproc);
00498
00499 #define DBCOUNT(x) dbcount((x))
00500 int dbcurcmd(DBPROCESS * dbproc);
00501
00502 #define DBCURCMD(x) dbcurcmd((x))
00503 DBINT dbcurrow(DBPROCESS * dbproc);
00504
00505 #define DBCURROW(x) dbcurrow((x))
00506 RETCODE dbcursor(DBCURSOR * hc, DBINT optype, DBINT bufno, BYTE * table, BYTE * values);
00507 RETCODE dbcursorbind(DBCURSOR * hc, int col, int vartype, DBINT varlen, DBINT * poutlen, BYTE * pvaraddr, DBTYPEINFO * typeinfo);
00508 void dbcursorclose(DBCURSOR * hc);
00509 RETCODE dbcursorcolinfo(DBCURSOR * hc, DBINT column, DBCHAR * colname, DBINT * coltype, DBINT * collen, DBINT * usertype);
00510 RETCODE dbcursorfetch(DBCURSOR * hc, DBINT fetchtype, DBINT rownum);
00511 RETCODE dbcursorinfo(DBCURSOR * hc, DBINT * ncols, DBINT * nrows);
00512 DBCURSOR *dbcursoropen(DBPROCESS * dbprocess, BYTE * stmt, SHORT scollopt, SHORT concuropt, USHORT nrows, DBINT * pstatus);
00513 BYTE *dbdata(DBPROCESS * dbproc, int column);
00514 int dbdate4cmp(DBPROCESS * dbprocess, DBDATETIME4 * d1, DBDATETIME4 * d2);
00515 RETCODE dbdate4zero(DBPROCESS * dbprocess, DBDATETIME4 * d1);
00516 RETCODE dbdatechar(DBPROCESS * dbprocess, char *buf, int datepart, int value);
00517 RETCODE dbdatecmp(DBPROCESS * dbproc, DBDATETIME * d1, DBDATETIME * d2);
00518 RETCODE dbdatecrack(DBPROCESS * dbproc, DBDATEREC * di, DBDATETIME * dt);
00519 int dbdatename(DBPROCESS * dbprocess, char *buf, int date, DBDATETIME * datetime);
00520 char *dateorder(DBPROCESS * dbprocess, char *language);
00521 DBINT dbdatepart(DBPROCESS * dbprocess, int datepart, DBDATETIME * datetime);
00522 RETCODE dbdatezero(DBPROCESS * dbprocess, DBDATETIME * d1);
00523 DBINT dbdatlen(DBPROCESS * dbproc, int column);
00524 char *dbdayname(DBPROCESS * dbprocess, char *language, int daynum);
00525 DBBOOL dbdead(DBPROCESS * dbproc);
00526
00527 #define DBDEAD(x) dbdead((x))
00528 EHANDLEFUNC dberrhandle(EHANDLEFUNC handler);
00529 void dbexit(void);
00530 RETCODE dbfcmd(DBPROCESS * dbproc, const char *fmt, ...);
00531 DBINT dbfirstrow(DBPROCESS * dbproc);
00532
00533 #define DBFIRSTROW(x) dbfirstrow((x))
00534 RETCODE dbfree_xlate(DBPROCESS * dbprocess, DBXLATE * xlt_tosrv, DBXLATE * clt_todisp);
00535 void dbfreebuf(DBPROCESS * dbproc);
00536 void dbfreequal(char *qualptr);
00537 RETCODE dbfreesort(DBPROCESS * dbprocess, DBSORTORDER * sortorder);
00538 char *dbgetchar(DBPROCESS * dbprocess, int n);
00539 char *dbgetcharset(DBPROCESS * dbprocess);
00540 RETCODE dbgetloginfo(DBPROCESS * dbprocess, DBLOGINFO ** loginfo);
00541 int dbgetlusername(LOGINREC * login, BYTE * name_buffer, int buffer_len);
00542 int dbgetmaxprocs(void);
00543 char *dbgetnatlanf(DBPROCESS * dbprocess);
00544 int dbgetoff(DBPROCESS * dbprocess, DBUSMALLINT offtype, int startfrom);
00545 int dbgetpacket(DBPROCESS * dbproc);
00546 RETCODE dbgetrow(DBPROCESS * dbproc, DBINT row);
00547 int dbgettime(void);
00548 #define DBGETTIME dbgettime
00549 BYTE *dbgetuserdata(DBPROCESS * dbproc);
00550 DBBOOL dbhasretstat(DBPROCESS * dbproc);
00551 RETCODE dbinit(void);
00552 int dbiordesc(DBPROCESS * dbproc);
00553
00554 #define DBIORDESC(x) dbiordesc((x))
00555 int dbiowdesc(DBPROCESS * dbproc);
00556
00557 #define DBIOWDESC(x) dbiowdesc((x))
00558 DBBOOL dbisavail(DBPROCESS * dbprocess);
00559
00560 #define DBISAVAIL(x) dbisavail((x))
00561 DBBOOL dbisopt(DBPROCESS * dbproc, int option, char *param);
00562 DBINT dblastrow(DBPROCESS * dbproc);
00563
00564 #define DBLASTROW(x) dblastrow((x))
00565 RETCODE dbload_xlate(DBPROCESS * dbprocess, char *srv_charset, char *clt_name, DBXLATE ** xlt_tosrv, DBXLATE ** xlt_todisp);
00566 DBSORTORDER *dbloadsort(DBPROCESS * dbprocess);
00567 LOGINREC *dblogin(void);
00568 void dbloginfree(LOGINREC * login);
00569 RETCODE dbmny4add(DBPROCESS * dbproc, DBMONEY4 * m1, DBMONEY4 * m2, DBMONEY4 * sum);
00570 int dbmny4cmp(DBPROCESS * dbproc, DBMONEY4 * m1, DBMONEY4 * m2);
00571 RETCODE dbmny4copy(DBPROCESS * dbprocess, DBMONEY4 * m1, DBMONEY4 * m2);
00572 RETCODE dbmny4divide(DBPROCESS * dbproc, DBMONEY4 * m1, DBMONEY4 * m2, DBMONEY4 * quotient);
00573 RETCODE dbmny4minus(DBPROCESS * dbproc, DBMONEY4 * src, DBMONEY4 * dest);
00574 RETCODE dbmny4mul(DBPROCESS * dbproc, DBMONEY4 * m1, DBMONEY4 * m2, DBMONEY4 * prod);
00575 RETCODE dbmny4sub(DBPROCESS * dbproc, DBMONEY4 * m1, DBMONEY4 * m2, DBMONEY4 * diff);
00576 RETCODE dbmny4zero(DBPROCESS * dbproc, DBMONEY4 * dest);
00577 RETCODE dbmnyadd(DBPROCESS * dbproc, DBMONEY * m1, DBMONEY * m2, DBMONEY * sum);
00578 int dbmnycmp(DBPROCESS * dbproc, DBMONEY * m1, DBMONEY * m2);
00579 RETCODE dbmnycopy(DBPROCESS * dbproc, DBMONEY * src, DBMONEY * dest);
00580 RETCODE dbmnydec(DBPROCESS * dbproc, DBMONEY * mnyptr);
00581 RETCODE dbmnydivide(DBPROCESS * dbproc, DBMONEY * m1, DBMONEY * m2, DBMONEY * quotient);
00582 RETCODE dbmnydown(DBPROCESS * dbproc, DBMONEY * mnyptr, int divisor, int *remainder);
00583 RETCODE dbmnyinc(DBPROCESS * dbproc, DBMONEY * mnyptr);
00584 RETCODE dbmnyinit(DBPROCESS * dbproc, DBMONEY * mnyptr, int trim, DBBOOL * negative);
00585 RETCODE dbmnymaxneg(DBPROCESS * dbproc, DBMONEY * dest);
00586 RETCODE dbmnyndigit(DBPROCESS * dbproc, DBMONEY * mnyptr, DBCHAR * value, DBBOOL * zero);
00587 RETCODE dbmnymaxpos(DBPROCESS * dbproc, DBMONEY * dest);
00588 RETCODE dbmnyminus(DBPROCESS * dbproc, DBMONEY * src, DBMONEY * dest);
00589 RETCODE dbmnymul(DBPROCESS * dbproc, DBMONEY * m1, DBMONEY * m2, DBMONEY * prod);
00590 RETCODE dbmnydigit(DBPROCESS * dbprocess, DBMONEY * m1, DBCHAR * value, DBBOOL * zero);
00591 RETCODE dbmnyscale(DBPROCESS * dbproc, DBMONEY * dest, int multiplier, int addend);
00592 RETCODE dbmnysub(DBPROCESS * dbproc, DBMONEY * m1, DBMONEY * m2, DBMONEY * diff);
00593 RETCODE dbmnyzero(DBPROCESS * dbproc, DBMONEY * dest);
00594 const char *dbmonthname(DBPROCESS * dbproc, char *language, int monthnum, DBBOOL shortform);
00595 RETCODE dbmorecmds(DBPROCESS * dbproc);
00596
00597 #define DBMORECMDS(x) dbmorecmds((x))
00598 RETCODE dbmoretext(DBPROCESS * dbproc, DBINT size, BYTE * text);
00599 MHANDLEFUNC dbmsghandle(MHANDLEFUNC handler);
00600 char *dbname(DBPROCESS * dbproc);
00601 RETCODE dbnextrow(DBPROCESS * dbproc);
00602 RETCODE dbnpcreate(DBPROCESS * dbprocess);
00603 RETCODE dbnpdefine(DBPROCESS * dbprocess, DBCHAR * procedure_name, DBSMALLINT namelen);
00604 RETCODE dbnullbind(DBPROCESS * dbproc, int column, DBINT * indicator);
00605 int dbnumalts(DBPROCESS * dbproc, int computeid);
00606 int dbnumcols(DBPROCESS * dbproc);
00607 int dbnumcompute(DBPROCESS * dbprocess);
00608 int DBNUMORDERS(DBPROCESS * dbprocess);
00609 int dbnumrets(DBPROCESS * dbproc);
00610 DBPROCESS *tdsdbopen(LOGINREC * login, const char *server, int msdblib);
00611 DBPROCESS *dbopen(LOGINREC * login, const char *server);
00612
00613 #ifdef MSDBLIB
00614 #define dbopen(x,y) tdsdbopen((x),(y), 1)
00615 #else
00616 #define dbopen(x,y) tdsdbopen((x),(y), 0)
00617 #endif
00618
00619
00620 #ifdef PHP_SYBASE_DBOPEN
00621 #undef PHP_SYBASE_DBOPEN
00622 #define PHP_SYBASE_DBOPEN dbopen
00623 #endif
00624
00625 int dbordercol(DBPROCESS * dbprocess, int order);
00626 RETCODE dbpoll(DBPROCESS * dbproc, long milliseconds, DBPROCESS ** ready_dbproc, int *return_reason);
00627 void dbprhead(DBPROCESS * dbproc);
00628 RETCODE dbprrow(DBPROCESS * dbproc);
00629 const char *dbprtype(int token);
00630 char *dbqual(DBPROCESS * dbprocess, int tabnum, char *tabname);
00631 DBBOOL DRBUF(DBPROCESS * dbprocess);
00632 DBINT dbreadpage(DBPROCESS * dbprocess, char *p_dbname, DBINT pageno, BYTE * buf);
00633 STATUS dbreadtext(DBPROCESS * dbproc, void *buf, DBINT bufsize);
00634 void dbrecftos(char *filename);
00635 RETCODE dbrecvpassthru(DBPROCESS * dbprocess, DBVOIDPTR * bufp);
00636 RETCODE dbregdrop(DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen);
00637 RETCODE dbregexec(DBPROCESS * dbproc, DBUSMALLINT options);
00638 RETCODE dbreghandle(DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen, INTFUNCPTR handler);
00639 RETCODE dbreginit(DBPROCESS * dbproc, DBCHAR * procedure_name, DBSMALLINT namelen);
00640 RETCODE dbreglist(DBPROCESS * dbproc);
00641 RETCODE dbregnowatch(DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen);
00642 RETCODE dbregparam(DBPROCESS * dbproc, char *param_name, int type, DBINT datalen, BYTE * data);
00643 RETCODE dbregwatch(DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen, DBUSMALLINT options);
00644 RETCODE dbregwatchlist(DBPROCESS * dbprocess);
00645 RETCODE dbresults(DBPROCESS * dbproc);
00646 RETCODE dbresults_r(DBPROCESS * dbproc, int recursive);
00647 BYTE *dbretdata(DBPROCESS * dbproc, int retnum);
00648 int dbretlen(DBPROCESS * dbproc, int retnum);
00649 char *dbretname(DBPROCESS * dbproc, int retnum);
00650 DBINT dbretstatus(DBPROCESS * dbproc);
00651 int dbrettype(DBPROCESS * dbproc, int retnum);
00652 RETCODE dbrows(DBPROCESS * dbproc);
00653
00654 #define DBROWS(x) dbrows((x))
00655 STATUS dbrowtype(DBPROCESS * dbprocess);
00656
00657 #define DBROWTYPE(x) dbrowtype((x))
00658 RETCODE dbrpcinit(DBPROCESS * dbproc, char *rpcname, DBSMALLINT options);
00659 RETCODE dbrpcparam(DBPROCESS * dbproc, char *paramname, BYTE status, int type, DBINT maxlen, DBINT datalen, BYTE * value);
00660 RETCODE dbrpcsend(DBPROCESS * dbproc);
00661 void dbrpwclr(LOGINREC * login);
00662 RETCODE dbrpwset(LOGINREC * login, char *srvname, char *password, int pwlen);
00663 RETCODE dbsafestr(DBPROCESS * dbproc, const char *src, DBINT srclen, char *dest, DBINT destlen, int quotetype);
00664 RETCODE *dbsechandle(DBINT type, INTFUNCPTR handler);
00665 RETCODE dbsendpassthru(DBPROCESS * dbprocess, DBVOIDPTR bufp);
00666 char *dbservcharset(DBPROCESS * dbprocess);
00667 void dbsetavail(DBPROCESS * dbprocess);
00668 void dbsetbusy(DBPROCESS * dbprocess, DB_DBBUSY_FUNC busyfunc);
00669 RETCODE dbsetdefcharset(char *charset);
00670 RETCODE dbsetdeflang(char *language);
00671 void dbsetidle(DBPROCESS * dbprocess, DB_DBIDLE_FUNC idlefunc);
00672 void dbsetifile(char *filename);
00673 void dbsetinterrupt(DBPROCESS * dbproc, DB_DBCHKINTR_FUNC chkintr, DB_DBHNDLINTR_FUNC hndlintr);
00674 RETCODE dbsetloginfo(LOGINREC * loginrec, DBLOGINFO * loginfo);
00675 RETCODE dbsetlogintime(int seconds);
00676 RETCODE dbsetmaxprocs(int maxprocs);
00677 RETCODE dbsetnull(DBPROCESS * dbprocess, int bindtype, int bindlen, BYTE * bindval);
00678 RETCODE dbsetopt(DBPROCESS * dbproc, int option, const char *char_param, int int_param);
00679 STATUS dbsetrow(DBPROCESS * dbprocess, DBINT row);
00680 RETCODE dbsettime(int seconds);
00681 void dbsetuserdata(DBPROCESS * dbproc, BYTE * ptr);
00682 RETCODE dbsetversion(DBINT version);
00683
00684 int dbspid(DBPROCESS * dbproc);
00685 RETCODE dbspr1row(DBPROCESS * dbproc, char *buffer, DBINT buf_len);
00686 DBINT dbspr1rowlen(DBPROCESS * dbproc);
00687 RETCODE dbsprhead(DBPROCESS * dbproc, char *buffer, DBINT buf_len);
00688 RETCODE dbsprline(DBPROCESS * dbproc, char *buffer, DBINT buf_len, DBCHAR line_char);
00689 RETCODE dbsqlexec(DBPROCESS * dbproc);
00690 RETCODE dbsqlok(DBPROCESS * dbproc);
00691 RETCODE dbsqlsend(DBPROCESS * dbproc);
00692 int dbstrbuild(DBPROCESS * dbproc, char *charbuf, int bufsize, char *text, char *formats, ...);
00693 int dbstrcmp(DBPROCESS * dbprocess, char *s1, int l1, char *s2, int l2, DBSORTORDER * sort);
00694 RETCODE dbstrcpy(DBPROCESS * dbproc, int start, int numbytes, char *dest);
00695 int dbstrlen(DBPROCESS * dbproc);
00696 int dbstrsort(DBPROCESS * dbprocess, char *s1, int l1, char *s2, int l2, DBSORTORDER * sort);
00697 DBBOOL dbtabbrowse(DBPROCESS * dbprocess, int tabnum);
00698 int dbtabcount(DBPROCESS * dbprocess);
00699 char *dbtabname(DBPROCESS * dbprocess, int tabnum);
00700 char *dbtabsoruce(DBPROCESS * dbprocess, int colnum, int *tabnum);
00701 DBINT dbvarylen(DBPROCESS * dbproc, int column);
00702
00703 #define SYBEICONVIU 2400
00704 #define SYBEICONVAVAIL 2401
00705 #define SYBEICONVO 2402
00706 #define SYBEICONVI 2403
00707 #define SYBEICONV2BIG 2404
00708
00709
00710 #define SYBETDSVER 2410
00711 #define SYBESYNC 20001
00712 #define SYBEFCON 20002
00713 #define SYBETIME 20003
00714 #define SYBEREAD 20004
00715 #define SYBEBUFL 20005
00716 #define SYBEWRIT 20006
00717 #define SYBEVMS 20007
00718 #define SYBESOCK 20008
00719 #define SYBECONN 20009
00720 #define SYBEMEM 20010
00721 #define SYBEDBPS 20011
00722 #define SYBEINTF 20012
00723 #define SYBEUHST 20013
00724 #define SYBEPWD 20014
00725 #define SYBEOPIN 20015
00726 #define SYBEINLN 20016
00727 #define SYBESEOF 20017
00728 #define SYBESMSG 20018
00729 #define SYBERPND 20019
00730 #define SYBEBTOK 20020
00731 #define SYBEITIM 20021
00732 #define SYBEOOB 20022
00733 #define SYBEBTYP 20023
00734 #define SYBEBNCR 20024
00735 #define SYBEIICL 20025
00736 #define SYBECNOR 20026
00737 #define SYBENPRM 20027
00738 #define SYBEUVDT 20028
00739 #define SYBEUFDT 20029
00740 #define SYBEWAID 20030
00741 #define SYBECDNS 20031
00742 #define SYBEABNC 20032
00743 #define SYBEABMT 20033
00744 #define SYBEABNP 20034
00745 #define SYBEAAMT 20035
00746 #define SYBENXID 20036
00747 #define SYBERXID 20037
00748 #define SYBEICN 20038
00749 #define SYBENMOB 20039
00750 #define SYBEAPUT 20040
00751 #define SYBEASNL 20041
00752 #define SYBENTLL 20042
00753 #define SYBEASUL 20043
00754 #define SYBERDNR 20044
00755 #define SYBENSIP 20045
00756 #define SYBEABNV 20046
00757 #define SYBEDDNE 20047
00758 #define SYBECUFL 20048
00759 #define SYBECOFL 20049
00760 #define SYBECSYN 20050
00761 #define SYBECLPR 20051
00762 #define SYBECNOV 20052
00763 #define SYBERDCN 20053
00764 #define SYBESFOV 20054
00765 #define SYBEUNT 20055
00766 #define SYBECLOS 20056
00767 #define SYBEUAVE 20057
00768 #define SYBEUSCT 20058
00769 #define SYBEEQVA 20059
00770 #define SYBEUDTY 20060
00771 #define SYBETSIT 20061
00772 #define SYBEAUTN 20062
00773 #define SYBEBDIO 20063
00774 #define SYBEBCNT 20064
00775 #define SYBEIFNB 20065
00776 #define SYBETTS 20066
00777 #define SYBEKBCO 20067
00778 #define SYBEBBCI 20068
00779 #define SYBEKBCI 20069
00780 #define SYBEBCRE 20070
00781 #define SYBETPTN 20071
00782 #define SYBEBCWE 20072
00783 #define SYBEBCNN 20073
00784 #define SYBEBCOR 20074
00785 #define SYBEBCIS 20075
00786 #define SYBEBCPI 20076
00787 #define SYBEBCPN 20077
00788 #define SYBEBCPB 20078
00789 #define SYBEVDPT 20079
00790 #define SYBEBIVI 20080
00791 #define SYBEBCBC 20081
00792 #define SYBEBCFO 20082
00793 #define SYBEBCVH 20083
00794 #define SYBEBCUO 20084
00795 #define SYBEBCUC 20085
00796 #define SYBEBUOE 20086
00797 #define SYBEBUCE 20087
00798 #define SYBEBWEF 20088
00799 #define SYBEASTF 20089
00800 #define SYBEUACS 20090
00801 #define SYBEASEC 20091
00802 #define SYBETMTD 20092
00803 #define SYBENTTN 20093
00804 #define SYBEDNTI 20094
00805 #define SYBEBTMT 20095
00806 #define SYBEORPF 20096
00807 #define SYBEUVBF 20097
00808 #define SYBEBUOF 20098
00809 #define SYBEBUCF 20099
00810 #define SYBEBRFF 20100
00811 #define SYBEBWFF 20101
00812 #define SYBEBUDF 20102
00813 #define SYBEBIHC 20103
00814 #define SYBEBEOF 20104
00815 #define SYBEBCNL 20105
00816 #define SYBEBCSI 20106
00817 #define SYBEBCIT 20107
00818 #define SYBEBCSA 20108
00819 #define SYBENULL 20109
00820 #define SYBEUNAM 20110
00821 #define SYBEBCRO 20111
00822 #define SYBEMPLL 20112
00823 #define SYBERPIL 20113
00824 #define SYBERPUL 20114
00825 #define SYBEUNOP 20115
00826 #define SYBECRNC 20116
00827 #define SYBERTCC 20117
00828 #define SYBERTSC 20118
00829 #define SYBEUCRR 20119
00830 #define SYBERPNA 20120
00831 #define SYBEOPNA 20121
00832 #define SYBEFGTL 20122
00833 #define SYBECWLL 20123
00834 #define SYBEUFDS 20124
00835 #define SYBEUCPT 20125
00836 #define SYBETMCF 20126
00837 #define SYBEAICF 20127
00838 #define SYBEADST 20128
00839 #define SYBEALTT 20129
00840 #define SYBEAPCT 20130
00841 #define SYBEXOCI 20131
00842 #define SYBEFSHD 20132
00843 #define SYBEAOLF 20133
00844 #define SYBEARDI 20134
00845 #define SYBEURCI 20135
00846 #define SYBEARDL 20136
00847 #define SYBEURMI 20137
00848 #define SYBEUREM 20138
00849 #define SYBEURES 20139
00850 #define SYBEUREI 20140
00851 #define SYBEOREN 20141
00852 #define SYBEISOI 20142
00853 #define SYBEIDCL 20143
00854 #define SYBEIMCL 20144
00855 #define SYBEIFCL 20145
00856 #define SYBEUTDS 20146
00857 #define SYBEBUFF 20147
00858 #define SYBEACNV 20148
00859 #define SYBEDPOR 20149
00860 #define SYBENDC 20150
00861 #define SYBEMVOR 20151
00862 #define SYBEDVOR 20152
00863 #define SYBENBVP 20153
00864 #define SYBESPID 20154
00865 #define SYBENDTP 20155
00866 #define SYBEXTN 20156
00867 #define SYBEXTDN 20157
00868 #define SYBEXTSN 20158
00869 #define SYBENUM 20159
00870 #define SYBETYPE 20160
00871 #define SYBEGENOS 20161
00872 #define SYBEPAGE 20162
00873 #define SYBEOPTNO 20163
00874 #define SYBEETD 20164
00875 #define SYBERTYPE 20165
00876 #define SYBERFILE 20166
00877 #define SYBEFMODE 20167
00878 #define SYBESLCT 20168
00879 #define SYBEZTXT 20169
00880 #define SYBENTST 20170
00881 #define SYBEOSSL 20171
00882 #define SYBEESSL 20172
00883 #define SYBENLNL 20173
00884 #define SYBENHAN 20174
00885 #define SYBENBUF 20175
00886 #define SYBENULP 20176
00887 #define SYBENOTI 20177
00888 #define SYBEEVOP 20178
00889 #define SYBENEHA 20179
00890 #define SYBETRAN 20180
00891 #define SYBEEVST 20181
00892 #define SYBEEINI 20182
00893 #define SYBEECRT 20183
00894 #define SYBEECAN 20184
00895 #define SYBEEUNR 20185
00896 #define SYBERPCS 20186
00897 #define SYBETPAR 20187
00898 #define SYBETEXS 20188
00899 #define SYBETRAC 20189
00900 #define SYBETRAS 20190
00901 #define SYBEPRTF 20191
00902 #define SYBETRSN 20192
00903 #define SYBEBPKS 20193
00904 #define SYBEIPV 20194
00905 #define SYBEMOV 20195
00906 #define SYBEDIVZ 20196
00907 #define SYBEASTL 20197
00908 #define SYBESEFA 20198
00909 #define SYBEPOLL 20199
00910 #define SYBENOEV 20200
00911 #define SYBEBADPK 20201
00912 #define SYBESECURE 20202
00913 #define SYBECAP 20203
00914 #define SYBEFUNC 20204
00915 #define SYBERESP 20205
00916 #define SYBEIVERS 20206
00917 #define SYBEONCE 20207
00918 #define SYBERPNULL 20208
00919 #define SYBERPTXTIM 20209
00920 #define SYBENEG 20210
00921 #define SYBELBLEN 20211
00922 #define SYBEUMSG 20212
00923 #define SYBECAPTYP 20213
00924 #define SYBEBNUM 20214
00925 #define SYBEBBL 20215
00926 #define SYBEBPREC 20216
00927 #define SYBEBSCALE 20217
00928 #define SYBECDOMAIN 20218
00929 #define SYBECINTERNAL 20219
00930 #define SYBEBTYPSRV 20220
00931 #define SYBEBCSET 20221
00932 #define SYBEFENC 20222
00933 #define SYBEFRES 20223
00934 #define SYBEISRVPREC 20224
00935 #define SYBEISRVSCL 20225
00936 #define SYBEINUMCL 20226
00937 #define SYBEIDECCL 20227
00938 #define SYBEBCMTXT 20228
00939 #define SYBEBCPREC 20229
00940 #define SYBEBCBNPR 20230
00941 #define SYBEBCBNTYP 20231
00942 #define SYBEBCSNTYP 20232
00943 #define SYBEBCPCTYP 20233
00944 #define SYBEBCVLEN 20234
00945 #define SYBEBCHLEN 20235
00946 #define SYBEBCBPREF 20236
00947 #define SYBEBCPREF 20237
00948 #define SYBEBCITBNM 20238
00949 #define SYBEBCITBLEN 20239
00950 #define SYBEBCSNDROW 20240
00951 #define SYBEBPROCOL 20241
00952 #define SYBEBPRODEF 20242
00953 #define SYBEBPRONUMDEF 20243
00954 #define SYBEBPRODEFID 20244
00955 #define SYBEBPRONODEF 20245
00956 #define SYBEBPRODEFTYP 20246
00957 #define SYBEBPROEXTDEF 20247
00958 #define SYBEBPROEXTRES 20248
00959 #define SYBEBPROBADDEF 20249
00960 #define SYBEBPROBADTYP 20250
00961 #define SYBEBPROBADLEN 20251
00962 #define SYBEBPROBADPREC 20252
00963 #define SYBEBPROBADSCL 20253
00964 #define SYBEBADTYPE 20254
00965 #define SYBECRSNORES 20255
00966 #define SYBECRSNOIND 20256
00967 #define SYBECRSVIEW 20257
00968 #define SYBECRSVIIND 20258
00969 #define SYBECRSORD 20259
00970 #define SYBECRSBUFR 20260
00971 #define SYBECRSNOFREE 20261
00972 #define SYBECRSDIS 20262
00973 #define SYBECRSAGR 20263
00974 #define SYBECRSFRAND 20264
00975 #define SYBECRSFLAST 20265
00976 #define SYBECRSBROL 20266
00977 #define SYBECRSFROWN 20267
00978 #define SYBECRSBSKEY 20268
00979 #define SYBECRSRO 20269
00980 #define SYBECRSNOCOUNT 20270
00981 #define SYBECRSTAB 20271
00982 #define SYBECRSUPDNB 20272
00983 #define SYBECRSNOWHERE 20273
00984 #define SYBECRSSET 20274
00985 #define SYBECRSUPDTAB 20275
00986 #define SYBECRSNOUPD 20276
00987 #define SYBECRSINV 20277
00988 #define SYBECRSNOKEYS 20278
00989 #define SYBECRSNOBIND 20279
00990 #define SYBECRSFTYPE 20280
00991 #define SYBECRSINVALID 20281
00992 #define SYBECRSMROWS 20282
00993 #define SYBECRSNROWS 20283
00994 #define SYBECRSNOLEN 20284
00995 #define SYBECRSNOPTCC 20285
00996 #define SYBECRSNORDER 20286
00997 #define SYBECRSNOTABLE 20287
00998 #define SYBECRSNUNIQUE 20288
00999 #define SYBECRSVAR 20289
01000 #define SYBENOVALUE 20290
01001 #define SYBEVOIDRET 20291
01002 #define SYBECLOSEIN 20292
01003 #define SYBEBOOL 20293
01004 #define SYBEBCPOPT 20294
01005 #define SYBEERRLABEL 20295
01006 #define SYBEATTNACK 20296
01007 #define SYBEBBFL 20297
01008 #define SYBEDCL 20298
01009 #define SYBECS 20299
01010 #define SYBEBULKINSERT 20599
01011
01012 int dbtds(DBPROCESS * dbprocess);
01013
01014 #define DBTDS(a) dbtds(a)
01015 DBINT dbtextsize(DBPROCESS * dbprocess);
01016 int dbtsnewlen(DBPROCESS * dbprocess);
01017 DBBINARY *dbtsnewval(DBPROCESS * dbprocess);
01018 RETCODE dbtsput(DBPROCESS * dbprocess, DBBINARY * newts, int newtslen, int tabnum, char *tabname);
01019 DBBINARY *dbtxptr(DBPROCESS * dbproc, int column);
01020 DBBINARY *dbtxtimestamp(DBPROCESS * dbproc, int column);
01021 DBBINARY *dbtxtsnewval(DBPROCESS * dbprocess);
01022 RETCODE dbtxtsput(DBPROCESS * dbprocess, DBBINARY newtxts, int colnum);
01023 RETCODE dbuse(DBPROCESS * dbproc, const char *name);
01024 const char *dbversion(void);
01025 DBBOOL dbwillconvert(int srctype, int desttype);
01026 RETCODE dbwritepage(DBPROCESS * dbprocess, char *p_dbname, DBINT pageno, DBINT size, BYTE * buf);
01027 RETCODE dbwritetext(DBPROCESS * dbproc, char *objname, DBBINARY * textptr, DBTINYINT textptrlen, DBBINARY * timestamp,
01028 DBBOOL log, DBINT size, BYTE * text);
01029 int dbxlate(DBPROCESS * dbprocess, char *src, int srclen, char *dest, int destlen, DBXLATE * xlt, int *srcbytes_used,
01030 DBBOOL srcend, int status);
01031
01032
01033 RETCODE dbsetlname(LOGINREC * login, const char *value, int which);
01034 RETCODE dbsetlbool(LOGINREC * login, int value, int which);
01035 RETCODE dbsetlshort(LOGINREC * login, int value, int which);
01036 RETCODE dbsetllong(LOGINREC * login, long value, int which);
01037 RETCODE dbsetlversion (LOGINREC * login, BYTE version);
01038
01039 #define DBSETHOST 1
01040 #define DBSETLHOST(x,y) dbsetlname((x), (y), DBSETHOST)
01041 #define dbsetlhost(x,y) dbsetlname((x), (y), DBSETHOST)
01042 #define DBSETUSER 2
01043 #define DBSETLUSER(x,y) dbsetlname((x), (y), DBSETUSER)
01044 #define dbsetluser(x,y) dbsetlname((x), (y), DBSETUSER)
01045 #define DBSETPWD 3
01046 #define DBSETLPWD(x,y) dbsetlname((x), (y), DBSETPWD)
01047 #define dbsetlpwd(x,y) dbsetlname((x), (y), DBSETPWD)
01048 #define DBSETHID 4
01049 #define DBSETLHID(x,y) dbsetlname((x), (y), DBSETHID)
01050 #define DBSETAPP 5
01051 #define DBSETLAPP(x,y) dbsetlname((x), (y), DBSETAPP)
01052 #define dbsetlapp(x,y) dbsetlname((x), (y), DBSETAPP)
01053 #define DBSETBCP 6
01054 #define BCP_SETL(x,y) dbsetlbool((x), (y), DBSETBCP)
01055 #define DBSETNATLANG 7
01056 #define DBSETLNATLANG(x,y) dbsetlname((x), (y), DBSETNATLANG)
01057 #define dbsetlnatlang(x,y) dbsetlname((x), (y), DBSETNATLANG)
01058 #define DBSETNOSHORT 8
01059 #define DBSETLNOSHORT(x,y) dbsetlbool((x), (y), DBSETNOSHORT)
01060 #define DBSETHIER 9
01061 #define DBSETLHIER(x,y) dbsetlshort((x), (y), DBSETHIER)
01062 #define DBSETCHARSET 10
01063 #define DBSETLCHARSET(x,y) dbsetlname((x), (y), DBSETCHARSET)
01064 #define DBSETPACKET 11
01065 #define DBSETLPACKET(x,y) dbsetllong((x), (y), DBSETPACKET)
01066 #define dbsetlpacket(x,y) dbsetllong((x), (y), DBSETPACKET)
01067 #define DBSETENCRYPT 12
01068 #define DBSETLENCRYPT(x,y) dbsetlbool((x), (y), DBSETENCRYPT)
01069 #define DBSETLABELED 13
01070 #define DBSETLLABELED(x,y) dbsetlbool((x), (y), DBSETLABELED)
01071 #define BCP_SETLABELED(x,y) dbsetlbool((x), (y), DBSETLABELED)
01072 #define DBSETLVERSION(login, version) dbsetlversion((login), (version))
01073
01074 RETCODE bcp_init(DBPROCESS * dbproc, const char *tblname, const char *hfile, const char *errfile, int direction);
01075 RETCODE bcp_done(DBPROCESS * dbproc);
01076
01077 RETCODE bcp_batch(DBPROCESS * dbproc);
01078 RETCODE bcp_bind(DBPROCESS * dbproc, BYTE * varaddr, int prefixlen, DBINT varlen, BYTE * terminator, int termlen, int type,
01079 int table_column);
01080 RETCODE bcp_collen(DBPROCESS * dbproc, DBINT varlen, int table_column);
01081 RETCODE bcp_columns(DBPROCESS * dbproc, int host_colcount);
01082 RETCODE bcp_colfmt(DBPROCESS * dbproc, int host_column, int host_type, int host_prefixlen, DBINT host_collen,
01083 const BYTE * host_term, int host_termlen, int colnum);
01084 RETCODE bcp_colfmt_ps(DBPROCESS * dbproc, int host_column, int host_type, int host_prefixlen, DBINT host_collen,
01085 BYTE * host_term, int host_termlen, int colnum, DBTYPEINFO * typeinfo);
01086 RETCODE bcp_colptr(DBPROCESS * dbproc, BYTE * colptr, int table_column);
01087 RETCODE bcp_control(DBPROCESS * dbproc, int field, DBINT value);
01088 int bcp_getbatchsize(DBPROCESS * dbproc);
01089 RETCODE bcp_exec(DBPROCESS * dbproc, DBINT * rows_copied);
01090 DBBOOL bcp_getl(LOGINREC * login);
01091 RETCODE bcp_moretext(DBPROCESS * dbproc, DBINT size, BYTE * text);
01092 RETCODE bcp_options(DBPROCESS * dbproc, int option, BYTE * value, int valuelen);
01093 RETCODE bcp_readfmt(DBPROCESS * dbproc, char *filename);
01094 RETCODE bcp_sendrow(DBPROCESS * dbproc);
01095 RETCODE bcp_writefmt(DBPROCESS * dbproc, char *filename);
01096
01097 void build_xact_string(char *xact_name, char *service_name, DBINT commid, char *result);
01098 RETCODE remove_xact(DBPROCESS * connect, DBINT commid, int n);
01099 RETCODE abort_xact(DBPROCESS * connect, DBINT commid);
01100 void close_commit(DBPROCESS * connect);
01101 RETCODE commit_xact(DBPROCESS * connect, DBINT commid);
01102 DBPROCESS *open_commit(LOGINREC * login, char *servername);
01103 RETCODE scan_xact(DBPROCESS * connect, DBINT commid);
01104 DBINT start_xact(DBPROCESS * connect, char *application_name, char *xact_name, int site_count);
01105 DBINT stat_xact(DBPROCESS * connect, DBINT commid);
01106
01107 #ifdef __cplusplus
01108 #if 0
01109 {
01110 #endif
01111 }
01112 #endif
01113
01114 #endif