home *** CD-ROM | disk | FTP | other *** search
-
- /*
- ** fsfront.h: 34.1 5/10/88
- **
- ** FSFRONT.H
- **
- ** Your generic useful definitions file.
- **
- ** Requires:
- ** nothing
- **
- ** Sybase DB-LIBRARY Version 2.0
- ** Confidential Property of Sybase, Inc.
- ** (c) Copyright Sybase, Inc. 1985, 1986
- ** All rights reserved
- */
-
- #ifndef _FSFRONT_H_
- #define _FSFRONT_H_ 1
-
-
- /* These are needed to rename functions */
- #include <rdef_fun.h>
- #include <rdef_glb.h>
-
-
- /*
- ** Version
- */
- #define BSD42 0
- #define VMS 0
- #define VOS 0
-
- #ifdef OS2
- # undef OS2
- # define OS2 1
- #else
- # define OS2 0
- #endif
-
- #ifdef MSDOS
- # undef MSDOS
- # define MSDOS 1
- #else
- # define MSDOS 0
- #endif
-
- #if (OS2 || MSDOS)
- typedef int SYBINT;
- #else
- typedef int SYBINT;
- #endif /* If OS/2 or MS-DOS */
-
- #if OS2
- # define INCL_BASE 1 /* TRUE to get prototypes */
- # define INCL_DOSDEVICES 1 /* TRUE to rectify ommission in 'bse.h' */
- # define MT 1 /* TRUE to include multi-tasking */
- #endif
-
- /*
- ** Machine
- */
- #define SUN 0
- #define PYRAMID 0
- #define VAX 0
- /* M_i86 1 8086 */
- /* M_i286 1 80286 */
- /* M_i386 1 80386 */
-
- /*
- ** Languages
- */
-
- #define SYB_C 0
- #define SYB_FORTRAN 1
- #define SYB_COBOL 2
-
- /*
- ** Return types
- */
-
-
- typedef int RETCODE; /* SUCCEED or FAIL */
- typedef int STATUS; /* OK or condition code */
-
- /*
- ** Defines
- */
-
- #if (BSD42 || VOS || (MSDOS || OS2))
- #define STDEXIT 0
- #define ERREXIT -1
- #endif /* (BSD42 || VOS) */
-
- #if VMS
- #define STDEXIT 1
- #define ERREXIT
- #endif /* VMS */
-
- #ifndef NULL
- #define NULL 0
- #endif /* NULL */
-
- #ifndef FALSE
- #define FALSE 0
- #endif
- #ifndef TRUE
- #define TRUE 1
- #endif
-
- #define SUCCEED 1
- #define FAIL 0
-
- #define OK 0
-
- /*
- ** SYBASE environment variable
- */
- #define ENV_SYBASE "SYBASE"
-
- /*
- ** Defines for the "answer" in interrupt pop-ups
- */
-
- #define INT_EXIT 0
- #define INT_CONTINUE 1
- #define INT_CANCEL 2
-
- /* DataServer variable typedefs */
-
- typedef unsigned char BYTE;
- typedef unsigned char DBBOOL; /* Less likely to collide than "BOOL". */
- #if (!MSDOS && !OS2) /* && !NEEDED_ANY_MORE */
- typedef unsigned char BOOL; /* So older programs won't break yet.*/
- #endif /* Not MSDOS and Not OS2 */
-
- typedef BYTE *POINTER;
- typedef unsigned char DBTINYINT; /* DataServer 1 byte integer */
- typedef short DBSMALLINT; /* DataServer 2 byte integer */
- typedef long DBINT; /* DataServer 4 byte integer */
- typedef char DBCHAR; /* DataServer char type */
- typedef char DBTEXT; /* DataServer text type */
- typedef unsigned char DBBINARY; /* DataServer binary type */
- typedef unsigned char DBARRAY; /* DataServer array type */
- typedef unsigned char DBBIT; /* DataServer bit type */
- typedef struct datetime /* DataServer datetime type */
- {
- long dtdays; /* number of days since 1/1/1900 */
- unsigned long dttime; /* number 300th second since mid */
- } DBDATETIME;
- typedef struct money /* DataServer money type */
- {
- long mnyhigh;
- unsigned long mnylow;
- } DBMONEY;
- typedef double DBFLT8; /* DataServer float type */
- typedef unsigned short DBUSMALLINT; /* DataServer 2 byte integer */
- #define DBMAXCHAR 256
- typedef struct dbvarychar /* Pascal-type string. */
- {
- DBSMALLINT len; /* length of the character string */
- DBCHAR str[DBMAXCHAR]; /* string, with no NULL terminator */
- } DBVARYCHAR;
- typedef struct dbvarybin /* Pascal-type binary array. */
- {
- DBSMALLINT len; /* length of the binary array */
- BYTE array[DBMAXCHAR];/* the array itself. */
- } DBVARYBIN;
- typedef DBSMALLINT DBINDICATOR; /* used by DB-LIBRARY for indicator
- * variables.
- */
-
- /*
- ** Pointers to functions returning ...
- */
-
- typedef int (*INTFUNCPTR)();
- typedef DBBOOL (*BOOLFUNCPTR)();
-
- /*
- ** REGION - Rectangular Area.
- */
-
- typedef struct region
- {
- short rgx; /* Starting (upper left) coordinates */
- short rgy;
- short rgwidth; /* Width (horizontal extent) */
- short rgheight; /* Height (vertical extent) */
- } REGION;
-
- /*
- ** Macros
- */
- /*
- ** These modifications to standard macros will allow us to use intrinsic
- ** functions.
- */
- #if (MSDOS || OS2)
- /*
- ** The first group of defines is to resolve non-intrinsic frunctions
- */
- # ifdef min
- # undef min
- # define min(a, b) ((a) < (b) ? (a) : (b))
- # endif /* Undefine min so as not to conflict with Std-C version */
- # ifdef max
- # undef max
- # define max(a, b) ((a) > (b) ? (a) : (b))
- # endif /* Undefine max so as not to conflict with Std-C version */
- /*
- ** This second group of defines is to map both the intrinsic and
- ** non-intrinsic functions to Sybase version of theses functions.
- */
- # define MAX(a, b) max(a, b)
- # define MIN(a, b) min(a, b)
- # define ABS(a) abs(a)
- #else
- # define MAX(a, b) ((a) > (b) ? (a) : (b))
- # define MIN(a, b) ((a) < (b) ? (a) : (b))
- # define ABS(a) ((a) > 0 ? (a) : -(a))
- #endif /* MSDOS or OS/2 */
-
- /* max length of sql statement buffer */
- #define SQLMAXLEN 3072
-
- /* max len of a file pathname */
- #define FILENAME_LEN 255
-
- /* Some memory managment macros */
- #if (MSDOS || OS2)
- # define CFREE free
- # define BCOPY(s, d, l) memcpy(d, s, l)
- # define SYBINDEX(s, c) strchr(s, (int)c);
- #else
- # define CFREE cfree
- # define BCOPY(s, d, l) bcopy(s, d, l)
- # define SYBINDEX(s, c) index(s, c)
- #endif /* If MS-DOS or OS/2 */
-
-
- #define DBTXPLEN 16
-
- #endif /* ifndef _FSFRONT_H_ */
-