sybdb.h
上传用户:bilang918
上传日期:2010-03-24
资源大小:558k
文件大小:143k
源码类别:

网络

开发平台:

Unix_Linux

  1. */
  2. #define DBSTOPTRACE     ((DBUSMALLINT)0x0001)
  3. #define DBTDSHEADER     ((DBUSMALLINT)0x0002)
  4. #define DBTDSDATA       ((DBUSMALLINT)0x0004)
  5. #define DBTDSATT        ((DBUSMALLINT)0x0008)
  6. #define DBTDSCONNECT    ((DBUSMALLINT)0x0010)
  7. #define DBTDSDUMP       ((DBUSMALLINT)0x0020)
  8.  
  9. /*
  10. ** DB__TRACEBUF_SIZE - This is the size of the actual data buffer
  11. ** that will be allocated by dbtraceon().
  12. */
  13. #define DB__TRACEBUF_SIZE       3000
  14.  
  15.   
  16. /*
  17. ** DBLOGINFO - A structure used by TDS passthru login routines
  18. ** to communicate login parameters between Open Client and OpenServer.
  19. */
  20. typedef struct dbloginfo
  21. {
  22.         BYTE    tds_level[4];           /* The version of TDS to be used. */
  23.         DBINT   packet_size;            /* The TDS packet size to be used. */
  24.         BYTE    flt8_type;              /* Type of SYBFLT8 on this
  25.                                         ** platform.
  26.                                         */
  27.         BYTE    flt4_type;              /* Type of SYBREAL on this
  28.                                         ** platform.
  29.                                         */
  30.         BYTE    int4_type;              /* Type of SYBINT4 on this
  31.                                         ** platform.
  32.                                         */
  33.         BYTE    int2_type;              /* Type of SYBINT2 on this
  34.                                         ** platform.
  35.                                         */
  36.         BYTE    date_type;              /* Type of SYBDATETIME on
  37.                                         ** this platform.
  38.                                         */
  39.         BYTE    char_type;              /* Type of SYBCHAR on this
  40.                                         ** platform.
  41.                                         */
  42.         BYTE    noshort;                /* Whether to convert short
  43.                                         ** data types to long values.
  44.                                         */
  45.         BYTE    language[MAXNAME];      /* The name of the language to
  46.                                         ** be used for this session.
  47.                                         */
  48.         BYTE    langlen;                /* The length of language[] */
  49.         BYTE    setlang;                /* Whether the language field
  50.                                         ** contains a real value.
  51.                                         */
  52.         BYTE    charset[MAXNAME];       /* The name of the charset to
  53.                                         ** be used for this session.
  54.                                         */
  55.         BYTE    charsetlen;             /* The length of charset[] */
  56.         BYTE    setcharset;             /* Whether the charset field
  57.                                         ** contains a real value.
  58.                                         */
  59.         BYTE    ldmpld;                 /* Dump/load indicator. */
  60. BYTE lseclogin; /* security login options */
  61. BYTE lsecbulk; /* security bulk copy options */
  62. BYTE  reqcap[16]; /* request capabilities */
  63. BYTE  respcap[16]; /* response capabilities */
  64. /*
  65. ** The next set of fields are not part of the passthru mechanism.
  66. ** These fields are in this structure so that CT-Lib users can
  67. ** pass login properties from one connection handle to another
  68. ** connection handle using the ct_getloginfo()/ct_setloginfo()
  69. ** APIs.
  70. **
  71. ** The field setctprops indicates whether or not these fields
  72. ** have been set.  ct_getloginfo() will set this field to 1 when
  73. ** moving information into this structure.  Open Server and DB-Lib
  74. ** will not.  ct_setloginfo() will then use this field to 
  75. ** determine if these fields have valid values.
  76. */
  77. BYTE setctprops; /* CT-Lib login properties set */
  78. BYTE appname[30]; /* application name */
  79. BYTE  applen; /* length of application name */
  80. BYTE hostname[30]; /* host name */
  81. BYTE  hostlen; /* length of host name */
  82. BYTE  password[30]; /* password */
  83. BYTE  pwdlen; /* length of password */
  84. BYTE username[256]; /* user name  */
  85. BYTE  userlen; /* length of user name. */
  86. DBVOIDPTR *locale; /* Pointer to CS_LOCALE structure*/
  87. } DBLOGINFO;
  88. /*
  89. ** DBCHARSET
  90. **
  91. ** This structure is used to hold character set specific information.
  92. ** More than one dbproc may reference a given DBCHARSET record, so a 
  93. ** use count is maintained so we know when we can free the structure.
  94. */
  95. typedef struct dbcharset
  96. {
  97.         char    name[DBMAXNAME+1];      /* Name of the character set
  98.                                         ** (null-terminated)
  99.                                         */
  100.         DBSMALLINT      type;           /* Type of the character set */
  101.         DBTINYINT       id;             /* Character set id */
  102.         void            *char_data;     /* Pointer to image data from 
  103.                                         ** Server. May be NULL.
  104.                                         */
  105.         void            *chatr;         /* Pointer to structure which provides 
  106.                                         ** meaning to data pointed to by 
  107.                                         ** char_data. This structure is filled 
  108.                                         ** in by the function 
  109.                                         ** build_char_attrib(). Both the 
  110.                                         ** structure declaration and the 
  111.                                         ** function are provided by the
  112.                                         ** Server group.
  113.                                         */
  114.         int     usecount;               /* Number of DBPROCESSes using this
  115.                                         ** character set.
  116.                                         */
  117.         struct dbcharset *next;         /* Next structure in linked list.
  118.                                         */
  119. } DBCHARSET;
  120. /*
  121. ** DBCURSOR is a generic (hidden) structure
  122. */
  123. typedef struct dbcursor DBCURSOR;
  124.  
  125.  
  126. /*
  127. **  DBPROCESS - This is the basic DBLIB structure. It contains the command
  128. **      sent to the dataserver as well as the results of the command.
  129. **      It also includes any error or information messages, including the
  130. **      done packet, returned by the dataserver.  If buffering is turned on,
  131. **      this structure also stores the data rows.
  132. */
  133. struct dbprocess
  134. {
  135.         struct servbuf  *dbfile;        /* dataserver connection */
  136.         DBINT      dbstatus;       /* status field for dbprocess */
  137.         BYTE            dbtoken;        /* current dataserver token */
  138.         DBSTRING        *dbcmdbuf;      /* command buffer */
  139.         int             dbcurcmd;       /* number of the current cmd results */
  140.         DBINT           dbprocid;       /* procid, if any, of the current cmd */
  141.         DBCOLINFO       *dbcols;        /* linked list of column information */
  142.         DBALTHEAD       *dbalts;        /* linked list of alt column info */
  143.         DBROW           *dbfirstdata;   /* doubly linked list of returned row
  144.                                          * data
  145.                                          */
  146.         DBROW           *dbcurdata;     /* current row in dbfirstdata */
  147.         DBROW           *dblastdata;    /* last row in dbfirstdata, usually
  148.                                          * dbcurdata
  149.                                          */
  150.         DBOFF           *dboffsets;     /* list of offsets and controls in
  151.                                          * dbcmdbuf
  152.                                          */
  153.         int             dboffadjust;    /* adjustment factor for offsets */
  154.         DBSMALLINT      dbcuroffset;    /* active offset for results */
  155.         DBOPTION        *dbopts;
  156.         DBSTRING        *dboptcmd;      /* option string to send to server */
  157.         DBINFO          *dbmsgs;        /* linked list of info and error
  158.                                          * messages
  159.                                          */
  160.         DBINFO          *dbcurmsg;      /* last message read by dbgetmsg() */
  161. DBMSG *dbsrvmsg; /* Contents of the MSG datastream */
  162.         BYTE            *dbcurparam;    /* Previous MSG parameter */
  163.         BYTE            dbcurparlen;    /* Length of previous parameter */
  164.         DBDONE          dbdone;         /* done information */
  165.         char            dbcurdb[DBMAXNAME+1];   /* the name of the current
  166.                                                  * database
  167.                                                  */
  168.         DB_DBBUSY_FUNC dbbusy;  /* function to call when waiting on
  169.                                            * dataserver
  170.                                            */
  171.         DB_DBIDLE_FUNC dbidle;     /* function to call when waiting on
  172.                                          * dataserver
  173.                                          */
  174.         DB_DBCHKINTR_FUNC dbchkintr;  /* user's function to call to check for
  175.                                          * queued interrupts
  176.                                          */
  177.         DB_DBHNDLINTR_FUNC dbhndlintr; /* user's interrupt handler */
  178.         int             dbbufsize;      /* the size of the row buffer, if
  179.                                          * enabled
  180.                                          */
  181.         NULLBIND        dbnullbind;     /* what to bind for nulls */
  182.         int             dbsticky;       /* sticky flags like attn */
  183.         int             dbnumorders;    /* number of columns in the query's
  184.                                          * "order by" clause.
  185.                                          */
  186.         int             *dbordercols;   /* array of the column numbers found in
  187.                                          * the query's "order by" clause.
  188.                                          */
  189.         DBBOOL          dbavail;        /* is this dbproc available for general
  190.                                          * use?
  191.                                          */
  192.         int             dbftosnum;      /* this id is used when recording the
  193.                                          * frontend-to-Server SQL traffic of
  194.                                          * this DBPROCESS.
  195.                                          */
  196.         DBBOOL          dbdead;         /* TRUE if this DBPROCESS has become
  197.                                          * useless, usually due to a fatal
  198.                                          * Server error, or a communications
  199.                                          * failure.
  200.                                          */
  201.         DBBOOL          dbenabled;      /* TRUE if this DBPROCESS is allowed to
  202.                                          * be used in DB-LIBRARY functions. The
  203.                                          * user may set this flag FALSE,
  204.                                          * possibly within an error handler, if
  205.                                          * execution of further commands would
  206.                                          * just cause further errors.
  207.                                          * DB-LIBRARY initially sets this flag
  208.                                          * TRUE. The user may set and re-set
  209.                                          * this flag at will.
  210.                                          */
  211.         DBBOOL          dbsqlsent;      /* TRUE if the SQL in the command
  212.                                          * buffer has already been sent to
  213.                                          * the SQL Server.
  214.                                          */
  215.         DBTABNAME       *dbtabnames;    /* linked-list of table-name
  216.                                          * information used by "browse mode".
  217.                                          */
  218.         DBINT           dbspid;         /* The Server process-id of this
  219.                                          * DBPROCESS. It's returned in the
  220.                                          * row-count field of the done-packet
  221.                                          * which signifies a successful login.
  222.                                          */
  223. DBPARAM        *dbparams;      /* linked-list of function
  224.  * return-values.
  225.  */
  226.         BCPDESC         *db_bcpdesc;    /* A structure containing bulk-copy
  227.                                          * information.
  228.                                          */
  229.         DBBOOL          dbtransbegun;   /* Indicates that a text data transfer
  230.                                          * is under way.
  231.                                          */
  232.         DBINT           dbbytesleft;    /* This is a countdown variable, used
  233.                                          * to track the number of bytes which
  234.                                          * are still to be sent as part of
  235.                                          * a dbwritetext() command.  Or, in
  236.                                          * dbreadtext() as the number still
  237.                                          * to read on the net.
  238.                                          */
  239.         DBINT           dbretstat;      /* This is the return-status from
  240.                                          * a stored procedure.
  241.                                          */
  242.         DBBOOL          dbhasretstat;   /* Is the return-status valid? */
  243.         DBINT           dbtextlimit;    /* This is the longest text-column
  244.                                          * that this dbproc will accept
  245.                                          * from the Server. Any additional
  246.                                          * bytes will be discarded.
  247.                                          * If 0, then there's no limit.
  248.                                          */
  249.         BYTE            *dbuserdata;    /* A pointer to any data that the
  250.                                          * the user wishes to associate with
  251.                                          * this DBPROCESS.
  252.                                          */
  253.         DBINT           dbmsgno;        /* The number of the Server message
  254.                                          */
  255.         char            dblogin_node[DBMAXNAME + 1];
  256.                                         /* The node that the Companion
  257.                                          * Server's redirector has
  258.                                          * recommended to us.
  259.                                          */
  260.         int             dbcolcount;     /* The number of regular columns
  261.                                          * in the current set of results.
  262.                                          */
  263.         DBBOOL          db_oldtds;      /* TRUE if the TDS version is older
  264.                                          * than 4.0.
  265.                                          */
  266.         int             db_tdsversion;  /* tds version for this dbproc. */
  267.         DBLOCALE        *dblocale;      /* The localization info for this
  268.                                          * DBPROCESS.
  269.                                          */
  270.         DBVOIDPTR       rowfile;        /* The file-pointer used by
  271.                                          * dbprrow().
  272.                                          */
  273.         DBINT           dbsprlen;       /* The current length of a string
  274.                                          * being built up by one of the
  275.                                          * dbspr* functions.
  276.                                          */
  277.         DBINT           dbsprmaxlen;    /* The maximum length of a buffer
  278.                                          * being filled by one of the dbspr*
  279.                                          * functions.
  280.                                          */
  281.         char            *dbsprnextchar; /* The next available character
  282.                                          * of a buffer being filled by one of
  283.                                          * the dbspr* functions.
  284.                                          */
  285.         int             dbprlinelen;    /* The length of a display line.
  286.                                          * This information is used by
  287.                                          * the dbspr* functions.
  288.                                          */
  289. #if VMS
  290.         int             db_event_mask;  /* a mask used to determine what
  291.                                         ** event has happened in the front-
  292.                                         ** end i/o routines.
  293.                                         */
  294.         long            db_event_flag;  /* the number of the event flag used
  295.                                         ** to check for timeout, interrupt 
  296.                                         ** (control_c) or i/o completion.
  297.                                         */
  298.         short           db_io_channel;  /* channel assigned to sys$command
  299.                                         ** of the controlling process.
  300.                                         */
  301.         short           r_iosb[4];      /* I/O status for read */
  302.         short           w_iosb[4];      /* I/O status for write */
  303.         /* for async event notifications */
  304.         long            db_recvfl_ast;  /* async recvfill_a original ast */
  305.         long            db_recvfl_astp; /* async recvfill_a original astp */
  306.         long            db_recvfl_fr;   /* async recvfill_a original final_result */
  307.         long            db_rp_fr;       /* pending readfill_a final_result */
  308.         void            *dbpoll_ast;    /* Structure containing information
  309.                                         ** needed during asynchronous dbpoll().
  310.                                         */
  311. #endif /* VMS */
  312.         long            db_netflags;   /* flags used for buffer and network
  313.                                         ** synchronization */
  314. int db_ncprevmode; /* Previous netlib mode */
  315.         DBRPCREC        *db_rpcrec;     /* rpc record */
  316.         DBVOIDPTR       db_events;      /* table of event structs */
  317.         DBEVENTREC      *db_curevent;   /* the current event */
  318.         DBEVENTREC      *db_defeventrec; /* the default eventrec */
  319.         DBCHAR          *db_waitevent;  /* the name of the event being waited
  320.                                         ** for synchronously. This field is
  321.                                         ** only valid if dbstatus has the
  322.                                         ** DB_INLINENOTIFY bit is set.
  323.                                         */
  324.         DBUSMALLINT     db_traceflags;  /* active traces */
  325.         DBTRACEREC      *db_tracerec;   /* trace structure */
  326.         DBTRACEBUF      *db_tracebuf;   /* the trace data itself */
  327.         DBINT           db_traceid;     /* the id of this dbproc. */
  328.         BYTE            db__priv[8];
  329.         DBBOOL          first_token_read;
  330.                                         /* This field is set when
  331.                                          * the first token of a server
  332.                                          * response has been read by
  333.                                          * dbpoll().
  334.                                          */
  335.         DBINT           db_packetsize;  /* The packet size being used by 
  336.                                         ** this DBPROCESS.
  337.                                         */
  338.         DBBOOL          use_logintime;  /* If this field is set TRUE,
  339.                                          * it indicates that this
  340.                                          * DBPROCESS should use the
  341.                                          * DbLoginSecs timeout value,
  342.                                          * instead of the usual DbTimeout.
  343.                                          */
  344.         DBBOOL          dbuse_in_progress;
  345.                                         /* If this field is set TRUE,
  346.                                          * it indicates that this DBPROCESS
  347.                                          * is in the middle of a dbuse()
  348.                                          * operation, and should use the
  349.                                          * dbuse() error- and message-handlers.
  350.                                          */
  351.         DBBOOL          textok_in_progress;
  352.                                         /* If this field is set TRUE,
  353.                                          * it indicates that this DBPROCESS
  354.                                          * is in the middle of a db__textok()
  355.                                          * operation, and should use the
  356.                                          * db__textok() error- and
  357.                                          * message-handlers.
  358.                                          */
  359.         DBBOOL          textok;         /* This field indicates whether
  360.                                          * or not the server which is
  361.                                          * connected to this DBPROCESS
  362.                                          * can handle TEXT and IMAGE data.
  363.                                          */
  364.         DBBOOL          recovering;     /* If this field is set TRUE, it
  365.                                          * indicates that a dbuse() operation
  366.                                          * is continuing to attempt to
  367.                                          * access a database which is
  368.                                          * still recovering.
  369.                                          */
  370.         char            servcharset[DBMAXNAME+1];
  371.                                         /* The name of the server's character 
  372.                                         ** set.
  373.                                         */
  374.         char            charset[DBMAXNAME+1];
  375.                                         /* The name of the character set
  376.                                         ** currently in use.
  377.                                         */
  378.         DBCHARSET       *charset_info;  /* Pointer to information about the
  379.                                         ** current character set.
  380.                                         */
  381.         DBBOOL          charset_cnv;    /* Indicates whether the server
  382.                                         ** can convert from/to its character
  383.                                         ** set to the Clients character set.
  384.                                         ** TRUE means the conversion is being
  385.                                         ** done.
  386.                                         */
  387.         DBBOOL          need_charset_info;
  388.                                         /* Indicates whether we need to
  389.                                         ** load character set info from the
  390.                                         ** Server.
  391.                                         */
  392.         DBUSMALLINT     envchange_rcv;  /* Bit mask indicating whether 
  393.                                         ** TDS ENVCHANGE packets were received.
  394.                                         */
  395. DBROWDATA *db_readtext; /* Place to hold text timestamp and
  396. ** text pointer when reading text
  397. ** rows via dbreadtext().
  398. */
  399. DBINT requested_packetsize;
  400. /* packet size requested
  401. ** by user via DBSETLPACKET().
  402. */
  403. DBVOIDPTR dbcapability; /* dblib capabilities */
  404. DBBOOL db_srv_b1; /* Is server B1 or not ? */
  405.         struct dbprocess        *dbnext;/* DBPROCESSes are kept track of
  406.                                          * in a big linked-list.
  407.                                          */
  408. DBCURSOR * dbcursors; /* cursors for this dbproc */
  409. #if OS2 || NT || NETWARE386 || SYB_MAC  || MSDOS || WIN3
  410. DBINT dbexpedited; /* Buffer for exp data */
  411. void *db_compstatus;  /* Net Lib completion status */
  412. DBBOOL db_readpending; /* To indicate read is pending */
  413. DBINT db_readbytes; /* To indicate the bytes read */
  414. #endif /* OS2 || NT || NETWARE386 || SYB_MAC || MSDOS || WIN3 */
  415. DBBOOL          db_bcplabels;   /* TRUE if bcp will include security
  416.  * labels.
  417.  */
  418. #if defined(NETWARE386) || defined(OS2) || defined(NT) || defined(WIN3) || defined(MSDOS)
  419. /* 003: This field for bcp support */
  420. int db_filmode; /* DB_BINARY or DB_TEXT */
  421. DBBOOL cnv_date2char_short;
  422. /* To indicate if a short date will
  423. ** result in converting date to a
  424. ** string.
  425. */
  426. #endif
  427. };
  428. typedef struct dbprocess        DBPROCESS;
  429. #if defined(NETWARE386) || defined(OS2) || defined(NT) || defined(WIN3) || defined(MSDOS)
  430. /* Use these defines for db_filmode */
  431. #define DB_BINARY 1
  432. #define DB_TEXT 2
  433. #endif
  434. #define DBTDS_UNKNOWN           0
  435. #define DBTDS_2_0               1       /* used by pre 4.0 SQL Server */
  436. #define DBTDS_3_4               2       /* used by Microsoft SQL Server (3.0) */
  437. #define DBTDS_4_0               3       /* used by 4.0 SQL Server */
  438. #define DBTDS_4_2               4       /* used by 4.2 SQL Server */
  439. #define DBTDS_4_6               5       /* used by 2.0 OpenServer and
  440.                                         ** 4.6 SQL Server.
  441.                                         */
  442. #define DBTDS_4_9_5             6       /* used by 4.9.5 (NCR) SQL Server */
  443. #define DBTDS_5_0               7       /* used by 5.0 SQL Server */
  444. /*
  445. ** Possible values for the envchange_rcv field.
  446. */
  447. #define DB__DB_ENVCHANGE        ((DBUSMALLINT) 0x0001)
  448. #define DB__LANG_ENVCHANGE      ((DBUSMALLINT) 0x0002)
  449. #define DB__CHAR_ENVCHANGE      ((DBUSMALLINT) 0x0004)
  450. #define DB__PACKET_ENVCHANGE    ((DBUSMALLINT) 0x0008)
  451. /*
  452. **  Various macros used to extract information from the DBPROCESS structure
  453. */
  454. #define DBTDS(a)                dbtds(a)
  455. #define DBCURCMD(a)             dbcurcmd(a)
  456. #define DBCURROW(a)             dbcurrow(a)
  457. #define DBFIRSTROW(a)           dbfirstrow(a)
  458. #define DBLASTROW(a)            dblastrow(a)
  459. #define DBROWTYPE(a)            dbrowtype(a)
  460. #define DBMORECMDS(a)           dbmorecmds(a)
  461. #define DONECONTINUE(a)         donecontinue(a)
  462. #define DBCOUNT(a)              dbcount(a)
  463. #define DBCMDROW(x)             dbcmdrow(x)
  464. #define DBROWS(x)               dbrows(x)
  465. #define DBNUMORDERS(a)          dbnumorders(a)
  466. #define DBBUFFULL(a)            dbbuffull(a)
  467. #define DBMOREROWS(a)           dbmorerows(a)
  468. #define DBISAVAIL(a)            dbisavail(a)
  469. #define DBDEAD(a)               dbdead(a)
  470. #define DBIORDESC(a)            dbiordesc(a)
  471. #define DBIOWDESC(a)            dbiowdesc(a)
  472. #define DBRBUF(a)               dbrbuf(a)
  473. #define DBGETTIMEOUT(a)         db__getDbTimeout(a)
  474. #define DBGETTIME()             db__getDbTimeout((DBPROCESS *)0)
  475. #if (VMS)
  476. #define DBZEROSPACE(dest, bytes)                db__bzero(dest, bytes)
  477. #else
  478. #define DBZEROSPACE(dest, bytes)                MEMZERO(dest, bytes)
  479. #endif /* (VMS) */
  480. /*
  481. ** These constants are used for RPC options.
  482. */
  483. #define DBRPCRECOMPILE  ((DBUSMALLINT)0x0001)
  484. #define DBNOTIFYALL     ((DBUSMALLINT)0x0002)
  485. #define DBNOTIFYNEXT    ((DBUSMALLINT)0x0004)
  486. /*
  487. ** These constants are used for RPC parameter status values.
  488. */
  489. #define DBRPCNORETURN   ((BYTE)0)
  490. #define DBRPCRETURN     ((BYTE)1)
  491. #define DB__NODEFAULT   ((BYTE)2)
  492. /*
  493. ** This constant is used in dbregparam() to define
  494. ** a parameter that has no default data value.
  495. */
  496. #define DBNODEFAULT   ((DBINT)-2)
  497. /*
  498. ** dbgetlusername() and dbgetlpassword() will return DBTRUNCATED if it 
  499. ** truncated the user name.
  500. */
  501. #define DBTRUNCATED     -1
  502. /*
  503. ** Internal Remote procedure call names used by Event Manager.
  504. ** These names must match the names used by Open/SQL Server.
  505. */
  506. #define DB__EVENTNOTIFY_RPC     "sp_regwatch"
  507. #define DB__CANCELNOTIFY_RPC    "sp_regnowatch"
  508. #define DB__ADD_EVENT_RPC       "sp_regcreate"
  509. #define DB__DROPEVENT_RPC       "sp_regdrop"
  510. #define DB__EVENTLIST_RPC       "sp_reglist"
  511. #define DB__NOTIFYLIST_RPC      "sp_regwatchlist"
  512. /*
  513. ** Define the legal values for the dbregwatch() options parameter.
  514. ** These may be OR-able symbols.
  515. */
  516. #define DBNOTIFYONCE    ((DBUSMALLINT)0x0002)
  517. #define DBNOTIFYALWAYS  ((DBUSMALLINT)0x0004)
  518. #define DBSYNC          ((DBUSMALLINT)0x0020)
  519. #define DBASYNC         ((DBUSMALLINT)0x0040)
  520. #define DBWAIT          ((DBUSMALLINT)0x0022)
  521. #define DBNOWAITONE     ((DBUSMALLINT)0x0042)
  522. #define DBNOWAITALL     ((DBUSMALLINT)0x0044)
  523. /*
  524. ** new function return codes.
  525. */
  526. #define DB_PASSTHRU_MORE        ((RETCODE)1)
  527. #define DB_PASSTHRU_EOM         ((RETCODE)2)
  528. #define DBNOPROC                ((RETCODE)2)
  529.  
  530. /*
  531. ** retcodes for security label handlers
  532. */
  533. #define DBERRLABEL ((RETCODE)0)
  534. #define DBMORELABEL ((RETCODE)1)
  535. #define DBENDLABEL ((RETCODE)2)
  536. /*
  537. ** definition of a TDS packet size.
  538. */
  539. #define DB__PACKET_SIZE         ((DBINT)512)
  540. #define DB__MIN_PACKET_SIZE     ((DBINT)256)
  541. #define DB__MAX_PACKET_SIZE     ((DBINT)9999)
  542.  
  543. #if VMS
  544. /* These constants are used for VMS network manipulation. */
  545. #define DB_IO_EVENT     1
  546. #define DB_INTERRUPT_EVENT 2
  547. #define DB_TIMER_EVENT  4
  548. #endif /* VMS */
  549. /*
  550. ** Macros to set values in the LOGINREC structure.
  551. */
  552. #define DBSETHOST       1
  553. #define DBSETUSER       2
  554. #define DBSETPWD        3
  555. #define DBSETHID        4
  556. #define DBSETAPP        5
  557. #define DBSETBCP        6
  558. #define DBSETNATLANG    7
  559. #define DBSETNOSHORT    8
  560. #define DBSETHIER       9
  561. #define DBSETCHARSET    10
  562. #define DBSETPACKET     11
  563. #define DBSETENCRYPT 12
  564. #define DBSETLABELED 13
  565. #define DBSETLHOST(a,b)         dbsetlname((a), (b), DBSETHOST)
  566. #define DBSETLUSER(a,b)         dbsetlname((a), (b), DBSETUSER)
  567. #define DBSETLPWD(a,b)          dbsetlname((a), (b), DBSETPWD)
  568. #define DBSETLHID(a,b)          dbsetlname((a), (b), DBSETHID)
  569. #define DBSETLAPP(a,b)          dbsetlname((a), (b), DBSETAPP)
  570. #define DBSETLNATLANG(a,b)      dbsetlname((a), (b), DBSETNATLANG)
  571. #define DBSETLNOSHORT(a,b)      dbsetlbool((a), (b), DBSETNOSHORT)
  572. #define DBSETLHIER(a,b)         dbsetlshort((a), (b), DBSETHIER)
  573. #define DBGETLHIER(a)           dbgetlhier(a)
  574. #define DBSETLROLE(a,b)         dbsetlrole(a,b)
  575. #define DBSETLCOMP(a,b)         dbsetlcomp(a,b)
  576. #define DBSETLPACKET(a,b)       dbsetllong((a), (b), DBSETPACKET)
  577. #define DBSETLCHARSET(a,b)      dbsetlname((a), (b), DBSETCHARSET)
  578. #define DBSETLENCRYPT(a,b) dbsetlbool((a), (b), DBSETENCRYPT)
  579. #define DBSETLLABELED(a,b)      dbsetlbool((a), (b), DBSETLABELED)
  580. #define DBSETONECOMP(a,b)       (a)[ ((b)-1)/8 ] |= ( 0x80 >> (( (b)-1 ) % 8) )
  581. /*
  582. ** Db-Lib cursor defines
  583. */
  584. /*
  585. ** dbcursoropen() concurrency options
  586. */ 
  587. #define CUR_READONLY 1 /* Readonly cursor, no data
  588. ** modifications allowed.*/
  589. #define CUR_LOCKCC 2 /* Intent to update, all data fetched
  590. ** is locked if inside a transaction*/
  591. #define CUR_OPTCC 3 /* Optimistic concurrency control,
  592. ** data modifications succeed only
  593. ** if the row hasn't been updated since
  594. ** the last fetch. */
  595. #define CUR_OPTCCVAL 4 /* OPTCC based on column values, data
  596. ** modifications succeed only if selected
  597. ** values haven't changed since last
  598. ** fetch */
  599. #define CUR_MAXVALUE CUR_OPTCCVAL
  600. /*
  601. ** scrollopt options for dbcursoropen().  Any other number indicates
  602. ** mixed keyset and dynamic
  603. */
  604. #define CUR_FORWARD 0 /* Forward only scroll */
  605. #define CUR_KEYSET     -1 /* Keyset driven */
  606. #define CUR_DYNAMIC 1 /* Fully dynamic */
  607. /*
  608. ** Following flags define the fetchtype in the dbcursorfetch function
  609. */
  610. #define FETCH_FIRST 1 /* Fetch the very first n rows */
  611. #define FETCH_NEXT 2 /* Fetch next n rows */
  612. #define FETCH_PREV 3 /* Fetch previous n rows */
  613. #define FETCH_RANDOM 4 /* Fetch starting with given row # */
  614. #define FETCH_RELATIVE 5 /* Fetch relative to previous row #*/
  615. #define FETCH_LAST 6 /* Fetch the very last n rows */
  616. #define FETCH_MAXVALUE FETCH_LAST
  617. /*
  618. ** Following flags define the per row status flags filled by dbcursorfetch 
  619. */
  620. #define FTC_SUCCEED 0x01 /* Fetch of given row succeeded */
  621. /* Fetch failed if this is not set*/
  622. #define FTC_MISSING 0x02 /* The row is missing */
  623. #define FTC_ENDOFKEYSET 0x04 /* The last row in the keyset */
  624. #define FTC_ENDOFRESULTS 0x08 /* End of results set reached */
  625. /*
  626. ** Following values define the operator types for dbcursor
  627. */
  628. #define CRS_UPDATE 1 /* Update operation */
  629. #define CRS_DELETE 2 /* Delete operation */
  630. #define CRS_INSERT 3 /* Insert operation */
  631. #define CRS_REFRESH 4 /* Refetch row */
  632. #define CRS_LOCKCC 5 /* Refetch row with lock */
  633. /*
  634. ** DB-Library Versions
  635. ** - When adding new versions, use the next highest value
  636. */
  637. #define DBVERSION_UNKNOWN 0
  638. #define DBVERSION_46 1 /* Version 4.6 */
  639. #define DBVERSION_100 2 /* Version 10.0 */
  640. #ifndef COMPILE_STYLE
  641. #define COMPILE_STYLE KR_C_COMPILE
  642. #endif
  643. #ifndef TYPE_TOKEN_1
  644. #define TYPE_TOKEN_1
  645. #endif
  646. #ifndef TYPE_TOKEN_2
  647. #define TYPE_TOKEN_2 CS_PUBLIC
  648. #endif
  649. /*
  650. ** 002 Function prototypes for all public functions
  651. */
  652. CS_START_EXTERN_C
  653. typedef int (CS_PUBLIC DBFAR *EHANDLEFUNC) PROTOTYPE((
  654. DBPROCESS DBFAR *dbproc, 
  655. int severity,
  656. int dberr,
  657. int oserr,
  658. char DBFAR *dberrstr,
  659. char DBFAR *oserrstr
  660. ));
  661. typedef int (CS_PUBLIC DBFAR *MHANDLEFUNC) PROTOTYPE((
  662. DBPROCESS DBFAR *dbproc,
  663. DBINT msgno,
  664. int msgstate,
  665. int severity,
  666. char DBFAR *msgtext,
  667. char DBFAR *srvname,
  668. char DBFAR *procname, 
  669. int line
  670. ));
  671. RETCODE CS_PUBLIC dbsetlname  PROTOTYPE((
  672. LOGINREC DBFAR *lptr,
  673. char DBFAR *name,
  674. int type
  675. ));
  676. RETCODE CS_PUBLIC dbsetlbool  PROTOTYPE((
  677. LOGINREC DBFAR *lptr,
  678. int value,
  679. int type
  680. ));
  681. RETCODE CS_PUBLIC dbsetlshort  PROTOTYPE((
  682. LOGINREC DBFAR *lptr,
  683. int value,
  684. int type
  685. ));
  686. RETCODE CS_PUBLIC dbsetllong  PROTOTYPE((
  687. LOGINREC DBFAR *lptr,
  688. long value,
  689. int type
  690. ));
  691. int CS_PUBLIC db__getDbTimeout  PROTOTYPE((
  692. DBPROCESS DBFAR *dbproc
  693. ));
  694. RETCODE CS_PUBLIC dbcmdrow  PROTOTYPE((
  695. DBPROCESS DBFAR *x
  696. ));
  697. int CS_PUBLIC dbtds  PROTOTYPE((
  698. DBPROCESS DBFAR *a
  699. ));
  700. int CS_PUBLIC dbcurcmd  PROTOTYPE((
  701. DBPROCESS DBFAR *a
  702. ));
  703. DBINT CS_PUBLIC dbcurrow  PROTOTYPE((
  704. DBPROCESS DBFAR *a
  705. ));
  706. DBINT CS_PUBLIC dbfirstrow  PROTOTYPE((
  707. DBPROCESS DBFAR *a
  708. ));
  709. DBINT CS_PUBLIC dblastrow  PROTOTYPE((
  710. DBPROCESS DBFAR *a
  711. ));
  712. DBINT CS_PUBLIC dbrowtype  PROTOTYPE((
  713. DBPROCESS DBFAR *a
  714. ));
  715. RETCODE CS_PUBLIC dbmorecmds  PROTOTYPE((
  716. DBPROCESS DBFAR *a
  717. ));
  718. DBINT CS_PUBLIC donecontinue  PROTOTYPE((
  719. DBPROCESS DBFAR *a
  720. ));
  721. RETCODE CS_PUBLIC dbrows  PROTOTYPE((
  722. DBPROCESS DBFAR *x
  723. ));
  724. int CS_PUBLIC dbnumorders  PROTOTYPE((
  725. DBPROCESS DBFAR *a
  726. ));
  727. DBBOOL CS_PUBLIC dbbuffull  PROTOTYPE((
  728. DBPROCESS DBFAR *a
  729. ));
  730. DBBOOL CS_PUBLIC dbmorerows  PROTOTYPE((
  731. DBPROCESS DBFAR *a
  732. ));
  733. DBBOOL CS_PUBLIC dbisavail  PROTOTYPE((
  734. DBPROCESS DBFAR *a
  735. ));
  736. DBBOOL CS_PUBLIC dbdead  PROTOTYPE((
  737. DBPROCESS DBFAR *a
  738. ));
  739. int CS_PUBLIC dbiordesc  PROTOTYPE((
  740. DBPROCESS DBFAR *a
  741. ));
  742. int CS_PUBLIC dbiowdesc  PROTOTYPE((
  743. DBPROCESS DBFAR *a
  744. ));
  745. DBBOOL CS_PUBLIC dbrbuf  PROTOTYPE((
  746. DBPROCESS DBFAR *a
  747. ));
  748. DBINT CS_PUBLIC dbcount  PROTOTYPE((
  749. DBPROCESS DBFAR *a
  750. ));
  751. short CS_PUBLIC dbgetlhier  PROTOTYPE((
  752. LOGINREC *a
  753. ));
  754. CS_VOID CS_PUBLIC dbsetlrole  PROTOTYPE((
  755. LOGINREC *a,
  756. int b
  757. ));
  758. int CS_PUBLIC dbsetlcomp  PROTOTYPE((
  759. LOGINREC *a,
  760. BYTE *b
  761. ));
  762. BYTE CS_PUBLIC dbgetlrole  PROTOTYPE((
  763. LOGINREC *a
  764. ));
  765. BYTE DBFAR * CS_PUBLIC dbadata  PROTOTYPE((
  766. DBPROCESS DBFAR *dbproc,
  767. int computeid,
  768. int colnumber
  769. ));
  770. BYTE DBFAR * CS_PUBLIC dbbylist  PROTOTYPE((
  771. DBPROCESS DBFAR *dbproc,
  772. int id,
  773. int DBFAR *size
  774. ));
  775. BYTE DBFAR * CS_PUBLIC dbdata  PROTOTYPE((
  776. DBPROCESS DBFAR *dbproc,
  777. int colnumber
  778. ));
  779. BYTE DBFAR * CS_PUBLIC dbgetuserdata  PROTOTYPE((
  780. DBPROCESS DBFAR *dbproc
  781. ));
  782. BYTE DBFAR * CS_PUBLIC dbretdata  PROTOTYPE((
  783. DBPROCESS DBFAR *dbproc,
  784. int retnum
  785. ));
  786. DBBINARY DBFAR * CS_PUBLIC dbtsnewval  PROTOTYPE((
  787. DBPROCESS DBFAR *dbproc
  788. ));
  789. DBBINARY DBFAR * CS_PUBLIC dbtxptr  PROTOTYPE((
  790. DBPROCESS DBFAR *dbproc,
  791. int colnumber
  792. ));
  793. DBBINARY DBFAR * CS_PUBLIC dbtxtimestamp  PROTOTYPE((
  794. DBPROCESS DBFAR *dbproc,
  795. int colnumber
  796. ));
  797. DBBINARY DBFAR * CS_PUBLIC dbtxtsnewval  PROTOTYPE((
  798. DBPROCESS DBFAR *dbproc
  799. ));
  800. DBBOOL CS_PUBLIC db12hour  PROTOTYPE((
  801. DBPROCESS DBFAR *dbproc,
  802. char DBFAR *language
  803. ));
  804. DBBOOL CS_PUBLIC dbcharsetconv  PROTOTYPE((
  805. DBPROCESS DBFAR *dbproc
  806. ));
  807. DBBOOL CS_PUBLIC dbcolbrowse  PROTOTYPE((
  808. DBPROCESS DBFAR *dbproc,
  809. int colnum
  810. ));
  811. DBBOOL CS_PUBLIC dbhasretstat  PROTOTYPE((
  812. DBPROCESS DBFAR *dbproc
  813. ));
  814. DBBOOL CS_PUBLIC dbisopt  PROTOTYPE((
  815. DBPROCESS DBFAR *dbproc,
  816. int option,
  817. char DBFAR *param
  818. ));
  819. DBBOOL CS_PUBLIC dbtabbrowse  PROTOTYPE((
  820. DBPROCESS DBFAR *dbproc,
  821. int tabnum
  822. ));
  823. DBBOOL CS_PUBLIC dbvarylen  PROTOTYPE((
  824. DBPROCESS DBFAR *dbproc,
  825. int colnumber
  826. ));
  827. DBBOOL CS_PUBLIC dbwillconvert  PROTOTYPE((
  828. int srctype,
  829. int desttype
  830. ));
  831. DBINT CS_PUBLIC dbadlen  PROTOTYPE((
  832. DBPROCESS DBFAR *dbproc,
  833. int computeid,
  834. int colnumber
  835. ));
  836. DBINT CS_PUBLIC dbaltlen  PROTOTYPE((
  837. DBPROCESS DBFAR *dbproc,
  838. int computeid,
  839. int colnumber
  840. ));
  841. DBINT CS_PUBLIC dbcollen  PROTOTYPE((
  842. DBPROCESS DBFAR *dbproc,
  843. int colnumber
  844. ));
  845. DBINT CS_PUBLIC dbconvert  PROTOTYPE((
  846. DBPROCESS DBFAR *dbproc,
  847. int srctype,
  848. BYTE DBFAR *src,
  849. DBINT srclen,
  850. int desttype,
  851. BYTE DBFAR *dest,
  852. DBINT destlen
  853. ));
  854. DBINT CS_PUBLIC dbconvert_ps  PROTOTYPE((
  855. DBPROCESS DBFAR *dbproc,
  856. int srctype,
  857. BYTE DBFAR *src,
  858. DBINT srclen,
  859. int desttype,
  860. BYTE DBFAR *dest,
  861. DBINT destlen,
  862. DBTYPEINFO DBFAR *typeinfo
  863. ));
  864. DBINT CS_PUBLIC dbdatepart  PROTOTYPE((
  865. DBPROCESS DBFAR *dbproc,
  866. int whichpart,
  867. DBDATETIME DBFAR *datetime
  868. ));
  869. DBINT CS_PUBLIC dbdatlen  PROTOTYPE((
  870. DBPROCESS DBFAR *dbproc,
  871. int colnumber
  872. ));
  873. DBINT CS_PUBLIC dbreadpage  PROTOTYPE((
  874. DBPROCESS DBFAR *dbproc,
  875. char DBFAR *p_dbname,
  876. DBINT pageno,
  877. BYTE buf[]
  878. ));
  879. DBINT CS_PUBLIC dbretlen  PROTOTYPE((
  880. DBPROCESS DBFAR *dbproc,
  881. int retnum
  882. ));
  883. DBINT CS_PUBLIC dbretstatus  PROTOTYPE((
  884. DBPROCESS DBFAR *dbproc
  885. ));
  886. DBINT CS_PUBLIC dbspid  PROTOTYPE((
  887. DBPROCESS DBFAR *dbproc
  888. ));
  889. DBINT CS_PUBLIC dbspr1rowlen  PROTOTYPE((
  890. DBPROCESS DBFAR *dbproc
  891. ));
  892. DBINT CS_PUBLIC dbtextsize  PROTOTYPE((
  893. DBPROCESS DBFAR *dbproc
  894. ));
  895. DBPROCESS DBFAR * CS_PUBLIC dbopen  PROTOTYPE((
  896. LOGINREC DBFAR *password,
  897. char DBFAR *servername
  898. ));
  899. DBSORTORDER DBFAR * CS_PUBLIC dbloadsort  PROTOTYPE((
  900. DBPROCESS DBFAR *dbproc
  901. ));
  902. DBTYPEINFO DBFAR * CS_PUBLIC dbcoltypeinfo  PROTOTYPE((
  903. DBPROCESS DBFAR *dbproc,
  904. int colnumber
  905. ));
  906. EHANDLEFUNC CS_PUBLIC dberrhandle  PROTOTYPE((
  907. EHANDLEFUNC handler
  908. ));
  909. LOGINREC DBFAR * CS_PUBLIC dblogin  PROTOTYPE((
  910. void
  911. ));
  912. MHANDLEFUNC CS_PUBLIC dbmsghandle  PROTOTYPE((
  913. MHANDLEFUNC handler
  914. ));
  915. RETCODE CS_PUBLIC dbaltbind  PROTOTYPE((
  916. DBPROCESS DBFAR *dbproc,
  917. int computeid,
  918. int column,
  919. int vartype,
  920. DBINT varlen,
  921. BYTE DBFAR *destvar
  922. ));
  923. RETCODE CS_PUBLIC dbaltbind_ps  PROTOTYPE((
  924. DBPROCESS DBFAR *dbproc,
  925. int computeid,
  926. int column,
  927. int vartype,
  928. DBINT varlen,
  929. BYTE DBFAR *destvar,
  930. DBTYPEINFO DBFAR *typeinfo
  931. ));
  932. RETCODE CS_PUBLIC dbanullbind  PROTOTYPE((
  933. DBPROCESS DBFAR *dbproc,
  934. int computeid,
  935. int column,
  936. DBINT DBFAR *indicator
  937. ));
  938. RETCODE CS_PUBLIC dbbind  PROTOTYPE((
  939. DBPROCESS DBFAR *dbproc,
  940. int column,
  941. int vartype,
  942. DBINT varlen,
  943. BYTE DBFAR *destvar
  944. ));
  945. RETCODE CS_PUBLIC dbbind_ps  PROTOTYPE((
  946. DBPROCESS DBFAR *dbproc,
  947. int column,
  948. int vartype,
  949. DBINT varlen,
  950. BYTE DBFAR *destvar,
  951. DBTYPEINFO DBFAR *typeinfo
  952. ));
  953. RETCODE CS_PUBLIC dbcancel  PROTOTYPE((
  954. DBPROCESS DBFAR *dbproc
  955. ));
  956. #if VMS
  957. RETCODE CS_PUBLIC dbcancel_a  PROTOTYPE((
  958. DBPROCESS DBFAR *dbproc,
  959. RETCODE DBFAR *final_result,
  960. void (DBFAR *ast_proc )(),
  961. BYTE DBFAR *ast_param
  962. ));
  963. #endif /* VMS */
  964. RETCODE CS_PUBLIC dbcanquery  PROTOTYPE((
  965. DBPROCESS DBFAR *dbproc
  966. ));
  967. #if VMS
  968. RETCODE CS_PUBLIC dbcanquery_a  PROTOTYPE((
  969. DBPROCESS DBFAR *dbproc,
  970. RETCODE DBFAR *final_result,
  971. void (DBFAR *ast_proc )(),
  972. BYTE DBFAR *ast_param
  973. ));
  974. #endif /* VMS */
  975. RETCODE CS_PUBLIC dbclropt  PROTOTYPE((
  976. DBPROCESS DBFAR *dbproc,
  977. int option,
  978. char DBFAR *param
  979. ));
  980. RETCODE CS_PUBLIC dbcmd  PROTOTYPE((
  981. DBPROCESS DBFAR *dbproc,
  982. char DBFAR *cmdstring
  983. ));
  984. RETCODE CS_PUBLIC dbcursor  PROTOTYPE((
  985. DBCURSOR DBFAR *cursor,
  986. DBINT optype,
  987. DBINT bufno,
  988. BYTE DBFAR *table,
  989. BYTE DBFAR *values
  990. ));
  991. RETCODE CS_PUBLIC dbcursorbind  PROTOTYPE((
  992. DBCURSOR DBFAR *cursor,
  993. int column,
  994. int vartype,
  995. DBINT varlen,
  996. DBINT DBFAR *pvarlen,
  997. BYTE DBFAR *pvaraddr,
  998. DBTYPEINFO DBFAR *typeinfo
  999. ));
  1000. RETCODE CS_PUBLIC dbcursorclose  PROTOTYPE((
  1001. DBCURSOR DBFAR *cursor
  1002. ));
  1003. RETCODE CS_PUBLIC dbcursorcolinfo  PROTOTYPE((
  1004. DBCURSOR DBFAR *cursor,
  1005. DBINT column,
  1006. DBCHAR DBFAR *colname,
  1007. DBINT DBFAR *coltype,
  1008. DBINT DBFAR *collen,
  1009. DBINT DBFAR *usertype
  1010. ));
  1011. RETCODE CS_PUBLIC dbcursorfetch  PROTOTYPE((
  1012. DBCURSOR DBFAR *cursor,
  1013. DBINT fetchtype,
  1014. DBINT rownum
  1015. ));
  1016. RETCODE CS_PUBLIC dbcursorinfo  PROTOTYPE((
  1017. DBCURSOR DBFAR *cursor,
  1018. DBINT DBFAR *ncols,
  1019. DBINT DBFAR *nrows
  1020. ));
  1021. RETCODE CS_PUBLIC dbdate4zero  PROTOTYPE((
  1022. DBPROCESS DBFAR *dbproc,
  1023. DBDATETIME4 DBFAR *dateptr
  1024. ));
  1025. RETCODE CS_PUBLIC dbdatechar  PROTOTYPE((
  1026. DBPROCESS DBFAR *dbproc,
  1027. char DBFAR *charbuf,
  1028. int datepart,
  1029. int value
  1030. ));
  1031. RETCODE CS_PUBLIC dbdatecrack  PROTOTYPE((
  1032. DBPROCESS DBFAR *dbproc,
  1033. DBDATEREC DBFAR *dateinfo,
  1034. DBDATETIME DBFAR *datetime
  1035. ));
  1036. RETCODE CS_PUBLIC dbdatezero  PROTOTYPE((
  1037. DBPROCESS DBFAR *dbproc,
  1038. DBDATETIME DBFAR *dateptr
  1039. ));
  1040. RETCODE CS_PUBLIC dbfree_xlate  PROTOTYPE((
  1041. DBPROCESS DBFAR *dbproc,
  1042. DBXLATE DBFAR *xlt_tosrv,
  1043. DBXLATE DBFAR *xlt_todisp
  1044. ));
  1045. RETCODE CS_PUBLIC dbfreesort  PROTOTYPE((
  1046. DBPROCESS DBFAR *dbproc,
  1047. DBSORTORDER DBFAR *sortorder
  1048. ));
  1049. RETCODE CS_PUBLIC dbgetloginfo  PROTOTYPE((
  1050. DBPROCESS DBFAR *dbproc,
  1051. DBLOGINFO DBFAR *DBFAR *loginfo
  1052. ));
  1053. RETCODE CS_PUBLIC dbinit  PROTOTYPE((
  1054. void
  1055. ));
  1056. RETCODE CS_PUBLIC dbload_xlate  PROTOTYPE((
  1057. DBPROCESS DBFAR *dbproc,
  1058. char DBFAR *srv_charset,
  1059. char DBFAR *xlate_name,
  1060. DBXLATE DBFAR *DBFAR *xlt_tosrv,
  1061. DBXLATE DBFAR *DBFAR *xlt_todisp
  1062. ));
  1063. RETCODE CS_PUBLIC dbmny4add  PROTOTYPE((
  1064. DBPROCESS DBFAR *dbproc,
  1065. DBMONEY4 DBFAR *m1,
  1066. DBMONEY4 DBFAR *m2,
  1067. DBMONEY4 DBFAR *sum
  1068. ));
  1069. RETCODE CS_PUBLIC dbmny4copy  PROTOTYPE((
  1070. DBPROCESS DBFAR *dbproc,
  1071. DBMONEY4 DBFAR *src,
  1072. DBMONEY4 DBFAR *dest
  1073. ));
  1074. RETCODE CS_PUBLIC dbmny4divide  PROTOTYPE((
  1075. DBPROCESS DBFAR *dbproc,
  1076. DBMONEY4 DBFAR *m1,
  1077. DBMONEY4 DBFAR *m2,
  1078. DBMONEY4 DBFAR *quotient
  1079. ));
  1080. RETCODE CS_PUBLIC dbmny4minus  PROTOTYPE((
  1081. DBPROCESS DBFAR *dbproc,
  1082. DBMONEY4 DBFAR *src,
  1083. DBMONEY4 DBFAR *dest
  1084. ));
  1085. RETCODE CS_PUBLIC dbmny4mul  PROTOTYPE((
  1086. DBPROCESS DBFAR *dbproc,
  1087. DBMONEY4 DBFAR *m1,
  1088. DBMONEY4 DBFAR *m2,
  1089. DBMONEY4 DBFAR *product
  1090. ));
  1091. RETCODE CS_PUBLIC dbmny4sub  PROTOTYPE((
  1092. DBPROCESS DBFAR *dbproc,
  1093. DBMONEY4 DBFAR *m1,
  1094. DBMONEY4 DBFAR *m2,
  1095. DBMONEY4 DBFAR *difference
  1096. ));
  1097. RETCODE CS_PUBLIC dbmny4zero  PROTOTYPE((
  1098. DBPROCESS DBFAR *dbproc,
  1099. DBMONEY4 DBFAR *mny4ptr
  1100. ));
  1101. RETCODE CS_PUBLIC dbmnyadd  PROTOTYPE((
  1102. DBPROCESS DBFAR *dbproc,
  1103. DBMONEY DBFAR *m1,
  1104. DBMONEY DBFAR *m2,
  1105. DBMONEY DBFAR *sum
  1106. ));
  1107. RETCODE CS_PUBLIC dbmnycopy  PROTOTYPE((
  1108. DBPROCESS DBFAR *dbproc,
  1109. DBMONEY DBFAR *src,
  1110. DBMONEY DBFAR *dest
  1111. ));
  1112. RETCODE CS_PUBLIC dbmnydec  PROTOTYPE((
  1113. DBPROCESS DBFAR *dbproc,
  1114. DBMONEY DBFAR *mnyptr
  1115. ));
  1116. RETCODE CS_PUBLIC dbmnydivide  PROTOTYPE((
  1117. DBPROCESS DBFAR *dbproc,
  1118. DBMONEY DBFAR *m1,
  1119. DBMONEY DBFAR *m2,
  1120. DBMONEY DBFAR *quotient
  1121. ));
  1122. RETCODE CS_PUBLIC dbmnydown  PROTOTYPE((
  1123. DBPROCESS DBFAR *dbproc,
  1124. DBMONEY DBFAR *mnyptr,
  1125. int divisor,
  1126. int DBFAR *remainder
  1127. ));
  1128. RETCODE CS_PUBLIC dbmnyinc  PROTOTYPE((
  1129. DBPROCESS DBFAR *dbproc,
  1130. DBMONEY DBFAR *mnyptr
  1131. ));
  1132. RETCODE CS_PUBLIC dbmnyinit  PROTOTYPE((
  1133. DBPROCESS DBFAR *dbproc,
  1134. DBMONEY DBFAR *mnyptr,
  1135. int trim,
  1136. DBBOOL DBFAR *negative
  1137. ));
  1138. RETCODE CS_PUBLIC dbmnymaxneg  PROTOTYPE((
  1139. DBPROCESS DBFAR *dbproc,
  1140. DBMONEY DBFAR *dest
  1141. ));
  1142. RETCODE CS_PUBLIC dbmnymaxpos  PROTOTYPE((
  1143. DBPROCESS DBFAR *dbproc,
  1144. DBMONEY DBFAR *dest
  1145. ));
  1146. RETCODE CS_PUBLIC dbmnyminus  PROTOTYPE((
  1147. DBPROCESS DBFAR *dbproc,
  1148. DBMONEY DBFAR *src,
  1149. DBMONEY DBFAR *dest
  1150. ));
  1151. RETCODE CS_PUBLIC dbmnymul  PROTOTYPE((
  1152. DBPROCESS DBFAR *dbproc,
  1153. DBMONEY DBFAR *m1,
  1154. DBMONEY DBFAR *m2,
  1155. DBMONEY DBFAR *product
  1156. ));
  1157. RETCODE CS_PUBLIC dbmnyndigit  PROTOTYPE((
  1158. DBPROCESS DBFAR *dbproc,
  1159. DBMONEY DBFAR *mnyptr,
  1160. DBCHAR DBFAR *value,
  1161. DBBOOL DBFAR *zero
  1162. ));
  1163. RETCODE CS_PUBLIC dbmnyscale  PROTOTYPE((
  1164. DBPROCESS DBFAR *dbproc,
  1165. DBMONEY DBFAR *mnyptr,
  1166. int multiplier,
  1167. int addend
  1168. ));
  1169. RETCODE CS_PUBLIC dbmnysub  PROTOTYPE((
  1170. DBPROCESS DBFAR *dbproc,
  1171. DBMONEY DBFAR *m1,
  1172. DBMONEY DBFAR *m2,
  1173. DBMONEY DBFAR *difference
  1174. ));
  1175. RETCODE CS_PUBLIC dbmnyzero  PROTOTYPE((
  1176. DBPROCESS DBFAR *dbproc,
  1177. DBMONEY DBFAR *mnyptr
  1178. ));
  1179. RETCODE CS_PUBLIC dbmoretext  PROTOTYPE((
  1180. DBPROCESS DBFAR *dbproc,
  1181. DBINT size,
  1182. BYTE DBFAR *text
  1183. ));
  1184. RETCODE CS_PUBLIC dbnpcreate  PROTOTYPE((
  1185. DBPROCESS DBFAR *dbproc
  1186. ));
  1187. RETCODE CS_PUBLIC dbnpdefine  PROTOTYPE((
  1188. DBPROCESS DBFAR *dbproc,
  1189. DBCHAR DBFAR *name,
  1190. int namelen
  1191. ));
  1192. RETCODE CS_PUBLIC dbnullbind  PROTOTYPE((
  1193. DBPROCESS DBFAR *dbproc,
  1194. int column,
  1195. DBINT DBFAR *indicator
  1196. ));
  1197. #if VMS
  1198. RETCODE CS_PUBLIC dbopen_a  PROTOTYPE((
  1199. LOGINREC DBFAR *password,
  1200. char DBFAR *servername,
  1201. DBPROCESS DBFAR *DBFAR *dbprocptr,
  1202. RETCODE DBFAR *final_result,
  1203. void (DBFAR *ast_proc )(),
  1204. BYTE DBFAR *ast_param
  1205. ));
  1206. #endif /* VMS */
  1207. RETCODE CS_PUBLIC dbpoll  PROTOTYPE((
  1208. DBPROCESS DBFAR *dbproc,
  1209. long milliseconds,
  1210. DBPROCESS DBFAR *DBFAR *ready_dbproc,
  1211. int DBFAR *return_reason
  1212. ));
  1213. RETCODE CS_PUBLIC dbdataready  PROTOTYPE((
  1214. DBPROCESS DBFAR *dbproc
  1215. ));
  1216. #if VMS
  1217. RETCODE CS_PUBLIC dbpoll_a  PROTOTYPE((
  1218. DBPROCESS DBFAR *dbproc,
  1219. long milliseconds,
  1220. DBPROCESS DBFAR *DBFAR *ready_dbproc,
  1221. int DBFAR *return_reason,
  1222. RETCODE DBFAR *final_result,
  1223. void (DBFAR *ast_proc )(),
  1224. BYTE DBFAR *ast_param
  1225. ));
  1226. #endif /* VMS */
  1227. RETCODE CS_PUBLIC dbprrow  PROTOTYPE((
  1228. DBPROCESS DBFAR *dbproc
  1229. ));
  1230. RETCODE CS_PUBLIC dbrecvpassthru  PROTOTYPE((
  1231. DBPROCESS DBFAR *dbproc,
  1232. BYTE DBFAR *DBFAR *bufhandle
  1233. ));
  1234. RETCODE CS_PUBLIC dbregdrop  PROTOTYPE((
  1235. DBPROCESS DBFAR *dbproc,
  1236. DBCHAR DBFAR *name,
  1237. int namelen
  1238. ));
  1239. RETCODE CS_PUBLIC dbregexec  PROTOTYPE((
  1240. DBPROCESS DBFAR *dbproc,
  1241. int options
  1242. ));
  1243. RETCODE CS_PUBLIC dbreghandle  PROTOTYPE((
  1244. DBPROCESS DBFAR *dbproc,
  1245. DBCHAR DBFAR *name,
  1246. int namelen,
  1247. INTFUNCPTR handler
  1248. ));
  1249. RETCODE CS_PUBLIC dbreginit  PROTOTYPE((
  1250. DBPROCESS DBFAR *dbproc,
  1251. DBCHAR DBFAR *name,
  1252. int namelen
  1253. ));
  1254. RETCODE CS_PUBLIC dbreglist  PROTOTYPE((
  1255. DBPROCESS DBFAR *dbproc
  1256. ));
  1257. RETCODE CS_PUBLIC dbregnowatch  PROTOTYPE((
  1258. DBPROCESS DBFAR *dbproc,
  1259. DBCHAR DBFAR *name,
  1260. int namelen
  1261. ));
  1262. RETCODE CS_PUBLIC dbregparam  PROTOTYPE((
  1263. DBPROCESS DBFAR *dbproc,
  1264. DBCHAR DBFAR *name,
  1265. int type,
  1266. DBINT datalen,
  1267. DBVOIDPTR data
  1268. ));
  1269. RETCODE CS_PUBLIC dbregwatch  PROTOTYPE((
  1270. DBPROCESS DBFAR *dbproc,
  1271. DBCHAR DBFAR *name,
  1272. int namelen,
  1273. int options
  1274. ));
  1275. RETCODE CS_PUBLIC dbregwatchlist  PROTOTYPE((
  1276. DBPROCESS DBFAR *dbproc
  1277. ));
  1278. RETCODE CS_PUBLIC dbresults  PROTOTYPE((
  1279. DBPROCESS DBFAR *dbproc
  1280. ));
  1281. #if VMS
  1282. RETCODE CS_PUBLIC dbresults_a  PROTOTYPE((
  1283. DBPROCESS DBFAR *dbproc,
  1284. RETCODE DBFAR *final_result,
  1285. void (DBFAR *ast_proc )(),
  1286. BYTE DBFAR *ast_param
  1287. ));
  1288. #endif /* VMS */
  1289. RETCODE CS_PUBLIC dbrpcinit  PROTOTYPE((
  1290. DBPROCESS DBFAR *dbproc,
  1291. char DBFAR *rpcname,
  1292. int options
  1293. ));
  1294. RETCODE CS_PUBLIC dbrpcparam  PROTOTYPE((
  1295. DBPROCESS DBFAR *dbproc,
  1296. char DBFAR *paramname,
  1297. int status,
  1298. int type,
  1299. DBINT maxlen,
  1300. DBINT datalen,
  1301. BYTE DBFAR *value
  1302. ));
  1303. RETCODE CS_PUBLIC dbrpcsend  PROTOTYPE((
  1304. DBPROCESS DBFAR *dbproc
  1305. ));
  1306. RETCODE CS_PUBLIC dbrpwset  PROTOTYPE((
  1307. LOGINREC DBFAR *loginrec,
  1308. char DBFAR *servername,
  1309. char DBFAR *password,
  1310. int pwlen
  1311. ));
  1312. RETCODE CS_PUBLIC dbsafestr  PROTOTYPE((
  1313. DBPROCESS DBFAR *dbproc,
  1314. char DBFAR *src,
  1315. DBINT srclen,
  1316. char DBFAR *dest,
  1317. DBINT destlen,
  1318. int quotetype
  1319. ));
  1320. RETCODE CS_PUBLIC dbsechandle  PROTOTYPE((
  1321. DBINT type,
  1322. INTFUNCPTR handler
  1323. ));
  1324. RETCODE CS_PUBLIC dbsendpassthru  PROTOTYPE((
  1325. DBPROCESS DBFAR *dbproc,
  1326. BYTE DBFAR *buf
  1327. ));
  1328. RETCODE CS_PUBLIC dbsetconnect  PROTOTYPE((
  1329. char DBFAR *service_type,
  1330. char DBFAR *net_type,
  1331. char DBFAR *net_name,
  1332. char DBFAR *machine_name,
  1333. char DBFAR *port
  1334. ));
  1335. RETCODE CS_PUBLIC dbsetdefcharset  PROTOTYPE((
  1336. char DBFAR *charset
  1337. ));
  1338. RETCODE CS_PUBLIC dbsetdeflang  PROTOTYPE((
  1339. char DBFAR *language
  1340. ));
  1341. RETCODE CS_PUBLIC dbsetloginfo  PROTOTYPE((
  1342. LOGINREC DBFAR *loginrec,
  1343. DBLOGINFO DBFAR *loginfo
  1344. ));
  1345. RETCODE CS_PUBLIC dbsetlogintime  PROTOTYPE((
  1346. int seconds
  1347. ));
  1348. RETCODE CS_PUBLIC dbsetmaxprocs  PROTOTYPE((
  1349. int maxprocs
  1350. ));
  1351. RETCODE CS_PUBLIC dbsetnotifs  PROTOTYPE((
  1352. int event_state
  1353. ));
  1354. RETCODE CS_PUBLIC dbsetnull  PROTOTYPE((
  1355. DBPROCESS DBFAR *dbproc,
  1356. int bindtype,
  1357. int bindlen,
  1358. BYTE DBFAR *bindval
  1359. ));
  1360. RETCODE CS_PUBLIC dbsetopt  PROTOTYPE((
  1361. DBPROCESS DBFAR *dbproc,
  1362. int option,
  1363. char DBFAR *char_param,
  1364. int int_param
  1365. ));
  1366. RETCODE CS_PUBLIC dbsetsecurity  PROTOTYPE((
  1367. LOGINREC DBFAR *loginrec,
  1368. char DBFAR *labelname,
  1369. char DBFAR *labelvalue
  1370. ));
  1371. RETCODE CS_PUBLIC dbsettime  PROTOTYPE((
  1372. int seconds
  1373. ));
  1374. RETCODE CS_PUBLIC dbsettimeout  PROTOTYPE((
  1375. DBPROCESS DBFAR *dbproc,
  1376. int seconds
  1377. ));
  1378. RETCODE CS_PUBLIC dbsetversion  PROTOTYPE((
  1379. DBINT version
  1380. ));
  1381. RETCODE CS_PUBLIC dbspr1row  PROTOTYPE((
  1382. DBPROCESS DBFAR *dbproc,
  1383. char DBFAR *buffer,
  1384. DBINT buf_len
  1385. ));
  1386. RETCODE CS_PUBLIC dbsprhead  PROTOTYPE((
  1387. DBPROCESS DBFAR *dbproc,
  1388. char DBFAR *buffer,
  1389. DBINT buf_len
  1390. ));
  1391. RETCODE CS_PUBLIC dbsprline  PROTOTYPE((
  1392. DBPROCESS DBFAR *dbproc,
  1393. char DBFAR *buffer,
  1394. DBINT buf_len,
  1395. int linechar
  1396. ));
  1397. RETCODE CS_PUBLIC dbsqlexec  PROTOTYPE((
  1398. DBPROCESS DBFAR *dbproc
  1399. ));
  1400. #if VMS
  1401. RETCODE CS_PUBLIC dbsqlexec_a  PROTOTYPE((
  1402. DBPROCESS DBFAR *dbproc,
  1403. RETCODE DBFAR *final_result,
  1404. void (DBFAR *ast_proc )(),
  1405. BYTE DBFAR *ast_param
  1406. ));
  1407. #endif /* VMS */
  1408. RETCODE CS_PUBLIC dbsqlok  PROTOTYPE((
  1409. DBPROCESS DBFAR *dbproc
  1410. ));
  1411. #if VMS
  1412. RETCODE CS_PUBLIC dbsqlok_a  PROTOTYPE((
  1413. DBPROCESS DBFAR *dbproc,
  1414. RETCODE DBFAR *final_result,
  1415. void (DBFAR *ast_proc )(),
  1416. BYTE DBFAR *ast_param
  1417. ));
  1418. #endif /* VMS */
  1419. RETCODE CS_PUBLIC dbsqlsend  PROTOTYPE((
  1420. DBPROCESS DBFAR *dbproc
  1421. ));
  1422. RETCODE CS_PUBLIC dbstrcpy  PROTOTYPE((
  1423. DBPROCESS DBFAR *dbproc,
  1424. int start,
  1425. int numbytes,
  1426. char DBFAR *dest
  1427. ));
  1428. RETCODE CS_PUBLIC dbtsput  PROTOTYPE((
  1429. DBPROCESS DBFAR *dbproc,
  1430. DBBINARY DBFAR *newts,
  1431. int newtslen,
  1432. int tabnum,
  1433. char DBFAR *tabname
  1434. ));
  1435. RETCODE CS_PUBLIC dbtxtsput  PROTOTYPE((
  1436. DBPROCESS DBFAR *dbproc,
  1437. DBBINARY DBFAR *newtxts,
  1438. int colnum
  1439. ));
  1440. RETCODE CS_PUBLIC dbuse  PROTOTYPE((
  1441. DBPROCESS DBFAR *dbproc,
  1442. char DBFAR *name
  1443. ));
  1444. RETCODE CS_PUBLIC dbwritepage  PROTOTYPE((
  1445. DBPROCESS DBFAR *dbproc,
  1446. char DBFAR *p_dbname,
  1447. DBINT pageno,
  1448. DBINT size,
  1449. BYTE buf[]
  1450. ));
  1451. RETCODE CS_PUBLIC dbwritetext PROTOTYPE((
  1452. DBPROCESS DBFAR *dbproc,
  1453. char DBFAR *objname,
  1454. DBBINARY DBFAR *textptr,
  1455. int textptrlen,
  1456. DBBINARY DBFAR *timestamp,
  1457. int log,
  1458. DBINT size,
  1459. BYTE DBFAR *text
  1460. ));
  1461. RETCODE CS_PUBLIC dbgetrow  PROTOTYPE((
  1462. DBPROCESS DBFAR *dbproc,
  1463. DBINT row
  1464. ));
  1465. RETCODE CS_PUBLIC dbnextrow  PROTOTYPE((
  1466. DBPROCESS DBFAR *dbproc
  1467. ));
  1468. #if VMS
  1469. STATUS CS_PUBLIC dbnextrow_a  PROTOTYPE((
  1470. DBPROCESS DBFAR *dbproc,
  1471. RETCODE DBFAR *final_result,
  1472. void (DBFAR *ast_proc )(),
  1473. BYTE DBFAR *ast_param
  1474. ));
  1475. #endif /* VMS */
  1476. RETCODE CS_PUBLIC dbreadtext  PROTOTYPE((
  1477. DBPROCESS DBFAR *dbproc,
  1478. void DBFAR *buf,
  1479. DBINT bufsize
  1480. ));
  1481. RETCODE CS_PUBLIC dbsetrow  PROTOTYPE((
  1482. DBPROCESS DBFAR *dbproc,
  1483. DBINT row
  1484. ));
  1485. void DBFAR * CS_PUBLIC dbcursoropen  PROTOTYPE((
  1486. DBPROCESS DBFAR *dbproc,
  1487. BYTE DBFAR *stmt,
  1488. DBINT scrollopt,
  1489. DBINT concuropt,
  1490. DBINT nrows,
  1491. DBINT DBFAR *pstat
  1492. ));
  1493. void DBFAR * CS_PUBLIC dbgetcharattrib  PROTOTYPE((
  1494. DBPROCESS DBFAR *p
  1495. ));
  1496. char DBFAR * CS_PUBLIC dbchange  PROTOTYPE((
  1497. DBPROCESS DBFAR *dbproc
  1498. ));
  1499. char DBFAR * CS_PUBLIC dbcolname  PROTOTYPE((
  1500. DBPROCESS DBFAR *dbproc,
  1501. int colnumber
  1502. ));
  1503. char DBFAR * CS_PUBLIC dbcolsource  PROTOTYPE((
  1504. DBPROCESS DBFAR *dbproc,
  1505. int colnumber
  1506. ));
  1507. char DBFAR * CS_PUBLIC dbdateorder  PROTOTYPE((
  1508. DBPROCESS DBFAR *dbproc,
  1509. char DBFAR *language
  1510. ));
  1511. char DBFAR * CS_PUBLIC dbdayname  PROTOTYPE((
  1512. DBPROCESS DBFAR *dbproc,
  1513. char DBFAR *language,
  1514. int daynum
  1515. ));
  1516. char DBFAR * CS_PUBLIC dbgetchar  PROTOTYPE((
  1517. DBPROCESS DBFAR *dbproc,
  1518. int n
  1519. ));
  1520. char DBFAR * CS_PUBLIC dbgetcharset  PROTOTYPE((
  1521. DBPROCESS DBFAR *dbproc
  1522. ));
  1523. char DBFAR * CS_PUBLIC dbgetnatlang  PROTOTYPE((
  1524. DBPROCESS DBFAR *dbproc
  1525. ));
  1526. char DBFAR * CS_PUBLIC dbmonthname  PROTOTYPE((
  1527. DBPROCESS DBFAR *dbproc,
  1528. char DBFAR *language,
  1529. int monthnum,
  1530. int shortform
  1531. ));
  1532. char DBFAR * CS_PUBLIC dbname  PROTOTYPE((
  1533. DBPROCESS DBFAR *dbproc
  1534. ));
  1535. char DBFAR * CS_PUBLIC dbprtype  PROTOTYPE((
  1536. int type
  1537. ));
  1538. char DBFAR * CS_PUBLIC dbqual  PROTOTYPE((
  1539. DBPROCESS DBFAR *dbproc,
  1540. int tabnum,
  1541. char DBFAR *tabname
  1542. ));
  1543. char DBFAR * CS_PUBLIC dbretname  PROTOTYPE((
  1544. DBPROCESS DBFAR *dbproc,
  1545. int retnum
  1546. ));
  1547. char DBFAR * CS_PUBLIC dbservcharset  PROTOTYPE((
  1548. DBPROCESS DBFAR *dbproc
  1549. ));
  1550. char DBFAR * CS_PUBLIC dbtabname  PROTOTYPE((
  1551. DBPROCESS DBFAR *dbproc,
  1552. int tabnum
  1553. ));
  1554. char DBFAR * CS_PUBLIC dbtabsource  PROTOTYPE((
  1555. DBPROCESS DBFAR *dbproc,
  1556. int colnum,
  1557. int DBFAR *tabnum
  1558. ));
  1559. char DBFAR * CS_PUBLIC dbversion  PROTOTYPE((
  1560. void
  1561. ));
  1562. int CS_PUBLIC dbaltcolid  PROTOTYPE((
  1563. DBPROCESS DBFAR *dbproc,
  1564. int computeid,
  1565. int colnumber
  1566. ));
  1567. int CS_PUBLIC dbaltop  PROTOTYPE((
  1568. DBPROCESS DBFAR *dbproc,
  1569. int computeid,
  1570. int colnumber
  1571. ));
  1572. int CS_PUBLIC dbalttype  PROTOTYPE((
  1573. DBPROCESS DBFAR *dbproc,
  1574. int computeid,
  1575. int colnumber
  1576. ));
  1577. int CS_PUBLIC dbaltutype  PROTOTYPE((
  1578. DBPROCESS DBFAR *dbproc,
  1579. int computeid,
  1580. int colnumber
  1581. ));
  1582. int CS_PUBLIC dbbufsize  PROTOTYPE((
  1583. DBPROCESS DBFAR *dbproc
  1584. ));
  1585. int CS_PUBLIC dbcoltype  PROTOTYPE((
  1586. DBPROCESS DBFAR *dbproc,
  1587. int colnumber
  1588. ));
  1589. DBINT CS_PUBLIC dbcolutype  PROTOTYPE((
  1590. DBPROCESS DBFAR *dbproc,
  1591. int colnumber
  1592. ));
  1593. int CS_PUBLIC dbdate4cmp  PROTOTYPE((
  1594. DBPROCESS DBFAR *dbproc,
  1595. DBDATETIME4 DBFAR *d1,
  1596. DBDATETIME4 DBFAR *d2
  1597. ));
  1598. int CS_PUBLIC dbdatecmp  PROTOTYPE((
  1599. DBPROCESS DBFAR *dbproc,
  1600. DBDATETIME DBFAR *d1,
  1601. DBDATETIME DBFAR *d2
  1602. ));
  1603. int CS_PUBLIC dbdatename  PROTOTYPE((
  1604. DBPROCESS DBFAR *dbproc,
  1605. char DBFAR *charbuf,
  1606. int datepart,
  1607. DBDATETIME DBFAR *datetime
  1608. ));
  1609. int CS_PUBLIC dbgetlusername  PROTOTYPE((
  1610. LOGINREC DBFAR *login,
  1611. BYTE DBFAR *name_buffer,
  1612. int buffer_len
  1613. ));
  1614. int CS_PUBLIC dbgetlpassword  PROTOTYPE((
  1615. LOGINREC DBFAR *login,
  1616. BYTE DBFAR *passwd_buffer,
  1617. int buffer_len
  1618. ));
  1619. int CS_PUBLIC dbgetmaxprocs  PROTOTYPE((
  1620. void
  1621. ));
  1622. int CS_PUBLIC dbgetoff  PROTOTYPE((
  1623. DBPROCESS DBFAR *dbproc,
  1624. int type,
  1625. int start
  1626. ));
  1627. int CS_PUBLIC dbgetpacket  PROTOTYPE((
  1628. DBPROCESS DBFAR *dbproc
  1629. ));
  1630. int CS_PUBLIC dbmny4cmp  PROTOTYPE((
  1631. DBPROCESS DBFAR *dbproc,
  1632. DBMONEY4 DBFAR *m1,
  1633. DBMONEY4 DBFAR *m2
  1634. ));
  1635. int CS_PUBLIC dbmnycmp  PROTOTYPE((
  1636. DBPROCESS DBFAR *dbproc,
  1637. DBMONEY DBFAR *m1,
  1638. DBMONEY DBFAR *m2
  1639. ));
  1640. int CS_PUBLIC dbnumalts  PROTOTYPE((
  1641. DBPROCESS DBFAR *dbproc,
  1642. int id
  1643. ));
  1644. int CS_PUBLIC dbnumcols  PROTOTYPE((
  1645. DBPROCESS DBFAR *dbproc
  1646. ));
  1647. int CS_PUBLIC dbnumcompute  PROTOTYPE((
  1648. DBPROCESS DBFAR *dbproc
  1649. ));
  1650. int CS_PUBLIC dbnumrets  PROTOTYPE((
  1651. DBPROCESS DBFAR *dbproc
  1652. ));
  1653. int CS_PUBLIC dbordercol  PROTOTYPE((
  1654. DBPROCESS DBFAR *dbproc,
  1655. int order
  1656. ));
  1657. int CS_PUBLIC dbrettype  PROTOTYPE((
  1658. DBPROCESS DBFAR *dbproc,
  1659. int retnum
  1660. ));
  1661. int CS_PUBLIC dbstrcmp  PROTOTYPE((
  1662. DBPROCESS DBFAR *dbproc,
  1663. char DBFAR *str1,
  1664. int len1,
  1665. char DBFAR *str2,
  1666. int len2,
  1667. DBSORTORDER DBFAR *sortorder
  1668. ));
  1669. int CS_PUBLIC dbstrlen  PROTOTYPE((
  1670. DBPROCESS DBFAR *dbproc
  1671. ));
  1672. int CS_PUBLIC dbstrsort  PROTOTYPE((
  1673. DBPROCESS DBFAR *dbproc,
  1674. char DBFAR *str1,
  1675. int len1,
  1676. char DBFAR *str2,
  1677. int len2,
  1678. DBSORTORDER DBFAR *sortorder
  1679. ));
  1680. int CS_PUBLIC dbtabcount  PROTOTYPE((
  1681. DBPROCESS DBFAR *dbproc
  1682. ));
  1683. int CS_PUBLIC dbtsnewlen  PROTOTYPE((
  1684. DBPROCESS DBFAR *dbproc
  1685. ));
  1686. int CS_PUBLIC dbxlate PROTOTYPE((
  1687. DBPROCESS DBFAR *dbproc,
  1688. char DBFAR *src,
  1689. int srclen,
  1690. char DBFAR *dest,
  1691. int destlen,
  1692. DBXLATE DBFAR *xlt,
  1693. int DBFAR *srcbytes_used,
  1694. int srcend,
  1695. int DBFAR *status
  1696. ));
  1697. void CS_PUBLIC dbclose  PROTOTYPE((
  1698. DBPROCESS DBFAR *dbproc
  1699. ));
  1700. void CS_PUBLIC dbclrbuf  PROTOTYPE((
  1701. DBPROCESS DBFAR *dbproc,
  1702. DBINT n
  1703. ));
  1704. void CS_PUBLIC dbdbchange  PROTOTYPE((
  1705. DBPROCESS DBFAR *dbproc,
  1706. DBINFO DBFAR *info
  1707. ));
  1708. void CS_PUBLIC dbexit  PROTOTYPE((
  1709. void
  1710. ));
  1711. void CS_PUBLIC dbfreebuf  PROTOTYPE((
  1712. DBPROCESS DBFAR *dbproc
  1713. ));
  1714. void CS_PUBLIC dbfreequal  PROTOTYPE((
  1715. char DBFAR *qualptr
  1716. ));
  1717. void CS_PUBLIC dbloginfree  PROTOTYPE((
  1718. LOGINREC DBFAR *loginptr
  1719. ));
  1720. #if VMS
  1721. void CS_PUBLIC dbpoll_timer_ast  PROTOTYPE((
  1722. DBPROCESS DBFAR *dbproc
  1723. ));
  1724. #endif /* VMS */
  1725. void CS_PUBLIC dbprhead  PROTOTYPE((
  1726. DBPROCESS DBFAR *dbproc
  1727. ));
  1728. void CS_PUBLIC dbrecftos  PROTOTYPE((
  1729. char DBFAR *filename
  1730. ));
  1731. void CS_PUBLIC dbrpwclr  PROTOTYPE((
  1732. LOGINREC DBFAR *loginrec
  1733. ));
  1734. void CS_PUBLIC dbsetavail  PROTOTYPE((
  1735. DBPROCESS DBFAR *dbproc
  1736. ));
  1737. void CS_PUBLIC dbsetbusy  PROTOTYPE((
  1738. DBPROCESS DBFAR *dbproc,
  1739. DB_DBBUSY_FUNC busyfunc
  1740. ));
  1741. void CS_PUBLIC dbsetidle  PROTOTYPE((
  1742. DBPROCESS DBFAR *dbproc,
  1743. DB_DBIDLE_FUNC idlefunc
  1744. ));
  1745. void CS_PUBLIC dbsetifile  PROTOTYPE((
  1746. char DBFAR *filename
  1747. ));
  1748. void CS_PUBLIC dbsetinterrupt  PROTOTYPE((
  1749. DBPROCESS DBFAR *dbproc,
  1750. DB_DBCHKINTR_FUNC chkintr,
  1751. DB_DBHNDLINTR_FUNC hndlintr
  1752. ));
  1753. void CS_PUBLIC dbsetuserdata  PROTOTYPE((
  1754. DBPROCESS DBFAR *dbproc,
  1755. BYTE DBFAR *ptr
  1756. ));
  1757. void CS_PUBLIC dbuse_msg_handler  PROTOTYPE((
  1758. DBPROCESS DBFAR *dbproc,
  1759. DBINT msgno,
  1760. int msgstate,
  1761. int severity,
  1762. char DBFAR *msgtext,
  1763. char DBFAR *servername,
  1764. char DBFAR *procname,
  1765. int line
  1766. ));
  1767. /* BCP prototypes */
  1768. BCPDESC DBFAR * CS_PUBLIC  bcpinit  PROTOTYPE((
  1769. LOGINREC DBFAR *login,
  1770. char DBFAR *servername,
  1771. char DBFAR *tblname,
  1772. char DBFAR *hfile,
  1773. int direction
  1774. ));
  1775. BYTE CS_PUBLIC  bcp_hosttype  PROTOTYPE((
  1776. DBPROCESS DBFAR *a,
  1777. int b
  1778. ));
  1779. DBBOOL CS_PUBLIC  bcp_getl  PROTOTYPE((
  1780. LOGINREC DBFAR *login
  1781. ));
  1782. DBINT CS_PUBLIC  bcp_batch  PROTOTYPE((
  1783. DBPROCESS DBFAR *dbproc
  1784. ));
  1785. DBINT CS_PUBLIC  bcp_done  PROTOTYPE((
  1786. DBPROCESS DBFAR *dbproc
  1787. ));
  1788. DBINT CS_PUBLIC  bcpdone  PROTOTYPE((
  1789. BCPDESC DBFAR *bcpdesc
  1790. ));
  1791. RETCODE CS_PUBLIC  bcp_bind  PROTOTYPE((
  1792. DBPROCESS DBFAR *dbproc,
  1793. BYTE DBFAR *varaddr,
  1794. int prefixlen,
  1795. DBINT varlen,
  1796. BYTE DBFAR *terminator,
  1797. int termlen,
  1798. int type,
  1799. int table_column
  1800. ));
  1801. RETCODE CS_PUBLIC  bcp_colfmt PROTOTYPE((
  1802. DBPROCESS DBFAR *dbproc,
  1803. int host_colnum,
  1804. int host_type,
  1805. int host_prefixlen,
  1806. DBINT host_collen,
  1807. BYTE DBFAR *host_term,
  1808. int host_termlen,
  1809. int table_colnum
  1810. ));
  1811. RETCODE CS_PUBLIC  bcp_colfmt_ps PROTOTYPE((
  1812. DBPROCESS DBFAR *dbproc,
  1813. int host_colnum,
  1814. int host_type,
  1815. int host_prefixlen,
  1816. DBINT host_collen,
  1817. BYTE DBFAR *host_term,
  1818. int host_termlen,
  1819. int table_colnum,
  1820. DBTYPEINFO DBFAR *typeinfo
  1821. ));
  1822. RETCODE CS_PUBLIC  bcp_collen  PROTOTYPE((
  1823. DBPROCESS DBFAR *dbproc,
  1824. DBINT varlen,
  1825. int table_column
  1826. ));
  1827. RETCODE CS_PUBLIC  bcp_colptr  PROTOTYPE((
  1828. DBPROCESS DBFAR *dbproc,
  1829. BYTE DBFAR *colptr,
  1830. int table_column
  1831. ));
  1832. RETCODE CS_PUBLIC  bcp_columns  PROTOTYPE((
  1833. DBPROCESS DBFAR *dbproc,
  1834. int host_colcount
  1835. ));
  1836. RETCODE CS_PUBLIC  bcp_control  PROTOTYPE((
  1837. DBPROCESS DBFAR *dbproc,
  1838. int field,
  1839. DBINT value
  1840. ));
  1841. RETCODE CS_PUBLIC  bcp_exec  PROTOTYPE((
  1842. DBPROCESS DBFAR *dbproc,
  1843. DBINT DBFAR *rows_copied
  1844. ));
  1845. RETCODE CS_PUBLIC  bcp_init  PROTOTYPE((
  1846. DBPROCESS DBFAR *dbproc,
  1847. char DBFAR *tblname,
  1848. char DBFAR *hfile,
  1849. char DBFAR *errfile,
  1850. int direction
  1851. ));
  1852. RETCODE CS_PUBLIC  bcp_moretext  PROTOTYPE((
  1853. DBPROCESS DBFAR *dbproc,
  1854. DBINT size,
  1855. BYTE DBFAR *text
  1856. ));
  1857. RETCODE CS_PUBLIC  bcp_options  PROTOTYPE((
  1858. DBPROCESS DBFAR *dbproc,
  1859. int option,
  1860. BYTE DBFAR *value,
  1861. int valuelen
  1862. ));
  1863. RETCODE CS_PUBLIC  bcp_readfmt  PROTOTYPE((
  1864. DBPROCESS DBFAR *dbproc,
  1865. char DBFAR *filename
  1866. ));
  1867. RETCODE CS_PUBLIC  bcp_sendrow  PROTOTYPE((
  1868. DBPROCESS DBFAR *dbproc
  1869. ));
  1870. RETCODE CS_PUBLIC  bcp_setxlate  PROTOTYPE((
  1871. DBPROCESS DBFAR *dbproc,
  1872. DBXLATE DBFAR *xlt_tosrv,
  1873. DBXLATE DBFAR *xlt_todisp
  1874. ));
  1875. RETCODE CS_PUBLIC  bcp_writefmt  PROTOTYPE((
  1876. DBPROCESS DBFAR *dbproc,
  1877. char DBFAR *filename
  1878. ));
  1879. RETCODE CS_PUBLIC  bcpabort  PROTOTYPE((
  1880. BCPDESC DBFAR *bcpdesc
  1881. ));
  1882. RETCODE CS_PUBLIC  bcpbind  PROTOTYPE((
  1883. BCPDESC DBFAR *bcpdesc,
  1884. BYTE DBFAR *varaddr,
  1885. int varlen,
  1886. char DBFAR *term,
  1887. int type,
  1888. int table_column
  1889. ));
  1890. RETCODE CS_PUBLIC  bcpcollen  PROTOTYPE((
  1891. BCPDESC DBFAR *bcpdesc,
  1892. int varlen,
  1893. int table_column
  1894. ));
  1895. RETCODE CS_PUBLIC  bcpcolumn  PROTOTYPE((
  1896. BCPDESC DBFAR *bcpdesc,
  1897. int columns
  1898. ));
  1899. RETCODE CS_PUBLIC  bcpcontrol  PROTOTYPE((
  1900. BCPDESC DBFAR *bcpdesc,
  1901. int field,
  1902. BYTE DBFAR *value
  1903. ));
  1904. RETCODE CS_PUBLIC  bcpexec  PROTOTYPE((
  1905. BCPDESC DBFAR *bcpdesc,
  1906. DBINT DBFAR *rows_copied
  1907. ));
  1908. RETCODE CS_PUBLIC  bcpformat  PROTOTYPE((
  1909. BCPDESC DBFAR *bcpdesc,
  1910. int index,
  1911. int length,
  1912. char DBFAR *term,
  1913. int type,
  1914. int table_column
  1915. ));
  1916. RETCODE CS_PUBLIC  bcpsendrow  PROTOTYPE((
  1917. BCPDESC DBFAR *bcpdesc
  1918. ));
  1919. RETCODE CS_PUBLIC bcpcolptr  PROTOTYPE((
  1920. BCPDESC DBFAR *bcpdesc,
  1921. BYTE DBFAR *varaddr,
  1922. int table_column
  1923. ));
  1924. DBPROCESS DBFAR * CS_PUBLIC open_commit  PROTOTYPE((
  1925. LOGINREC DBFAR *login,
  1926. char DBFAR *service
  1927. ));
  1928. void CS_PUBLIC close_commit  PROTOTYPE((
  1929. DBPROCESS DBFAR *connect
  1930. ));
  1931. void CS_PUBLIC build_xact_string  PROTOTYPE((
  1932. char DBFAR *xact_name,
  1933. char DBFAR *service_name,
  1934. DBINT commid,
  1935. char DBFAR *result
  1936. ));
  1937. DBINT CS_PUBLIC start_xact  PROTOTYPE((
  1938. DBPROCESS DBFAR *connect,
  1939. char DBFAR *application_name,
  1940. char DBFAR *xact_name,
  1941. int count
  1942. ));
  1943. RETCODE CS_PUBLIC commit_xact  PROTOTYPE((
  1944. DBPROCESS DBFAR *connect,
  1945. DBINT commid
  1946. ));
  1947. RETCODE CS_PUBLIC abort_xact  PROTOTYPE((
  1948. DBPROCESS DBFAR *connect,
  1949. DBINT commid
  1950. ));
  1951. RETCODE CS_PUBLIC remove_xact  PROTOTYPE((
  1952. DBPROCESS DBFAR *connect,
  1953. DBINT commid,
  1954. int n
  1955. ));
  1956. RETCODE CS_PUBLIC scan_xact  PROTOTYPE((
  1957. DBPROCESS DBFAR *connect,
  1958. DBINT commid
  1959. ));
  1960. int CS_PUBLIC stat_xact  PROTOTYPE((
  1961. DBPROCESS DBFAR *connect,
  1962. DBINT commid
  1963. ));
  1964. int CS_PUBLIC probe_xact  PROTOTYPE((
  1965. DBPROCESS DBFAR *connect,
  1966. DBINT commid
  1967. ));
  1968. #ifndef __SYB_INTERNAL__
  1969. RETCODE CS_VARARGS dbfcmd PROTOTYPE((
  1970. DBPROCESS DBFAR *dbproc CS_ELLIPSE
  1971. ));
  1972. int CS_VARARGS dbstrbuild PROTOTYPE((
  1973. DBPROCESS DBFAR *dbproc CS_ELLIPSE
  1974. ));
  1975. #endif /* !defined(__SYB_INTERNAL__) */
  1976. CS_END_EXTERN_C
  1977. /*
  1978. ** Include the Windows DB-Library 4.2 Compatibility Layer.
  1979. */
  1980. #if defined(USE_42_MAPPING)
  1981. #include <db42to10.h>
  1982. #endif /* USE_42_MAPPING */
  1983. #endif /*  __sybdb__ */