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