home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a063 / 7.img / INCLUDE / FSFRONT.H < prev    next >
Encoding:
C/C++ Source or Header  |  1991-02-21  |  5.4 KB  |  245 lines

  1.  
  2. /*
  3. **    fsfront.h:    34.1    5/10/88
  4. **
  5. **    FSFRONT.H
  6. **
  7. **    Your generic useful definitions file.
  8. **
  9. **    Requires:
  10. **        nothing
  11. **
  12. **    Sybase DB-LIBRARY Version 2.0
  13. **    Confidential Property of Sybase, Inc.
  14. **    (c) Copyright Sybase, Inc. 1985, 1986
  15. **    All rights reserved
  16. */
  17.  
  18. #ifndef _FSFRONT_H_
  19. #define _FSFRONT_H_ 1
  20.  
  21.  
  22. /* These are needed to rename functions */
  23. #include <rdef_fun.h>
  24. #include <rdef_glb.h>
  25.  
  26.  
  27. /*
  28. **    Version
  29. */
  30. #define    BSD42    0
  31. #define    VMS    0
  32. #define VOS    0
  33.  
  34. #ifdef OS2
  35. #    undef OS2
  36. #    define OS2    1
  37. #else
  38. #    define OS2     0
  39. #endif
  40.  
  41. #ifdef MSDOS
  42. #    undef MSDOS
  43. #    define MSDOS    1
  44. #else
  45. #    define MSDOS   0
  46. #endif
  47.  
  48. #if (OS2 || MSDOS)
  49.     typedef int SYBINT;
  50. #else
  51.     typedef int SYBINT;
  52. #endif /* If OS/2 or MS-DOS */
  53.  
  54. #if OS2
  55. #       define INCL_BASE        1   /* TRUE to get prototypes */
  56. #    define INCL_DOSDEVICES  1   /* TRUE to rectify ommission in 'bse.h' */
  57. #    define MT               1   /* TRUE to include multi-tasking */
  58. #endif
  59.  
  60. /*
  61. **     Machine
  62. */
  63. #define SUN    0
  64. #define PYRAMID    0
  65. #define VAX    0
  66. /*    M_i86    1    8086    */
  67. /*    M_i286    1    80286    */
  68. /*    M_i386    1    80386    */
  69.  
  70. /*
  71. **    Languages
  72. */
  73.  
  74. #define    SYB_C        0
  75. #define    SYB_FORTRAN    1
  76. #define    SYB_COBOL    2
  77.  
  78. /*
  79. **    Return types
  80. */
  81.  
  82.  
  83. typedef int        RETCODE;    /* SUCCEED or FAIL */
  84. typedef    int        STATUS;        /* OK or condition code */
  85.  
  86. /*
  87. **    Defines
  88. */
  89.  
  90. #if    (BSD42 || VOS || (MSDOS || OS2))
  91. #define    STDEXIT        0
  92. #define    ERREXIT        -1
  93. #endif    /* (BSD42 || VOS) */
  94.  
  95. #if    VMS
  96. #define    STDEXIT        1
  97. #define    ERREXIT
  98. #endif    /* VMS */
  99.  
  100. #ifndef    NULL
  101. #define NULL        0
  102. #endif    /* NULL */
  103.  
  104. #ifndef FALSE
  105. #define FALSE        0
  106. #endif
  107. #ifndef TRUE
  108. #define TRUE        1
  109. #endif
  110.  
  111. #define    SUCCEED        1
  112. #define    FAIL        0
  113.  
  114. #define    OK        0
  115.  
  116. /*
  117. **    SYBASE environment variable
  118. */
  119. #define ENV_SYBASE    "SYBASE"
  120.  
  121. /*
  122. **     Defines for the "answer" in interrupt pop-ups 
  123. */
  124.  
  125. #define INT_EXIT    0
  126. #define INT_CONTINUE    1
  127. #define INT_CANCEL    2
  128.  
  129. /* DataServer variable typedefs */
  130.  
  131. typedef unsigned char    BYTE;
  132. typedef unsigned char    DBBOOL;    /* Less likely to collide than "BOOL". */
  133. #if (!MSDOS && !OS2) /* && !NEEDED_ANY_MORE */
  134.     typedef unsigned char    BOOL;    /* So older programs won't break yet.*/
  135. #endif /* Not MSDOS and Not OS2 */
  136.  
  137. typedef BYTE        *POINTER;
  138. typedef    unsigned char    DBTINYINT;    /* DataServer 1 byte integer */
  139. typedef    short        DBSMALLINT;    /* DataServer 2 byte integer */
  140. typedef    long        DBINT;        /* DataServer 4 byte integer */
  141. typedef    char        DBCHAR;        /* DataServer char type */
  142. typedef    char        DBTEXT;        /* DataServer text type */
  143. typedef    unsigned char    DBBINARY;    /* DataServer binary type */
  144. typedef    unsigned char    DBARRAY;    /* DataServer array type */
  145. typedef    unsigned char    DBBIT;        /* DataServer bit type */
  146. typedef struct datetime            /* DataServer datetime type */
  147. {
  148.     long    dtdays;            /* number of days since 1/1/1900 */
  149.     unsigned long    dttime;        /* number 300th second since mid */
  150. } DBDATETIME;
  151. typedef struct money            /* DataServer money type */
  152. {
  153.     long        mnyhigh;
  154.     unsigned long    mnylow;
  155. } DBMONEY;
  156. typedef    double        DBFLT8;        /* DataServer float type */
  157. typedef unsigned short  DBUSMALLINT;    /* DataServer 2 byte integer */
  158. #define DBMAXCHAR       256
  159. typedef struct dbvarychar               /* Pascal-type string. */
  160. {
  161.         DBSMALLINT      len;            /* length of the character string */
  162.         DBCHAR          str[DBMAXCHAR]; /* string, with no NULL terminator */
  163. } DBVARYCHAR;
  164. typedef struct dbvarybin                /* Pascal-type binary array. */
  165. {
  166.         DBSMALLINT      len;            /* length of the binary array */
  167.         BYTE            array[DBMAXCHAR];/* the array itself. */
  168. } DBVARYBIN;
  169. typedef DBSMALLINT      DBINDICATOR;    /* used by DB-LIBRARY for indicator
  170.                                          * variables.
  171.                                          */
  172.  
  173. /*
  174. **    Pointers to functions returning ...
  175. */
  176.  
  177. typedef    int        (*INTFUNCPTR)();
  178. typedef    DBBOOL        (*BOOLFUNCPTR)();
  179.  
  180. /*
  181. **    REGION - Rectangular Area.
  182. */
  183.  
  184. typedef    struct    region
  185. {
  186.     short        rgx;        /* Starting (upper left) coordinates */
  187.     short        rgy;
  188.     short        rgwidth;    /* Width (horizontal extent) */
  189.     short        rgheight;    /* Height (vertical extent) */
  190. } REGION;
  191.  
  192. /*
  193. **    Macros
  194. */
  195. /*
  196. ** These modifications to standard macros will allow us to use intrinsic 
  197. ** functions.
  198. */
  199. #if (MSDOS || OS2)
  200. /*
  201. **    The first group of defines is to resolve non-intrinsic frunctions
  202. */
  203. #    ifdef min
  204. #        undef min
  205. #        define    min(a, b)    ((a) < (b) ? (a) : (b))
  206. #    endif /* Undefine min so as not to conflict with Std-C version */
  207. #    ifdef max
  208. #        undef max
  209. #        define    max(a, b)    ((a) > (b) ? (a) : (b))
  210. #    endif /* Undefine max so as not to conflict with Std-C version */
  211. /* 
  212. **    This second group of defines is to map both the intrinsic and 
  213. **    non-intrinsic functions to Sybase version of theses functions.
  214. */
  215. #    define MAX(a, b) max(a, b)
  216. #    define MIN(a, b) min(a, b)
  217. #    define ABS(a) abs(a)
  218. #else
  219. #    define    MAX(a, b)    ((a) > (b) ? (a) : (b))
  220. #    define    MIN(a, b)    ((a) < (b) ? (a) : (b))
  221. #    define    ABS(a)        ((a) > 0 ? (a) : -(a))
  222. #endif /* MSDOS or OS/2 */
  223.  
  224. /* max length of sql statement buffer */
  225. #define SQLMAXLEN    3072
  226.  
  227. /* max len of a file pathname */
  228. #define FILENAME_LEN    255
  229.  
  230. /* Some memory managment macros */
  231. #if (MSDOS || OS2)
  232. #    define CFREE        free
  233. #    define BCOPY(s, d, l)    memcpy(d, s, l)
  234. #    define SYBINDEX(s, c)    strchr(s, (int)c);
  235. #else
  236. #    define CFREE        cfree
  237. #    define BCOPY(s, d, l)    bcopy(s, d, l)
  238. #    define SYBINDEX(s, c)    index(s, c)
  239. #endif    /* If MS-DOS or OS/2 */
  240.  
  241.  
  242. #define DBTXPLEN  16
  243.  
  244. #endif    /* ifndef _FSFRONT_H_ */
  245.