home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a063 / 7.img / INCLUDE / FSDB.H next >
Encoding:
C/C++ Source or Header  |  1991-04-01  |  65.8 KB  |  1,535 lines

  1.  
  2. /*
  3. **      fsdb.h:        34.1    5/10/88
  4. **
  5. **  FSDB.H - Header file for DBLIB routines.
  6. **      The main data structure in DBLIB is the DBPROCESS structure.
  7. **      It keeps all the information about a particular host-dataserver
  8. **      connection.
  9. **
  10. **      Sybase DB-LIBRARY Version 2.0
  11. **      Confidential Property of Sybase, Inc.
  12. **      (c) Copyright Sybase, Inc. 1985, 1986
  13. **      All rights reserved
  14. */
  15.  
  16. #ifndef _FSDB_H_
  17. #define _FSDB_H_ 1
  18.  
  19.  
  20. /* This section added for installable networks. */
  21. #define CONNECTIONOBJECTSIZE        0
  22. #define CONNECTIONREAD             1
  23. #define CONNECTIONWRITE            2
  24. #define CONNECTIONTRANSACT        3
  25. #define CONNECTIONWRITEOOB        4
  26. #define CONNECTIONMODE            5
  27. #define CONNECTIONSTATUS        6
  28. #define CONNECTIONOPEN            7
  29. #define CONNECTIONCLOSE            8
  30. #define CONNECTIONCHECKFORDATA        9
  31. #define DBNETCOUNT            10
  32. typedef long (far pascal *LGFARPROC)();
  33. #define PASCALENTRY pascal far
  34.  
  35. /* temporarily undef ABS since there is one in sybdbtok.h */
  36. #ifdef  ABS
  37.     #undef  ABS
  38. #endif  /* ABS */
  39.  
  40. #include        <sybdbtok.h>
  41.  
  42. #ifdef  ABS
  43.     #undef  ABS
  44. #endif  /* ABS */
  45. #if (MSDOS || OS2) /* Allows us to use intrinsic functions */
  46.     #define ABS(a) abs(a)
  47. #else
  48.     #define ABS(a)          ((a) > 0 ? (a) : -(a))
  49. #endif /* MSDOS or OS2 */
  50.  
  51. /* affects DBZEROSPACE */
  52.  
  53. #if (MSDOS || OS2) /* Allows us to use intrinsic functions */
  54.     #define BZERO(c, l) memset(c, 0, l)
  55. #else
  56.     #define BZERO(c, l) bzero(c, l)
  57. #endif /* VMS or MSDOS or OS2 */
  58.  
  59. /*
  60. **  Status code for dbnextrow() and dbgetrow().
  61. **  Return of > 0 indicates ALTROW.
  62. **  FAIL is another possible return.
  63. */
  64. #define MORE_ROWS       (DBINT)(-1)
  65. #define NO_MORE_ROWS    (DBINT)(-2)
  66. #define REG_ROW         MORE_ROWS
  67. #define BUF_FULL        (DBINT)(-3)
  68.  
  69. /*
  70. **  Status code for dbresults(). Possible return values are
  71. **  SUCCEED, FAIL, and NO_MORE_RESULTS.
  72. */
  73. #define NO_MORE_RESULTS 2
  74.  
  75. /*
  76. **  Return code for message-handlers. Indicates whether or not the handler
  77. **  wants DB-LIBRARY to buffer the current Server message for later use
  78. **  by the program.
  79. */
  80. #define DBSAVE          1
  81. #define DBNOSAVE        0
  82.  
  83. #define DBNOERR         -1
  84.  
  85. /*
  86. ** Default size of row buffer.  This is what people get if they do
  87. ** a dbsetopt(dbproc, DBBUFFER, 0).
  88. */
  89. #define DBBUFSIZE       1000
  90.  
  91. /* The size of a SYBTEXT timestamp, in bytes. This timestamp is not to be
  92.  * confused with a browse-mode timestamp.
  93.  */
  94. #define DBTXTSLEN       8
  95.  
  96. /*
  97. ** this is defined in the Dataserver server.h but it has alot of other 
  98. ** stuff that we don't want.
  99. */
  100. #define MAXNAME 30
  101.  
  102. #include        <syblogin.h>
  103.  
  104. #define DBMAXCOLNAME    30
  105. #define DBMAXBYLIST     16
  106.  
  107. /* maximum printing lengths for fixed-length data */
  108. #define PRINT4  11
  109. #define PRINT2  6
  110. #define PRINT1  3
  111. #define PRFLT8  20
  112. #define PRMONEY 24
  113. #define PRBIT   1
  114. #define PRDATETIME      20
  115.  
  116. #define TINYBIND        1
  117. #define SMALLBIND       2
  118. #define INTBIND         3
  119. #define CHARBIND        4
  120. #define TEXTBIND        5
  121. #define BINARYBIND      6
  122. #define ARRAYBIND       7
  123. #define BITBIND         8
  124. #define DATETIMEBIND    9
  125. #define MONEYBIND       10
  126. #define FLT8BIND        11
  127. #define STRINGBIND      12
  128. #define NTBSTRINGBIND   13
  129. #define VARYCHARBIND    14
  130. #define VARYBINBIND     15
  131. #define RESERVE1BIND    16
  132. #define RESERVE2BIND    17
  133. #define MAXBIND         VARYBINBIND
  134.  
  135.  
  136.  
  137. /*
  138. **  typedef DATE - date format
  139. */
  140. #ifndef SERVER
  141. typedef struct date
  142. {
  143.         long    dtdays;         /* number of days since 1/1/1900 */
  144.         long    dttime;         /* number 300th second since mid */
  145. } DATE;
  146. #endif
  147.  
  148. #ifndef _DATEPARTS_
  149. #    define _DATEPARTS_    1
  150.  
  151. typedef struct dateparts
  152. {
  153.         short   dateyear;       /* 1900 to the future */
  154.         short   datemonth;      /* 0 - 11 */
  155.         short   datedmonth;     /* 1 - 31 */
  156.         short   datedyear;      /* 1 - 366 */
  157.         short   datedweek;      /* 0 - 6 */
  158.         short   datehour;       /* 0 - 23 */
  159.         short   dateminute;     /* 0 - 59 */
  160.         short   datesecond;     /* 0 - 59 */
  161.         short   datemsecond;    /* 0 - 997 */
  162.         short   datetzone;      /* 0 - 127 */
  163. } DATEPARTS;
  164.  
  165. #endif /* If not defined _DATEPARTS_ */
  166.  
  167. #ifndef SERVER
  168. typedef struct mony
  169. {
  170.         long            mnyhigh;
  171.         unsigned long   mnylow;
  172. } MONY;
  173.  
  174. # define mnyzero(m) {(m)->mnyhigh = 0; (m)->mnylow = 0;}
  175. #endif
  176.  
  177.  
  178. /*
  179. ** From pss.h DataServer structure.
  180. */
  181. /* Donepacket status bit defs go here */
  182. # define DONE_CONT      (DBUSMALLINT) 0x1       
  183. # define DONE_ERROR     (DBUSMALLINT) 0x2
  184. # define DONE_INXACT    (DBUSMALLINT) 0x4
  185. # define DONE_PROC      (DBUSMALLINT) 0x8
  186. # define DONE_COUNT     (DBUSMALLINT) 0x10
  187. # define DONE_ATTN      (DBUSMALLINT) 0x20
  188.  
  189. /*
  190. **    OFFSETS DEFINITIONS
  191. **
  192. **    These are a subset of the token values for offset information.
  193. **    These defines come from y.tab.h
  194. **
  195. */
  196. # define _ID 290
  197. # define _VARIABLE 291
  198. # define _STRING 292
  199. # define _BINARY 295
  200. # define _LABEL 296
  201. # define _INTEGER 293
  202. # define _REAL 294
  203. # define _MONEY 297
  204. # define _START 299
  205. # define _REQJOIN 280
  206. # define _LEQJOIN 281
  207. # define _MINKEYWORD 300
  208. # define _ADD 445
  209. # define _ALL 300
  210. # define _ALTER 444
  211. # define _AND 301
  212. # define _ANY 302
  213. # define _AS 305
  214. # define _ASC 306
  215. # define _AVG 307
  216. # define _BEGIN 385
  217. # define _BETWEEN 308
  218. # define _BREAK 408
  219. # define _BROWSE 309
  220. # define _BULK 430
  221. # define _BY 310
  222. # define _CHARINDEX 434
  223. # define _CHECKPOINT 400
  224. # define _CLUSTERED 311
  225. # define _COL_LENGTH 433
  226. # define _COL_NAME 332
  227. # define _COMMIT 458
  228. # define _COMPUTE 313
  229. # define _CONFIRM 314
  230. # define _CONTINUE 412
  231. # define _CONTROLROW 315
  232. # define _CONVERT 447
  233. # define _COUNT 316
  234. # define _CREATE 317
  235. # define _DATABASE 318
  236. # define _DATEADD 439
  237. # define _DATEDIFF 440
  238. # define _DATENAME 441
  239. # define _DATEPART 442
  240. # define _DBCC 399
  241. # define _DB_ID 428
  242. # define _DB_NAME 429
  243. # define _DEBUG 398
  244. # define _DECLARE 404
  245. # define _DEFAULT 402
  246. # define _DEFINE 319
  247. # define _DELETE 320
  248. # define _DESC 321
  249. # define _DISK 460
  250. # define _DISTINCT 322
  251. # define _DROP 323
  252. # define _DUMMY 324
  253. # define _DUMP 390
  254. # define _ELSE 406
  255. # define _END 386
  256. # define _ERRLVL 328
  257. # define _ERROREXIT 453
  258. # define _EXECUTE 330
  259. # define _EXISTS 331
  260. # define _EXIT 411
  261. # define _FILLFACTOR 333
  262. # define _FOR 419
  263. # define _FROM 335
  264. # define _GETDATE 443
  265. # define _GETDEFAULT 432
  266. # define _GOTO 409
  267. # define _GRANT 336
  268. # define _GROUP 337
  269. # define _HAVING 338
  270. # define _HOLDLOCK 413
  271. # define _HOST_ID 426
  272. # define _HOST_NAME 427
  273. # define _IF 405
  274. # define _IN 341
  275. # define _INDEX 342
  276. # define _INDEX_KEY 437
  277. # define _INSERT 343
  278. # define _INTO 344
  279. # define _IS 382
  280. # define _ISNULL 436
  281. # define _KILL 463
  282. # define _LIKE 438
  283. # define _LINENO 345
  284. # define _LOAD 391
  285. # define _LOG 393
  286. # define _MAX 346
  287. # define _MIN 347
  288. # define _NONCLUSTERED 349
  289. # define _NOT 350
  290. # define _NULL 351
  291. # define _OBJECT_ID 372
  292. # define _OBJECT_NAME 373
  293. # define _OFF 352
  294. # define _OFFSETS 353
  295. # define _ON 354
  296. # define _ONCE 355
  297. # define _OR 356
  298. # define _ORDER 357
  299. # define _OVER 359
  300. # define _PARAM 452
  301. # define _PERMANENT 361
  302. # define _PREPARE 455
  303. # define _PRINT 464
  304. # define _PROCEDURE 362
  305. # define _PROCESSEXIT 454
  306. # define _PUBLIC 421
  307. # define _RAISERROR 465
  308. # define _RECONFIGURE 461
  309. # define _RETURN 410
  310. # define _REVOKE 420
  311. # define _ROLLBACK 387
  312. # define _ROWCOUNT 466
  313. # define _RULE 401
  314. # define _SAVE 388
  315. # define _SELECT 365
  316. # define _SET 366
  317. # define _SETUSER 462
  318. # define _STATEMENT 459
  319. # define _STATISTICS 431
  320. # define _SUBSTRING 435
  321. # define _SUM 370
  322. # define _SUSER_ID 424
  323. # define _SUSER_NAME 425
  324. # define _TABLE 371
  325. # define _TAPE 395
  326. # define _TEMPORARY 374
  327. # define _TO 394
  328. # define _TRANSACTION 389
  329. # define _TRIGGER 418
  330. # define _TRUNCATE 392
  331. # define _UNIQUE 375
  332. # define _UPDATE 376
  333. # define _USE 377
  334. # define _USER_ID 422
  335. # define _USER_NAME 423
  336. # define _VALUES 378
  337. # define _VIEW 379
  338. # define _WAITFOR 450
  339. # define _WHERE 380
  340. # define _WHILE 407
  341. # define _WITH 381
  342. /* end y.tab.h */
  343.  
  344. /*
  345. ** HOSTSERVER.h - structures and defines for communicating with server
  346. **
  347. */
  348.  
  349. /*
  350. ** Data structure used to store all available networks.
  351. */
  352. typedef struct net_list
  353. {
  354.     char    *comm_type;    /* Communication tyep specifier    */
  355.     RETCODE    (*netopen)();    /* Network open routine        */
  356.     DBINT    (*netread)();    /* Network read routine        */
  357.     DBINT    (*netwrite)();    /* Network write routine    */
  358.     RETCODE    (*netclose)();    /* Network close routine    */
  359.     RETCODE    (*netattn)();    /* Network attention (OOB)    */
  360.  
  361.     struct net_list *next;    /* Pointer to the next struct int the
  362.                 ** linked list.
  363.                 */
  364. } NETACCESS;
  365. /*
  366. ** Data structure used by both send and recv
  367. */
  368. typedef struct servbuf
  369. {
  370.         unsigned char   *serv_snb;      /* send: next place in buffer */
  371.         unsigned char   *serv_sbuf;     /* send: start of send buffer */
  372.         int             serv_sleft;     /* send: room left in send buffer */
  373.         int             serv_sbsize;    /* send: buffer size */
  374.         int             serv_snum;      /* send # for network */
  375.         int             serv_sstat;     /* send: status bits */
  376.         unsigned char   *serv_rnb;      /* recv: next place in buffer */
  377.         unsigned char   *serv_rbuf;     /* recv: start of recv buffer */
  378.         int             serv_rleft;     /* recv: room left in recv buffer */
  379.           int                    serv_rpleft;     /* recv: bytes left in current packet */
  380.         int             serv_rbsize;    /* recv: buffer size */
  381.         int             serv_rnum;      /* recv # for network */
  382.         int             serv_rstat;     /* recv: status bits */
  383.         int             serv_commtype;  /* communications type (tcp, etc.) */
  384. /* Changed removed network functions */
  385. #if OS2
  386.             unsigned short            hDbNet;
  387.             LGFARPROC        ConnectionFunctions[DBNETCOUNT];
  388. #endif
  389.     char        *netdata1;    /* User data pointers to be */
  390.     char        *netdata2;    /* associated with a dbproc */
  391. } SERVBUF;
  392.  
  393.  
  394.  
  395. /*
  396. **  DBSTRING - This structure is just used for stringing text or parameters
  397. **      together.
  398. */
  399. struct dbstring
  400. {
  401.         BYTE    *strtext;       /* actual byte string */
  402.         DBINT   strtotlen;      /* allocated length of the byte string */
  403.         struct dbstring *strnext;
  404. };
  405. typedef struct dbstring DBSTRING;
  406.  
  407. /*
  408. **      DBROWDATA - This structure is used to hold the actual data that
  409. **      comes back for every column in every row. The DBPROCESS structure
  410. **      points to a linked-list of DBROW structures. Each DBROW strcture points
  411. **      to an array of DBROWDATA structures. Since every DBROWDATA structure
  412. **      contains pointers to separately allocated buffers, the members of
  413. **      each array are linked together in a singly-linked list, to facilitate
  414. **      the operation of simple row-freeing routines.
  415. */
  416. struct dbrowdata
  417. {
  418.         BYTE            *data;          /* actual data for this column in this
  419.                                          * row
  420.                                          */
  421.         DBINT           datlen;         /* length, in bytes, of this data */
  422.         DBBINARY        *dattxptr;      /* This data's text-ptr, if it's of
  423.                                          * type SYBTEXT.
  424.                                          */
  425.         DBTINYINT       dattxplen;      /* Length, in bytes, of the text-ptr. */
  426.         DBBINARY        dattxts[DBTXTSLEN];/* The text-timestamp of this text
  427.                                          * value.
  428.                                          */
  429.         DBTINYINT       dattxtslen;     /* Length, in bytes, of the
  430.                                          * text-timestamp.
  431.                                          */
  432.         struct dbrowdata        *datnext;
  433. };
  434. typedef struct dbrowdata        DBROWDATA;
  435.  
  436. /*
  437. **  BINDREC - This is the structure used to store information about
  438. **      which columns should be bound to which programming variables
  439. */
  440. struct  bindrec
  441. {
  442.         BYTE            *bindvar;       /* ptr to program variable */
  443.         DBINT           bindlen;        /* length of program variable */
  444.         RETCODE         (*bindproc)();  /* procedure to use for data copy. */
  445.         DBINDICATOR     *bindnullind;   /* set TRUE if NULL data was bound,
  446.                                          * FALSE otherwise.
  447.                                          */
  448. };
  449. typedef struct bindrec  BINDREC;
  450.  
  451. /*
  452. ** NULLBIND - This structure is attached to the DBPROCESS and is used
  453. **      to determine what to bind when bind values are NULL.
  454. */
  455. struct  nullbind
  456. {
  457.         DBBIT           nullbit;
  458.         DBTINYINT       nulltiny;
  459.         DBSMALLINT      nullsmall;
  460.         DBINT           nullint;
  461.         DBCHAR          *nullchar;
  462.         DBINT           nulllchar;      /* length of char string */
  463.         DBBINARY        *nullbinary;
  464.         DBINT           nulllbinary;    /* length of binary string */
  465.         DBDATETIME      nulldatetime;
  466.         DBMONEY         nullmoney;
  467.         DBFLT8          nullflt8;
  468.         DBCHAR          *nullstring;
  469.         DBCHAR          *nullntbstring;
  470.         DBVARYCHAR      nullvarychar;
  471.         DBVARYBIN       nullvarybin;
  472. };
  473. typedef struct nullbind NULLBIND;
  474.  
  475. /*
  476. **  DBCOLINFO - This structure contains the format information about a column.
  477. **      There is a linked list of DBCOLINFO structures in the DBPROCESS
  478. **      structure.  There is one DBCOLINFO structure for each column in the
  479. **      target list of the current command.  Format information for
  480. **      alternate rows, like compute, is kept in the DBALTHEAD and
  481. **      DBALTINFO structures.
  482. */
  483. struct dbcolinfo
  484. {
  485.         char    colname[DBMAXCOLNAME+1];/* column name */
  486.         BYTE    coltype;                /* column type */
  487.         DBINT   coludtype;              /* user-defined type */
  488.         DBINT   collen;                 /* max length of column */
  489.         DBINT   colprlen;               /* max printing length of column */
  490.         char    *colcontrol;            /* control format, if any */
  491.         struct bindrec  colbind;        /* binding info, if any */
  492.         int     coltable;               /* for browse mode: which table
  493.                                          * did this column come from?
  494.                                          */
  495.         BYTE            colstatus;      /* for browse mode: what kind of column
  496.                                          * is this?
  497.                                          */
  498.         char    colorigname[DBMAXCOLNAME+1];/* for browse mode: what is the name
  499.                                          * of the table column that provided
  500.                                          * this select-list member?
  501.                                          */
  502.         char    *coltxobjname;          /* the DataServer always returns the
  503.                                          * qualified object-name for TEXT
  504.                                          * columns.
  505.                                          */
  506.         struct dbcolinfo        *colnext;       /* next column */
  507. };
  508. typedef struct dbcolinfo        DBCOLINFO;
  509.  
  510. /*
  511. **  DBTABNAME - This structure contains information about the tables which
  512. **      were used to produce the current set of results. The DataServer only
  513. **      provides this info for queries that are executed in "browse mode".
  514. **
  515. **      There is a linked list of DBTABNAME structures in the DBPROCESS
  516. **      structure.  There is one DBTABNAME structure for each table used to
  517. **      produce the target list of the current command.
  518. **
  519. **      If this query was executed without "browse mode", then this list will
  520. **      have no members.
  521. */
  522. struct dbtabname
  523. {
  524.         char                    tabname[MAXNAME+1];     /* column name */
  525.         struct dbtabname        *tabnext;               /* next column */
  526. };
  527. typedef struct dbtabname        DBTABNAME;
  528.  
  529. /*
  530. **  DBRETVAL - This structure contains any data which was returned as a function
  531. **      value by the last command. Currently, "browse-mode" updates are the only
  532. **      commands which return function values.
  533. **
  534. **      There is a linked list of DBRETVAL structures in the DBPROCESS
  535. **      structure.  There is one DBRETVAL structure for each function value
  536. **      returned by the current command.
  537. **
  538. **      If this command returned no function value, this list will
  539. **      have no members.
  540. */
  541. struct dbretval
  542. {
  543.         char            retname[MAXNAME+1];     /* value name */
  544.     BYTE        retvalstat;        /* status byte */
  545.     DBINT        retusertype;        /* user type */
  546.         BYTE            rettype;                /* value type */
  547.     DBINT        retmaxlen;        /* max value len (ignored) */
  548.         DBINT           retlen;                 /* value length */
  549.         BYTE            *retdata;               /* the return-value itself. */
  550.         struct dbretval *retnext;               /* next return-value */
  551. };
  552. typedef struct dbretval DBRETVAL;
  553.  
  554. /*
  555. **  DBALTHEAD - This structure contains information for ALT rows.  ALT
  556. **      rows are COMPUTE results.  There is one DBALTHEAD for each COMPUTE
  557. **      statement.  All the COMPUTE operators in a particular COMPUTE statement
  558. **      must have the same bylist -- this is enforced by the DataServer.
  559. **      Off of each DBALTHEAD is a linked list of DBALTINFO structures that
  560. **      describe the format for each particular COMPUTE operation in the
  561. **      COMPUTE.
  562. */
  563. struct  dbalthead
  564. {
  565.         DBUSMALLINT     althid;         /* id for this COMPUTE statement */
  566.         BYTE    althalts;       /* number of DBALTINFO structures in althlist */
  567.         BYTE    althsizeby;     /* number of elements in the bylist */
  568.         BYTE    althbylist[DBMAXBYLIST];        /* colids of bylist elements */
  569.         struct dbaltinfo        *althlist;      /* linked list of DBALTINFOs */
  570.         struct dbprlist         *althprlist;    /* order print list for aops */
  571.         struct dbalthead        *althnext;      /* next dbalthead */
  572. };
  573. typedef struct dbalthead        DBALTHEAD;
  574.  
  575. /*
  576. **  DBPRLIST - This structure is used to create an 'ordered' printing list
  577. **      for computes.  For example a compute might be:
  578. **              compute sum(col1), avg(col2), sum(col2), avg(col3), avg(col1)
  579. **      For printing, it would be nice to have a list that pointed to the
  580. **      right DBALTINFO structures like this:
  581. **              sum(col1)-->sum(col2)
  582. **                |
  583. **               \|/
  584. **              avg(col1)-->avg(col2)-->avg(col3)
  585. **      It is used by the praltrow function that dbprrow uses but the
  586. **      information could be used by any DBLIB client.
  587. */
  588. struct  dbprlist
  589. {
  590.         DBROWDATA       *prdata;        /* actual data for the compute */
  591.         struct dbaltinfo        *prtarget;      /* related ALTINFO struct */
  592.         struct dbprlist         *prright;       /* next aop in compute */
  593.         struct dbprlist         *prdown;        /* next compute in query */
  594. };
  595. typedef struct dbprlist DBPRLIST;
  596.  
  597. /*
  598. **  DBALTINFO - This structure contains the format information about
  599. **      alternate rows.  Compute clauses produce alternate rows of data,
  600. **      interspersed with the regular data rows returned by the dataserver.
  601. **      There is a linked list of DBALTHEAD structures in the DBPROCESS
  602. **      structure.  There is one DBALTHEAD structure for each possible
  603. **      type of alternate row of the current command.  Format information for
  604. **      regular data rows is kept in the DBCOLINFO structure.
  605. */
  606. struct dbaltinfo
  607. {
  608.         char    *altname;       /* null terminated string to alt header */
  609.         BYTE    alttoken;       /* type of alternate information */
  610.         BYTE    altcolid;       /* which target list member referenced */
  611.         BYTE    alttype;        /* column type */
  612.         DBINT   altudtype;      /* user-defined type */
  613.         DBINT   altlen;         /* max length of column */
  614.         DBINT   altprlen;       /* printing length of data */
  615.         char    *altcontrol;            /* control format, if any */
  616.         struct dbprlist *altprlist;     /* ptr to ordered printing list */
  617.         struct bindrec  altbind;        /* binding info, if any */
  618.         struct dbaltinfo        *altnext;       /* next column */
  619. };
  620. typedef struct dbaltinfo        DBALTINFO;
  621.  
  622. /*
  623. **  DBROW - This structure is used to store the actual row and alternate row
  624. **      data returned by the dataserver.  The member of the DBPROCESS structure 
  625. **      called dbfirstdata stores the doubly-linked list of rows.  If buffering
  626. **      is off, only one row is stored.  The rows are stored in the order that
  627. **      they are received from the server.
  628. */
  629. struct dbrow
  630. {
  631.         DBINT           rowid;          /* this is the returned row number */
  632.         DBUSMALLINT     rowaltid;       /* for ALT rows, this is
  633.                                          * DBALTINFO.altid
  634.                                          */
  635.         DBROWDATA       *rowdata;       /* actual data */
  636.         DBBOOL            rowhasnull;     /* are there any NULLS in this row of
  637.                                          * data?
  638.                                          */
  639.         struct dbrow    *rowprev;       /* previous row if buffering on */
  640.         struct dbrow    *rownext;       /* next row if buffering on */
  641. };
  642. typedef struct dbrow    DBROW;
  643.         
  644. /*
  645. **  DBINFO - This structure is used to store information and error messages
  646. **      returned by the dataserver.
  647. **
  648. **      NOTE - This structure is used by APT.
  649. **              Adding or deleting structure members should be done with
  650. **              care.
  651. */
  652. struct dbinfo
  653. {
  654.         DBINT           infonum;        /* error or info number */
  655.         DBTINYINT       infostate;      /* error state number */
  656.         DBTINYINT       infoclass;      /* info class or error severity */
  657.         char            *infotext;      /* null terminated message */
  658.         struct dbinfo   *infonext;
  659. };
  660. typedef struct dbinfo   DBINFO;
  661.  
  662. /*
  663. **  Options - both for the dataserver and DBLIB
  664. **      As additional options are added, they should be added here and in
  665. **      the Dboptdict array.
  666. */
  667.  
  668. /*
  669. ** dataserver options are defined in pss.h
  670. ** dataserver options and their index into the Dboptdict array
  671. ** Dboptdict is defined in options.c
  672. */
  673. #define DBPARSEONLY     0
  674. #define DBESTIMATE      1       
  675. #define DBSHOWPLAN      2
  676. #define DBNOEXEC        3
  677. #define DBARITHIGNORE   4
  678. #define DBNOCOUNT       5
  679. #define DBARITHABORT    6
  680. #define DBTEXTLIMIT     7
  681. #define DBBROWSE        8
  682. #define DBOFFSET        9
  683. #define DBSTAT          10
  684. #define DBERRLVL        11
  685. #define DBCONFIRM       12
  686. #define DBSTORPROCID    13
  687. #define DBBUFFER        14
  688. #define DBNOAUTOFREE    15
  689. #define DBROWCOUNT      16
  690. #define DBTEXTSIZE      17
  691.  
  692. #define OFF             0
  693. #define ON              1
  694.  
  695. /* RETCODES for option routines */
  696. #define NOSUCHOPTION    2
  697.  
  698. /*
  699. **  DBOPTION - This structure is used to store the current dataserver and
  700. **      dblib options.
  701. */
  702. struct dboption
  703. {
  704.         char    *opttext;
  705.         DBSTRING        *optparam;      /* param to the option */
  706.         DBUSMALLINT     optstatus;      /* status of option */
  707.         DBBOOL    optactive;      /* is this structure active (being used?) */
  708.         struct dboption *optnext;       /* for different versions of an option */
  709. };
  710. typedef struct dboption DBOPTION;
  711.  
  712.  
  713. /*
  714. ** These are the offset types recognized by the DataServer
  715. ** They are contained in the DataServer header pss.h.  The _defines
  716. ** come from y.tab.h.
  717. */
  718. #define OFF_SELECT      (DBUSMALLINT) _SELECT
  719. #define OFF_FROM        (DBUSMALLINT) _FROM
  720. #define OFF_ORDER       (DBUSMALLINT) _ORDER
  721. #define OFF_COMPUTE     (DBUSMALLINT) _COMPUTE
  722. #define OFF_TABLE       (DBUSMALLINT) _TABLE
  723. #define OFF_PROCEDURE   (DBUSMALLINT) _PROCEDURE
  724. #define OFF_STATEMENT   (DBUSMALLINT) _STATEMENT
  725. #define OFF_PARAM       (DBUSMALLINT) _PARAM
  726. #define OFF_EXEC    (DBUSMALLINT) _EXECUTE
  727.  
  728. /*
  729. **  DBOFF - This structure is used to store text offset information.
  730. **      This information is used to send back to the dataserver new
  731. **      control formats.  
  732. */
  733. struct dboff
  734. {
  735.         DBUSMALLINT     offtype;        /* type of offset */
  736.         DBUSMALLINT     offset;         /* actual offset */
  737.         struct dboff    *offnext;
  738. };
  739. typedef struct dboff    DBOFF;
  740.  
  741. /*
  742. **  DBDONE - This structure is just the dataserver done packet.
  743. **      It has information about the completion of a command.
  744. */
  745. struct dbdone
  746. {
  747.         DBUSMALLINT     donestatus;     /* done status bits */
  748.         DBUSMALLINT     doneinfo;       /* command specific info */
  749.         DBINT           donecount;      /* done count -- rows for example */
  750. };
  751. typedef struct dbdone   DBDONE;
  752.  
  753. /* Status bits for DBPROCESS dbstatus */
  754. #define READROW         (DBUSMALLINT) 0x2
  755. #define INSPROC         (DBUSMALLINT) 0x4
  756. #define EXECDONE        (DBUSMALLINT) 0x8
  757. #define NEWDB           (DBUSMALLINT) 0x10
  758.  
  759. /* Bulk-copy information -- */
  760.  
  761. #define PERIOD  '.'     /* the separator... */
  762.  
  763. #define STATNULL        (BYTE) 0x08
  764. #define IN              (BYTE) 1 /* TEMPORARY - for backward compatibility. */
  765. #define OUT             (BYTE) 2 /* TEMPORARY - for backward compatibility. */
  766. #define DB_IN           (BYTE) 1
  767. #define DB_OUT          (BYTE) 2
  768. #define BCPNAMELEN      255
  769. #define DEFABORT        10              /* # of errors before we give up */
  770. #define ERRFILE         "bcp.error"     /* default error file name */
  771.  
  772. /* BCP macros: */
  773. #define BCP_SETL(a,b)           dbsetlbool((a), (b), DBSETBCP)
  774.  
  775. /* The fields for calls to bcpcontrol. */
  776. #define BCPMAXERRS      1
  777. #define BCPFIRST        2
  778. #define BCPLAST         3
  779. #define BCPBATCH        4
  780. #define BCPERRFILE      5       /* TEMPORARY - for backward compatibility. */
  781.  
  782. typedef struct  bcpparsetable
  783. {
  784.         char    dbname[MAXNAME+1];
  785.         char    ownername[MAXNAME+1];
  786.         char    tabname[MAXNAME+1];
  787. } BCPPARSETABLE;
  788.  
  789. /*
  790. **  BCPCOLDESC
  791. **      This is the basic unit of information used for bulkcopy.
  792. **      All the bulkcopy routines that talk with the DataServer
  793. **      routines pass an array of these.
  794. */
  795. typedef struct  bcpcoldesc
  796. {
  797.         BYTE    *cd_dvalue;             /* current value to be inserted */
  798.         BYTE    *cd_defvalue;           /* default value to be inserted */
  799.         DBINT   cd_dlen;                /* current length to be inserted */
  800.         DBINT   cd_deflen;              /* length of default to be inserted */
  801.         BYTE    cd_colen;               /* max length allowed in column */
  802.         short   cd_coloff;              /* column offset in row */
  803.         BYTE    cd_colid;               /* id of column */
  804.         BYTE    cd_type;                /* storage type of column */
  805.         BYTE    cd_status;              /* status bits */
  806.         DBBOOL    cd_nullok;              /* is a NULL ok here? */
  807.         char    cd_name[MAXNAME+1];     /* column name */
  808.         DBBOOL    cd_moretext;            /* Is this text to be sent via bcp__moretext? */
  809.         long    cd_textpos;             /* file-position of a long TEXT or IMAGE */
  810. } BCPCOLDESC;
  811.  
  812. /*
  813. **  BCPROWDESC
  814. **      This is the basic unit of information used for bulkcopy.
  815. **      All the bulkcopy routines that talk with the DataServer
  816. **      routines pass it.
  817. */
  818. typedef struct bcprowdesc
  819. {
  820.         BCPCOLDESC      *rd_coldesc;    /* ptr to base address of COLDESC
  821.                                          * array
  822.                                          */
  823.         short           rd_colcount;    /* number of columns in COLDESC */
  824.         short           rd_minlen;      /* minimum length of a row */
  825.         short           rd_maxlen;      /* maximum length of a row */
  826. } BCPROWDESC;
  827.  
  828. /*
  829. ** BCPHOSTDESC
  830. **      This is the structure that has information about the type and
  831. **      format of the input or output data.  An array of these is used
  832. **      to read/write data to or from the host.
  833. */
  834. typedef struct  bcphostdesc
  835. {
  836.         BCPCOLDESC      *h_tabcol;/* which table column we are referring to */
  837.         int     h_tabcolnum;    /* which table column we are referring to */
  838.         int     (*hconvert)();  /* conversion function, if applicable */
  839.         BYTE    htype;          /* host data type for this column */
  840.         DBINT   hcollen;        /* max length of hostfile column */
  841.         BYTE    *hdata;         /* host-format data for this column */
  842.         DBINT   hdatlen;        /* length of actual hostfile data */
  843.         int     hprefixlen;     /* length of length-prefix for this column */
  844.         BYTE    *hterm;         /* terminator for this column, if applicable */
  845.         int     htermlen;       /* length of terminator for this column */
  846.         DBBOOL    hmoretext;      /* Is this text to be sent via bcp__moretext? */
  847.         long    htextpos;       /* file-position of a long TEXT or IMAGE */
  848. } BCPHOSTDESC;
  849.  
  850. /* This structure contains information about any partially-sent TEXT or IMAGE
  851.  * values, which are still to be sent by bcp_moretext().
  852.  */
  853. typedef struct bcptextrec
  854. {
  855.         DBINT       len;
  856.         BYTE        *val;
  857.         BYTE        type;
  858.     DBSMALLINT    rowoffset;
  859.         BYTE        coloffset;
  860. } BCPTEXTREC;
  861.  
  862. /*
  863. **  BCPDESC
  864. **      This structure is used to pass the information contained in the
  865. **      Bulk Copy property sheet around (if in the form version), or 
  866. **      information typed in by the user (in dblib/stand alone version).
  867. **      In the form version, this information comes from the main form, while
  868. **      in the stand alone version this comes from the command line.
  869. */
  870. typedef struct  bcpdesc
  871. {
  872.         BCPROWDESC      *bd_rowdesc;            /* the associated rowdesc */
  873.         BCPHOSTDESC     *bd_hostdesc;           /* ptr to base address of
  874.                                                 ** BCPHOSTDESC array */
  875.         int             bd_hcolcount;           /* number of (cols) BCPHOSTDESC 
  876.                                                 ** structs */
  877.         BCPPARSETABLE   *bd_ptable;             /* ptr to tbl name components */
  878.         char            bd_table[(3 * MAXNAME) + 3]; /* full table name */
  879.         char            bd_filename[BCPNAMELEN+1];/* host filename */
  880.         BYTE            bd_direction;           /* in/out */
  881.         BYTE            *bd_errfile;            /* host err file */
  882.         DBINT           bd_abort;               /* # of errors allowable */
  883.         DBINT           bd_firstrow;            /* begin copy at this row */
  884.         DBINT           bd_lastrow;             /* end copy at this row */
  885.         DBINT           bd_batch;               /* # of rows per batch */
  886.         int             bd_textcount;           /* # of text-columns in the
  887.                                                  * current row.
  888.                                                  */
  889.         int             bd_textcol;             /* # of the text-column now
  890.                                                  * being sent by bcp_moretext().
  891.                                                  * Starts at zero.
  892.                                                  */
  893.         DBINT           bd_textbytes;           /* # of bytes already sent of
  894.                                                  * the current bcp_moretext()
  895.                                                  * column.
  896.                                                  */
  897.         BCPTEXTREC      *bd_textarray;
  898. } BCPDESC;
  899.  
  900.  
  901. /*
  902. **  DBPROCESS - This is the basic DBLIB structure. It contains the command
  903. **      sent to the dataserver as well as the results of the command.
  904. **      It also includes any error or information messages, including the
  905. **      done packet, returned by the dataserver.  If buffering is turned on,
  906. **      this structure also stores the data rows.
  907. */
  908. struct  dbprocess
  909. {
  910.         struct servbuf  *dbfile;        /* dataserver connection */
  911.           BYTE                 *pipe;             /* connection to server */
  912.         DBUSMALLINT     dbstatus;       /* status field for dbprocess */
  913.         BYTE            dbtoken;        /* current dataserver token */
  914.         DBSTRING        *dbcmdbuf;      /* command buffer */
  915.         int             dbcurcmd;       /* number of the current cmd results */
  916.         DBINT           dbprocid;       /* procid, if any, of the current cmd */
  917.         DBCOLINFO       *dbcols;        /* linked list of column information */
  918.         DBALTHEAD       *dbalts;        /* linked list of alt column info */
  919.         DBROW           *dbfirstdata;   /* doubly linked list of returned row
  920.                                          * data
  921.                                          */
  922.         DBROW           *dbcurdata;     /* current row in dbfirstdata */
  923.         DBROW           *dblastdata;    /* last row in dbfirstdata, usually
  924.                                          * dbcurdata
  925.                                          */
  926.         DBOFF           *dboffsets;     /* list of offsets and controls in
  927.                                          * dbcmdbuf
  928.                                          */
  929.         int             dboffadjust;    /* adjustment factor for offsets */
  930.         DBSMALLINT      dbcuroffset;    /* active offset for results */
  931.         DBOPTION        *dbopts;
  932.         DBSTRING        *dboptcmd;      /* option string to send to server */
  933.         DBINFO          *dbmsgs;        /* linked list of info and error
  934.                                          * messages
  935.                                          */
  936.         DBINFO          *dbcurmsg;      /* last message read by dbgetmsg() */
  937.         DBDONE          dbdone;         /* done information */
  938.         char            dbcurdb[MAXNAME+1];     /* the name of the current
  939.                                                  * database
  940.                                                  */
  941.         INTFUNCPTR      (*dbbusy)();    /* function to call when waiting on
  942.                                          * dataserver
  943.                                          */
  944.         int             (*dbidle)();    /* function to call when waiting on
  945.                                          * dataserver
  946.                                          */
  947.         int             (*dbchkintr)(); /* user's function to call to check for
  948.                                          * queued interrupts
  949.                                          */
  950.         int             (*dbhndlintr)();/* user's interrupt handler */
  951.         int             dbbufsize;      /* the size of the row buffer, if
  952.                                          * enabled
  953.                                          */
  954.         NULLBIND        dbnullbind;     /* what to bind for nulls */
  955.         int             dbsticky;       /* sticky flags like attn */
  956.         int             dbnumorders;    /* number of columns in the query's
  957.                                          * "order by" clause.
  958.                                          */
  959.         int             *dbordercols;   /* array of the column numbers found in
  960.                                          * the query's "order by" clause.
  961.                                          */
  962.         DBBOOL            dbavail;        /* is this dbproc available for general
  963.                                          * use?
  964.                                          */
  965.         int             dbftosnum;      /* this id is used when recording the
  966.                                          * frontend-to-Server SQL traffic of
  967.                                          * this DBPROCESS.
  968.                                          */
  969.         DBBOOL            dbdead;         /* TRUE if this DBPROCESS has become
  970.                                          * useless, usually due to a fatal
  971.                                          * Server error, or a communications
  972.                                          * failure.
  973.                                          */
  974.         DBBOOL            dbenabled;      /* TRUE if this DBPROCESS is allowed to
  975.                                          * be used in DB-LIBRARY functions. The
  976.                                          * user may set this flag FALSE,
  977.                                          * possibly within an error handler, if
  978.                                          * execution of further commands would
  979.                                          * just cause further errors.
  980.                                          * DB-LIBRARY initially sets this flag
  981.                                          * TRUE. The user may set and re-set
  982.                                          * this flag at will.
  983.                                          */
  984.         DBBOOL            dbloginfailed;  /* TRUE if the Server has rejected
  985.                                          * our username and password.
  986.                                          */
  987.         DBBOOL            dbsqlsent;      /* TRUE if the SQL in the command
  988.                                          * buffer has already been sent to
  989.                                          * the DataServer.
  990.                                          */
  991.         DBTABNAME       *dbtabnames;    /* linked-list of table-name information
  992.                                          * used by "browse mode".
  993.                                          */
  994.         DBINT           dbspid;         /* The Server process-id of this
  995.                                          * DBPROCESS. It's returned in the
  996.                                          * row-count field of the done-packet
  997.                                          * which signifies a successful login.
  998.                                          */
  999.         DBRETVAL        *dbretvals;     /* linked-list of function
  1000.                                          * return-values.
  1001.                                          */
  1002.         BCPDESC         *db_bcpdesc;    /* A structure containing bulk-copy
  1003.                                          * information.
  1004.                                          */
  1005.         DBBOOL            dbtransbegun;   /* Indicates that a text data transfer
  1006.                                          * is under way.
  1007.                                          */
  1008.         DBINT           dbbytesleft;    /* This is a countdown variable, used
  1009.                                          * to track the number of bytes which
  1010.                                          * are still to be sent as part of
  1011.                                          * a dbwritetext() command.
  1012.                                          */
  1013.         DBINT           dbretstat;      /* This is the return-status from
  1014.                                          * a stored procedure.
  1015.                                          */
  1016.         DBINT           dbtextlimit;    /* This is the longest text-column
  1017.                                          * that this dbproc will accept
  1018.                                          * from the Server. Any additional
  1019.                                          * bytes will be discarded.
  1020.                                          * If 0, then there's no limit.
  1021.                                          */
  1022. #if VMS
  1023.         int             db_event_mask;  /* a mask used to determine what
  1024.                                         ** event has happened in the front-
  1025.                                         ** end i/o routines.
  1026.                                         */
  1027.         long            db_event_flag;  /* the number of the event flag used
  1028.                                         ** to check for timeout, interrupt 
  1029.                                         ** (control_c) or i/o completion.
  1030.                                         */
  1031.         short           db_io_channel;  /* channel assigned to sys$command
  1032.                                         ** of the controlling process.
  1033.                                         */
  1034. #endif /* VMS */
  1035.  
  1036.         struct dbprocess        *dbnext;/* DBPROCESSes are kept track of
  1037.                                          * in a big linked-list.
  1038.                                          */
  1039. };
  1040. typedef struct dbprocess        DBPROCESS;
  1041.  
  1042. /*
  1043. **  Various macros used to extract information from the DBPROCESS structure
  1044. */
  1045. #define DBCURCMD(a)     (a == NULL ? FAIL : ((a)->dbcurcmd))
  1046. #define DBCURROW(a)     (a == NULL ? (DBINT)FAIL : ((a)->dbcurdata == (DBROW *) NULL ? ((DBINT)0): (a)->dbcurdata->rowid))
  1047. #define DBFIRSTROW(a)   (a == NULL ? (DBINT)FAIL : (((a)->dbfirstdata == (DBROW *) NULL ? ((DBINT)0): (a)->dbfirstdata->rowid)))
  1048. #define DBLASTROW(a)    (a == NULL ? (DBINT)FAIL : (((a)->dblastdata == (DBROW *) NULL ? ((DBINT)0): (a)->dblastdata->rowid)))
  1049. #define DBROWTYPE(a)    (a == NULL ? (DBINT)FAIL : (((a)->dbcurdata == (DBROW *) NULL ? NO_MORE_ROWS : ((a)->dbcurdata->rowaltid == 0 ? REG_ROW : (a)->dbcurdata->rowaltid))))
  1050. #define DBMORECMDS(a)   (a == NULL ? FAIL : (((a)->dbdone.donestatus & DONE_CONT ? SUCCEED: FAIL)))
  1051. #define DONECONTINUE(a) (a == NULL ? FAIL : (((a)->dbdone.donestatus & DONE_CONT ? SUCCEED: FAIL)))
  1052. #define DBCOUNT(a)      (a == NULL ? (DBINT)-1 : (((a)->dbdone.donecount)))
  1053. #define DBCMDROW(x)     (x == NULL ? FAIL : (((x)->dbcols == NULL ? FAIL: SUCCEED)))
  1054. #define DBROWS(x)       (x == NULL ? FAIL : ((((x)->dbstatus & READROW) ? SUCCEED: FAIL)))
  1055. #define DBNUMORDERS(a)  (a == NULL ? (-1) : (((a)->dbnumorders)))
  1056. #define DBZEROSPACE(p,i)        (BZERO(((char *) (p)), (i)))
  1057. #define DBBUFFULL(a)    (a == NULL ? TRUE : ((DBLASTROW(a) - DBFIRSTROW(a) + 1 >= (a)->dbbufsize ? TRUE : FALSE)))
  1058. #define DBMOREROWS(a)   (a == NULL ? FALSE : ((((a)->dbtoken == SYBROW) || ((a)->dbtoken == SYBALTROW) ?  TRUE : FALSE)))
  1059. #define DBISAVAIL(a)    (a == NULL ? FALSE : ((((a)->dbavail) ? TRUE : FALSE)))
  1060. #define DBGETTIMEOUT(a) (DbTimeout)
  1061. #define DBGETTIME()     (DbTimeout)
  1062. #define DBDEAD(a)       (a == NULL ? TRUE : (((a)->dbdead)))
  1063.  
  1064. /*
  1065.  ** Defined for use with Sybase Installable Networks version 2.0
  1066. */
  1067. #define DBIORDESC(a)    ((a)->dbfile->serv_rnum)
  1068. #define DBIOWDESC(a)    ((a)->dbfile->serv_snum)
  1069. #define DBNETTIME()    (DbTimeout)            /* Read/Write */
  1070. #define DBNETCOMP(a)    ((a)->dbfile->serv_comp)
  1071.  
  1072. #define DBRBUF(a)       ((a)->dbfile->serv_rleft)
  1073.  
  1074. /* These constants are used for RPC options.  The first group are flags
  1075.  * in a 2-byte bitmask, so they'll be different on Suns and Vaxes.  The
  1076.  * second group are flags in a 1-byte bitmask, so they should be
  1077.  * machine-independent.
  1078.  */
  1079. #define DBRPCRECOMPILE     ((DBSMALLINT)1)
  1080.  
  1081. #define    DBRPCRETURN    ((BYTE)1)
  1082.  
  1083. #if VMS
  1084. /* These constants are used for VMS network manipulation. */
  1085. #define DB_IO_EVENT     1
  1086. #define DB_INTERRUPT_EVENT 2
  1087. #define DB_TIMER_EVENT  4
  1088. #endif /* VMS */
  1089.  
  1090. /*
  1091. ** Macros to set values in the LOGINREC structure.
  1092. */
  1093. #define DBSETHOST       1
  1094. #define DBSETUSER       2
  1095. #define DBSETPWD        3
  1096. #define DBSETHID        4
  1097. #define DBSETAPP        5
  1098. #define DBSETBCP        6
  1099. #define DBSETLHOST(a,b)         dbsetlname((a), (b), DBSETHOST)
  1100. #define DBSETLUSER(a,b)         dbsetlname((a), (b), DBSETUSER)
  1101. #define DBSETLPWD(a,b)          dbsetlname((a), (b), DBSETPWD)
  1102. #define DBSETLHID(a,b)          dbsetlname((a), (b), DBSETHID)
  1103. #define DBSETLAPP(a,b)          dbsetlname((a), (b), DBSETAPP)
  1104.  
  1105. extern DBBOOL     DbDebug;
  1106. extern int      DbTime;
  1107. extern DBBOOL     DbIntrFlag;     /* True if an interrupt was typed. */
  1108. extern char     DbSeparator;
  1109. extern int      DbHeader;
  1110. extern int      DbTimeout;      /* default timeout value for DBPROCESSes. */
  1111.  
  1112. /* bcp functions */
  1113. extern BCPDESC  *bcpinit();
  1114. extern RETCODE  bcpcontrol();
  1115. extern RETCODE  bcpcolumn();
  1116. extern RETCODE  bcpformat();
  1117. extern RETCODE  bcpexec();
  1118. extern RETCODE  bcpbind();
  1119. extern RETCODE  bcpsendrow();
  1120. extern RETCODE  bcpabort();
  1121. extern RETCODE  bcpcollen();
  1122. extern DBINT    bcpdone();
  1123.  
  1124. /* DB-LIBRARY minor error numbers */
  1125. #define SYBESYNC        10001   /* Read attempted while out of synchronization
  1126.                                  * with DataServer.
  1127.                                  */
  1128. #define SYBEFCON        10002   /* DataServer connection failed. */
  1129. #define SYBETIME        10003   /* DataServer connection timed out. */
  1130. #define SYBEREAD        10004   /* Read from DataServer failed. */
  1131. #define SYBEBUFL        10005   /* DB-LIBRARY internal error - send buffer
  1132.                                  * length corrupted.
  1133.                                  */
  1134. #define SYBEWRIT        10006   /* Write to DataServer failed. */
  1135. #define SYBEVMS         10007   /* Sendflush: VMS I/O error. */
  1136. #define SYBESOCK        10008   /* Unable to open socket */
  1137. #define SYBECONN        10009   /* Unable to connect socket -- DataServer is
  1138.                                  * unavailable or does not exist.
  1139.                                  */
  1140. #define SYBEMEM         10010   /* Unable to allocate sufficient memory */
  1141. #define SYBEDBPS        10011   /* Maximum number of DBPROCESSes
  1142.                                  * already allocated.
  1143.                                  */
  1144. #define SYBEINTF        10012   /* Server name not found in interface file */
  1145. #define SYBEUHST        10013   /* Unknown host machine name */
  1146. #define SYBEPWD         10014   /* Incorrect password. */
  1147. #define SYBEOPIN        10015   /* Could not open interface file. */
  1148. #define SYBEINLN        10016   /* Interface file: unexpected end-of-line. */
  1149. #define SYBESEOF        10017   /* Unexpected EOF from DataServer. */
  1150. #define SYBESMSG        10018   /* General DataServer error: Check messages
  1151.                                  * from the DataServer.
  1152.                                  */
  1153. #define SYBERPND        10019   /* Attempt to initiate a new DataServer
  1154.                                  * operation with results pending.
  1155.                                  */
  1156. #define SYBEBTOK        10020   /* Bad token from DataServer: Data-stream
  1157.                                  * processing out of sync.
  1158.                                  */
  1159. #define SYBEITIM        10021   /* Illegal timeout value specified. */
  1160. #define SYBEOOB         10022   /* Error in sending out-of-band data to
  1161.                                  * DataServer.
  1162.                                  */
  1163. #define SYBEBTYP        10023   /* Unknown bind type passed to DB-LIBRARY
  1164.                                  * function.
  1165.                                  */
  1166. #define SYBEBNCR        10024   /* Attempt to bind user variable to a
  1167.                                  * non-existent compute row.
  1168.                                  */
  1169. #define SYBEIICL        10025   /* Illegal integer column length returned by
  1170.                                  * DataServer. Legal integer lengths are 1, 2,
  1171.                                  * and 4 bytes.
  1172.                                  */
  1173. #define SYBECNOR        10026   /* Column number out of range. */
  1174. #define SYBENPRM        10027   /* NULL parameter not allowed for this
  1175.                                  * dboption.
  1176.                                  */
  1177. #define SYBEUVDT        10028   /* Unknown variable-length datatype encountered.
  1178.                                  */
  1179. #define SYBEUFDT        10029   /* Unknown fixed-length datatype encountered. */
  1180. #define SYBEWAID        10030   /* DB-LIBRARY internal error: ALTFMT following
  1181.                                  * ALTNAME has wrong id.
  1182.                                  */
  1183. #define SYBECDNS        10031   /* Datastream indicates that a compute column is
  1184.                                  * derived from a non-existent select-list
  1185.                                  * member.
  1186.                                  */
  1187. #define SYBEABNC        10032   /* Attempt to bind to a non-existent column. */
  1188. #define SYBEABMT        10033   /* User attempted a dbbind() with mismatched
  1189.                                  * column and variable types.
  1190.                                  */
  1191. #define SYBEABNP        10034   /* Attempt to bind using NULL pointers. */
  1192. #define SYBEAAMT        10035   /* User attempted a dbaltbind() with mismatched
  1193.                                  * column and variable types.
  1194.                                  */
  1195. #define SYBENXID        10036   /* The Server did not grant us a
  1196.                                  * distributed-transaction ID.
  1197.                                  */
  1198. #define SYBERXID        10037   /* The Server did not recognize our
  1199.                                  * distributed-transaction ID.
  1200.                                  */
  1201. #define SYBEICN         10038   /* Invalid computeid or compute column number.
  1202.                                  */
  1203. #define SYBENMOB        10039   /* No such member of 'order by' clause. */
  1204. #define SYBEAPUT        10040   /* Attempt to print unknown token. */
  1205. #define SYBEASNL        10041   /* Attempt to set fields in a null loginrec. */
  1206. #define SYBENTLL        10042   /* Name too long for loginrec field. */
  1207. #define SYBEASUL        10043   /* Attempt to set unknown loginrec field. */
  1208. #define SYBERDNR        10044   /* Attempt to retrieve data from a non-existent
  1209.                                  * row.
  1210.                                  */
  1211. #define SYBENSIP        10045   /* Negative starting index passed to dbstrcpy().
  1212.                                  */
  1213. #define SYBEABNV        10046   /* Attempt to bind to a NULL program variable.
  1214.                                  */
  1215. #define SYBEDDNE        10047   /* DBPROCESS is dead or not enabled. */
  1216. #define SYBECUFL        10048   /* Data-conversion resulted in underflow. */
  1217. #define SYBECOFL        10049   /* Data-conversion resulted in overflow. */
  1218. #define SYBECSYN        10050   /* Attempt to convert data stopped by syntax
  1219.                                  * error in source field.
  1220.                                  */
  1221. #define SYBECLPR        10051   /* Data-conversion resulted in loss of
  1222.                                  * precision.
  1223.                                  */
  1224. #define SYBECNOV        10052   /* Attempt to set variable to NULL resulted
  1225.                                  * in overflow.
  1226.                                  */
  1227. #define SYBERDCN        10053   /* Requested data-conversion does not exist. */
  1228. #define SYBESFOV        10054   /* dbsafestr() overflowed its destination
  1229.                                  * buffer.
  1230.                                  */
  1231. #define SYBEUNT         10055   /* Unknown network type found in
  1232.                                  * interface file.
  1233.                                  */
  1234. #define SYBECLOS        10056   /* Error in closing network connection. */
  1235. #define SYBEUAVE        10057   /* Unable to allocate VMS event flag. */
  1236. #define SYBEUSCT        10058   /* Unable to set communications timer. */
  1237. #define SYBEEQVA        10059   /* Error in queueing VMS AST routine. */
  1238. #define SYBEUDTY        10060   /* Unknown datatype encountered. */
  1239. #define SYBETSIT        10061   /* Attempt to call dbtsput() with an
  1240.                                  * invalid timestamp.
  1241.                                  */
  1242. #define SYBEAUTN        10062   /* Attempt to update the timestamp of a table
  1243.                                  * which has no timestamp column.
  1244.                                  */
  1245. #define SYBEBDIO        10063   /* Bad bulk-copy direction.  Must be either
  1246.                                  * IN or OUT.
  1247.                                  */
  1248. #define SYBEBCNT        10064   /* Attempt to use Bulk Copy with a non-existent
  1249.                                  * Server table.
  1250.                                  */
  1251. #define SYBEIFNB        10065   /* Illegal field number passed to bcp_control().
  1252.                                  */
  1253. #define SYBETTS         10066   /* The table which bulk-copy is attempting to
  1254.                                  * copy to a host-file is shorter than the
  1255.                                  * number of rows which bulk-copy was instructed
  1256.                                  * to skip.
  1257.                                  */
  1258. #define SYBEKBCO        10067   /* 1000 rows successfully bulk-copied to
  1259.                                  * host-file.
  1260.                                  */
  1261. #define SYBEBBCI        10068   /* Batch successfully bulk-copied to DataServer.
  1262.                                  */
  1263. #define SYBEKBCI        10069   /* Bcp: 1000 rows sent to DataServer. */
  1264. #define SYBEBCRE        10070   /* I/O error while reading bcp data-file. */
  1265. #define SYBETPTN        10071   /* Syntax error: only two periods are permitted
  1266.                                  * in table names.
  1267.                                  */
  1268. #define SYBEBCWE        10072   /* I/O error while writing bcp data-file. */
  1269. #define SYBEBCNN        10073   /* Attempt to bulk-copy a NULL value into
  1270.                                  * a Server column which does not accept
  1271.                                  * NULL values.
  1272.                                  */
  1273. #define SYBEBCOR        10074   /* Attempt to bulk-copy an oversized row to the
  1274.                                  * DataServer.
  1275.                                  */
  1276. #define SYBEBCIS        10075   /* Attempt to bulk-copy an illegally-sized
  1277.                                  * column value to the DataServer.
  1278.                                  */
  1279. #define SYBEBCPI        10076   /* bcp_init() must be called before any other
  1280.                                  * bcp routines.
  1281.                                  */
  1282. #define SYBEBCPN        10077   /* bcp_bind(), bcp_collen() and bcp_colptr()
  1283.                                  * may be used only after bcp_init() has been
  1284.                                  * called with the copy direction set to DB_IN.
  1285.                                  */
  1286. #define SYBEBCPB        10078   /* bcp_bind() may NOT be used after bcp_init()
  1287.                                  * has been passed a non-NULL input file name.
  1288.                                  */
  1289. #define SYBEVDPT        10079   /* For bulk copy, all variable-length data
  1290.                                  * must have either a length-prefix or a
  1291.                                  * terminator specified.
  1292.                                  */
  1293. #define SYBEBIVI        10080   /* bcp_columns() and bcp_colfmt() may be used
  1294.                                  * only after bcp_init() has been passed a
  1295.                                  * valid input file.
  1296.                                  */
  1297. #define SYBEBCBC        10081   /* bcp_columns() must be called before
  1298.                                  * bcp_colfmt().
  1299.                                  */
  1300. #define SYBEBCFO        10082   /* Bcp host-files must contain at least one
  1301.                                  * column.
  1302.                                  */
  1303. #define SYBEBCVH        10083   /* bcp_exec() may be called only after
  1304.                                  * bcp_init() has been passed a valid host file.
  1305.                                  */
  1306. #define SYBEBCUO        10084   /* Bcp: Unable to open host data-file. */
  1307. #define SYBEBCUC        10085   /* Bcp: Unable to close host data-file. */
  1308. #define SYBEBUOE        10086   /* Bcp: Unable to open error-file. */
  1309. #define SYBEBUCE        10087   /* Bcp: Unable to close error-file. */
  1310. #define SYBEBWEF        10088   /* I/O error while writing bcp error-file. */
  1311. #define SYBEASTF        10089   /* VMS: Unable to setmode for control_c ast. */
  1312. #define SYBEUACS        10090   /* VMS: Unable to assign channel to sys$command.
  1313.                                  */
  1314. #define SYBEASEC        10091   /* Attempt to send an empty command buffer to
  1315.                                  * the DataServer.
  1316.                                  */
  1317. #define SYBETMTD        10092   /* Attempt to send too much TEXT data via the
  1318.                                  * dbmoretext() call.
  1319.                                  */
  1320. #define SYBENTTN        10093   /* Attempt to use dbtxtsput() to put a new
  1321.                                  * text-timestamp into a non-existent data row.
  1322.                                  */
  1323. #define SYBEDNTI        10094   /* Attempt to use dbtxtsput() to put a new
  1324.                                  * text-timestamp into a column whose datatype
  1325.                                  * is neither SYBTEXT nor SYBIMAGE.
  1326.                                  */
  1327. #define SYBEBTMT        10095   /* Attempt to send too much TEXT data via the
  1328.                                  * bcp_moretext() call.
  1329.                                  */
  1330. #define SYBEDUPNT    10096    /* Attempt to install duplicate network. 
  1331.                 ** (well really we just found a dup comm_type.
  1332.                     */
  1333. #define SYBEUVBF        10097   /* Attempt to read an unknown version of
  1334.                 ** BCP format-file
  1335.                 */
  1336. #define SYBEBUOF    10098    /* Bcp: Unable to open format-file. */
  1337. #define SYBEBUCF    10099    /* Bcp: Unable to close format-file. */
  1338. #define SYBEBRFF    10100    /* I/O error while reading bcp format-file. */
  1339. #define SYBEBWFF    10101   /* I/O error while writing bcp format-file. */
  1340. #define SYBEBUDF    10102    /* Bcp: Unrecognized datatype found in
  1341.                  * format-file.
  1342.                 */
  1343. #define SYBEBIHC    10103    /* Incorrect host-column number found in bcp
  1344.                  * format-file. 
  1345.                 */
  1346. #define SYBEBEOF    10104    /* Unexpected EOF encountered in BCP data-file.
  1347.                 */
  1348. #define SYBEBCNL    10105    /* Negative length-prefix found in BCP
  1349.                  * data-file.
  1350.                  */
  1351. #define SYBEBCSI    10106    /* Host-file columns may be skipped only when
  1352.                  * copying INto the Server.
  1353.                  */
  1354. #define SYBEBCIT    10107    /* It's illegal to use BCP terminators with 
  1355.                      * program variables other than SYBCHAR,
  1356.                  * SYBBINARY, SYBTEXT, or SYBIMAGE.
  1357.                  */
  1358. #define SYBEBCSA    10108    /* The BCP hostfile '%s' contains only %ld
  1359.                  * rows.  Skipping all of these rows is
  1360.                  * not allowed.
  1361.                  */
  1362. #define SYBEBCRO    10109    /* The BCP hostfile '%s' contains only %ld
  1363.                  * rows.  It was impossible to read the
  1364.                  * requested %ld rows.
  1365.                  */
  1366. #define SYBENULL    10110    /* NULL DBPROCESS pointer encountered */
  1367.  
  1368. /* Forward declarations of DB-LIBRARY routines */
  1369.  
  1370.  
  1371. extern  unsigned char *dbadata(struct dbprocess *dbproc,int computeid,int colnumber);
  1372. extern  long dbadlen(struct dbprocess *dbproc,int computeid,int colnumber);
  1373. extern  int dbaltbind(struct dbprocess *dbproc,int computeid,int column,int vartype,long varlen,unsigned char *destvar);
  1374. extern  int dbaltcolid(struct dbprocess *dbproc,int computeid,int colnumber);
  1375. extern  long dbaltlen(struct dbprocess *dbproc,int computeid,int colnumber);
  1376. extern  int dbaltop(struct dbprocess *dbproc,int computeid,int colnumber);
  1377. extern  int dbalttype(struct dbprocess *dbproc,int computeid,int colnumber);
  1378. extern  int dbbind(struct dbprocess *dbproc,int column,int vartype,long varlen,unsigned char *destvar);
  1379. extern  unsigned char *dbbylist(struct dbprocess *dbproc,int id,int *size);
  1380. extern  int dbcancel(struct dbprocess *dbproc);
  1381. extern  int dbcanquery(struct dbprocess *dbproc);
  1382. extern  char *dbchange(struct dbprocess *dbproc);
  1383. static  void dbdbchange(struct dbprocess *dbproc,struct dbinfo *info);
  1384. extern  void dbclose(struct dbprocess *dbproc);
  1385. extern  void dbclrbuf(struct dbprocess *dbproc,long n);
  1386. extern  int dbclropt(struct dbprocess *dbproc,int option,char *param);
  1387. extern  int dbcmd(struct dbprocess *dbproc,char *cmdstring);
  1388. extern  unsigned char dbcolbrowse(struct dbprocess *dbproc,int colnum);
  1389. extern  long dbcollen(struct dbprocess *dbproc,int colnumber);
  1390. extern  char *dbcolname(struct dbprocess *dbproc,int colnumber);
  1391. extern  char *dbcolsource(struct dbprocess *dbproc,int colnumber);
  1392. extern  int dbcoltype(struct dbprocess *dbproc,int colnumber);
  1393. extern  int dbconvert(struct dbprocess *dbproc,int srctype,unsigned char *src,long srclen,int desttype,unsigned char *dest,long destlen);
  1394. extern  unsigned char *dbdata(struct dbprocess *dbproc,int colnumber);
  1395. extern  long dbdatlen(struct dbprocess *dbproc,int colnumber);
  1396. extern  int (*dberrhandle(int (*handler)()))();
  1397. extern  char *dberrstr(int errorno);
  1398. extern  void dbexit(void );
  1399. extern  int dbfcmd(struct dbprocess *dbproc,char *cmdstring,...);
  1400. extern  void dbfreebuf(struct dbprocess *dbproc);
  1401. extern  void dbfreequal(char far *);
  1402. extern  char *dbgetchar(struct dbprocess *dbproc,int n);
  1403. extern  int dbgetmaxprocs(void );
  1404. extern  int dbgetoff(struct dbprocess *dbproc,unsigned short type,int start);
  1405. extern  int dbgetrow(struct dbprocess *dbproc,long row);
  1406. extern  unsigned char dbisopt(struct dbprocess *dbproc,int option,char *param);
  1407. extern  struct loginrec *dblogin(void );
  1408. extern  int dbmoretext(struct dbprocess *dbproc,long size,unsigned char *text);
  1409. extern  int (*dbmsghandle(int (*handler)()))();
  1410. extern  long dbreadpage(struct dbprocess *dbproc,char *dbname,long pageno,unsigned char *buf);
  1411. extern  int dbwritepage(struct dbprocess *dbproc,char *dbname,int pageno,long size,unsigned char *buf);
  1412. extern  char *dbname(struct dbprocess *dbproc);
  1413. extern  int dbuse(struct dbprocess *dbproc,char *dbname);
  1414. extern  int dbnextrow(struct dbprocess *dbproc);
  1415. extern  int dbnumalts(struct dbprocess *dbproc,int id);
  1416. extern  int dbnumcols(struct dbprocess *dbproc);
  1417. extern  int dbnumcompute(struct dbprocess *dbproc);
  1418. extern  struct dbprocess *dbopen(struct loginrec *password,char *servername);
  1419. extern  int dbordercol(struct dbprocess *dbproc,int order);
  1420. extern  void dbprhead(struct dbprocess *dbproc);
  1421. extern  int dbprrow(struct dbprocess *dbproc);
  1422. extern  char *dbprtype(int type);
  1423. extern  char *dbqual(struct dbprocess *dbproc,int tabnum,char *tabname);
  1424. extern  long dbreadpage(struct dbprocess *dbproc,char *dbname,long pageno,unsigned char *buf);
  1425. extern  int dbresults(struct dbprocess *dbproc);
  1426. extern  void dbsetavail(struct dbprocess *dbproc);
  1427. extern  void dbsetbusy(struct dbprocess *dbproc,int (*(*busyfunc)())());
  1428. extern  int dbsetconnect(char *service_type,char *net_type,char *net_name,char *machine_name,char *port);
  1429. extern  void dbsetidle(struct dbprocess *dbproc,int (*idlefunc)());
  1430. extern  void dbsetifile(char *filename);
  1431. extern  void dbsetinterrupt(struct dbprocess *dbproc,int (*chkintr)(),int (*hndlintr)());
  1432. extern  int dbsetlogintime(int seconds);
  1433. extern  int dbsetlname(struct loginrec *lptr, char *name, int type);
  1434. extern  int dbsetmaxprocs(int maxprocs);
  1435. extern  int dbsetnull(struct dbprocess *dbproc,int bindtype,int bindlen,unsigned char *bindval);
  1436. extern  int dbsetopt(struct dbprocess *dbproc,int option,char *param);
  1437. extern  int dbsettime(int seconds);
  1438. extern  int dbsettimeout(struct dbprocess *dbproc,int seconds);
  1439. extern  int dbsqlexec(struct dbprocess *dbproc);
  1440. extern  int dbsqlok(struct dbprocess *dbproc);
  1441. extern  int dbsqlsend(struct dbprocess *dbproc);
  1442. extern  int dbstrcpy(struct dbprocess *dbproc,int start,int numbytes,char *dest);
  1443. extern  int dbstrlen(struct dbprocess *dbproc);
  1444. extern  unsigned char dbtabbrowse(struct dbprocess *dbproc,int tabnum);
  1445. extern  int dbtabcount(struct dbprocess *dbproc);
  1446. extern  char *dbtabname(struct dbprocess *dbproc,int tabnum);
  1447. extern  char *dbtabsource(struct dbprocess *dbproc,int colnum,int *tabnum);
  1448. extern  int dbtsnewlen(struct dbprocess *dbproc);
  1449. extern  unsigned char *dbtsnewval(struct dbprocess *dbproc);
  1450. extern  int dbtsput(struct dbprocess *dbproc,unsigned char *newts,int newtslen,int tabnum,char *tabname);
  1451. extern  int dbtxplen(struct dbprocess *dbproc,int colnumber,unsigned char *txplen);
  1452. extern  unsigned char *dbtxptr(struct dbprocess *dbproc,int colnumber);
  1453. extern  unsigned char *dbtxtimestamp(struct dbprocess *dbproc,int colnumber);
  1454. extern  unsigned char *dbtxtsnewval(struct dbprocess *dbproc);
  1455. extern  int dbtxtsput(struct dbprocess *dbproc,unsigned char *newtxts,int colnum);
  1456. extern  int dbuse(struct dbprocess *dbproc,char *dbname);
  1457. extern  unsigned char dbwillconvert(int srctype,int desttype);
  1458. extern  int dbwritepage(struct dbprocess *dbproc,char *dbname,int pageno,long size,unsigned char *buf);
  1459. extern  int dbwritetext(struct dbprocess *dbproc,char *objname,unsigned char *textptr,unsigned char textptrlen,unsigned char *timestamp,unsigned char log,long size,unsigned char *text);
  1460. extern  long bcp_batch(struct dbprocess *dbproc);
  1461. extern  int bcp_bind(struct dbprocess *dbproc,unsigned char *varaddr,int prefixlen,long varlen,unsigned char *terminator,int termlen,int type,int table_column);
  1462. extern  int bcp_colfmt(struct dbprocess *dbproc,int host_colnum,int host_type,int host_prefixlen,long host_collen,unsigned char *host_term,int host_termlen,int table_colnum);
  1463. extern  int bcp_collen(struct dbprocess *dbproc,long varlen,int table_column);
  1464. extern  int bcp_colptr(struct dbprocess *dbproc,unsigned char *colptr,int table_column);
  1465. extern  int bcp_columns(struct dbprocess *dbproc,int host_colcount);
  1466. extern  int bcp_control(struct dbprocess *dbproc,int field,long value);
  1467. extern  long bcp_done(struct dbprocess *dbproc);
  1468. extern  int bcp_exec(struct dbprocess *dbproc,long *rows_copied);
  1469. extern  int bcp_init(struct dbprocess *dbproc,char *tblname,char *hfile,char *errfile,int direction);
  1470. extern  int bcp_moretext(struct dbprocess *dbproc,long size,unsigned char *text);
  1471. extern  int bcp_sendrow(struct dbprocess *dbproc);
  1472. extern  int abort_xact(struct dbprocess *connect,long commid);
  1473. extern  void build_xact_string(char *xact_name,char *service_name,long commid,char *result);
  1474. extern  void close_commit(struct dbprocess *connect);
  1475. extern  int commit_xact(struct dbprocess *connect,long commid);
  1476. extern  struct dbprocess *open_commit(struct loginrec *login,char *service);
  1477. extern  int remove_xact(struct dbprocess *connect,long commid,int n);
  1478. extern  int scan_xact(struct dbprocess *connect,long commid);
  1479. extern  long start_xact(struct dbprocess *connect,char *application_name,char *xact_name,int count);
  1480. extern  int stat_xact(struct dbprocess *connect,long commid);
  1481. extern  int dbnetinstall(char *type,int (*netopen)(),long (*netread)(),long (*netwrite)(),int (*netclose)(),int (*netattn)());
  1482. extern  int dbneterr(struct dbprocess *dbproc,int minor,int oserr,char *oserrorstr);
  1483.  
  1484.  
  1485.  
  1486. #if VMS
  1487.  
  1488. /* VMS programs can use the AST facility to write asynchronous DB-LIBRARY
  1489.  * programs.
  1490.  */
  1491.     extern RETCODE  dbcanquery_a();
  1492.     extern RETCODE  dbnextrow_a();
  1493.     extern RETCODE  dbresults_a();
  1494.     extern RETCODE  dbsqlexec_a();
  1495.     extern RETCODE  dbsqlok_a();
  1496.     
  1497. #endif /* VMS */
  1498.  
  1499. #if (MSDOS || OS2)
  1500. /*
  1501. ** These are the NON-PROTOTYPED decalaration for all the Sybase supported 
  1502. ** networks.
  1503. */
  1504. /*
  1505. ** Support for SUN's PC-NFS
  1506. */
  1507.     extern RETCODE    tcp_nfs_open();
  1508.     extern DBINT    tcp_nfs_read();
  1509.     extern DBINT    tcp_nfs_write();
  1510.     extern RETCODE    tcp_nfs_close();
  1511.     extern RETCODE    tcp_nfs_sendattn();
  1512.  
  1513. /*
  1514. ** Support for Lan Managers Named Pipes
  1515. */
  1516.     extern RETCODE    nmp_open();
  1517.     extern DBINT    nmp_read();
  1518.     extern DBINT    nmp_write();
  1519.     extern RETCODE    nmp_close();
  1520.     extern RETCODE    nmp_sendattn();
  1521.     
  1522. /*
  1523. ** Support for Excelan's Exos 205T Ethernet Controller
  1524. */
  1525.     extern RETCODE    tcp_exos_open();
  1526.     extern DBINT    tcp_exos_read();
  1527.     extern DBINT    tcp_exos_write();
  1528.     extern RETCODE    tcp_exos_close();
  1529.     extern RETCODE    tcp_exos_sendattn();
  1530.     
  1531.  
  1532. #endif /* MSDOS or OS2 */
  1533.  
  1534. #endif    /* ifndef _FSDB_H_ */
  1535.