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