home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / srvdbtyp.h < prev    next >
C/C++ Source or Header  |  1998-04-25  |  2KB  |  94 lines

  1. #if !defined( DBTYPEDEFS )  // So we don't conflict with DBLIB definitions
  2. //
  3. // define data types
  4. //
  5. typedef unsigned char DBBOOL;
  6. typedef unsigned char DBBYTE;
  7. typedef unsigned char DBTINYINT;
  8. typedef short DBSMALLINT;
  9. typedef unsigned short DBUSMALLINT;
  10. typedef long DBINT;
  11. typedef char DBCHAR;
  12. typedef unsigned char DBBINARY;
  13. typedef unsigned char DBBIT;
  14. typedef double DBFLT8;
  15.  
  16. #ifndef ODBCVER
  17. typedef int RETCODE;        // SUCCEED or FAIL
  18. #endif
  19.  
  20. typedef struct srv_datetime { // DataServer datetime type 
  21.     long dtdays;            // number of days since 1/1/1900
  22.     unsigned long dttime;   // number 300th second since mid
  23.  
  24. } DBDATETIME;
  25.  
  26. typedef struct srv_money {   // DataServer money type 
  27.     long mnyhigh;
  28.     unsigned long mnylow;
  29.  
  30. } DBMONEY;
  31.  
  32. #ifdef _OS2
  33. typedef unsigned short BOOL;
  34. #else
  35. typedef int         BOOL;
  36. #endif
  37. typedef unsigned char BYTE;
  38.  
  39. // These are version 4.2 additions                                      
  40. //
  41. typedef float DBFLT4;
  42. typedef long DBMONEY4;
  43.  
  44. #define DBREAL  DBFLT4
  45. typedef struct dbdatetime4 {
  46.     unsigned short numdays; // No of days since Jan-1-1900             
  47.     unsigned short nummins; // No. of minutes since midnight           
  48. } DBDATETIM4;
  49.  
  50. /* DBDATEREC structure used by dbdatecrack. This is a version 4.2 addition */
  51. typedef struct dbdaterec
  52. {
  53.     int     year;        /* 1753 - 9999 */
  54.     int     quarter;        /* 1 - 4 */
  55.     int     month;        /* 1 - 12 */
  56.     int     dayofyear;        /* 1 - 366 */
  57.     int     day;        /* 1 - 31 */
  58.     int     week;        /* 1 - 54 (for leap years) */
  59.     int     weekday;        /* 1 - 7  (Mon - Sun) */
  60.     int     hour;        /* 0 - 23 */
  61.     int     minute;        /* 0 - 59 */
  62.     int     second;        /* 0 - 59 */
  63.     int     millisecond;    /* 0 - 999 */
  64. } DBDATEREC;
  65.  
  66. #define MAXNUMERICLEN    16
  67.  
  68. // These are version 6.0 additions
  69. //
  70.  
  71. // Defined identically in OLE-DB header. If OLE-DB header previously included
  72. // skip redefinition.
  73. //
  74. #if !defined (__oledb_h__)
  75. typedef struct dbnumeric
  76. {
  77.     BYTE precision;
  78.     BYTE scale;
  79.     BYTE sign;
  80.     BYTE val[MAXNUMERICLEN];
  81. } DBNUMERIC;
  82. #endif // !defined (__oledb_h__)
  83.  
  84. typedef DBNUMERIC DBDECIMAL;
  85.  
  86.  
  87. #endif  // #if !defined( DBTYPEDEFS )
  88.  
  89. #if !defined( DBPROGNLEN )
  90.  
  91. #define DBPROGNLEN  10
  92.  
  93. #endif
  94.