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