home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
QBasic & Borland Pascal & C
/
Delphi5.iso
/
C
/
Samples
/
CSAPE32.ARJ
/
INCLUDE
/
OAKLAND.H
< prev
next >
Wrap
C/C++ Source or Header
|
1990-12-19
|
15KB
|
673 lines
/*
oakland.h
% Compiler and OS dependent external declarations used by Oakland C-tools.
Miscellaneous External Declarations used by Oakland C-tools.
OWL 1.2
Copyright (c) 1986-1990, by Oakland Group, Inc.
ALL RIGHTS RESERVED.
Revision History:
-----------------
9/12/88 jmd added prototyping macro
10/17/88 jmd changed _$arg to _arg
12/07/88 ted re-merged compiler-dependent public definitions.
12/13/88 jmd added byte define for Lattice
10/16/89 jmd added SIZE_T to OAK_APOLLO conditionals
10/16/89 jmd added SEEK_ stuff in OAK_APOLLO conditionals
6/25/89 jmd added OEXTERN, OGLOBAL stuff for VMS
7/06/89 gam added MetaWare High C stuff
7/07/89 gam added #define for FNULL
7/12/89 ted Added OSTATIC stuff for MetaWare.
7/14/89 ted Added memmove/omemmove stuff for MetaWare.
7/15/89 ted Added TIME_T, VOID_FPTR; moved int_min,int_max to ostdlib.h.
7/18/89 jmd added more stuff for VMS
8/17/89 jmd ansified apollo
9/11/89 jmd added BORDER_CHARS macro
10/24/89 jmd added XENIX macro
11/04/89 jmd added otoupper, otolower macros
12/07/89 jsm added Z2 macro and zortech stuff
12/17/89 jmd added SEEK stuff to DG
1/21/89 ted changed os/2 family api definition method
2/15/90 jmd fixed Watcom defines.
2/29/90 ted fixed Watcom define.
3/03/90 jsm added CI macros
3/03/90 ted Added automatic apollo define.
4/02/90 ted Added M6 defines & MSC detect.
6/05/90 gam Added TSC stuff.
6/05/90 jmd Changed to Apollo to include .h files instead of .ins.c
6/20/90 ted Added Watcom 8.0 '386 defines.
7/24/90 ted Moved from Watcom 7.0 to 8.0.
8/30/90 ted defined hard_Claim/Release for all cases except OAK_DOS.
10/01/90 jmd added defines for UNIX flavors
10/04/90 jmd added auto defines for sun/vms
10/10/90 ted added support for TCP Turbo C++ flag.
10/11/90 pmcm defined BORDER_CHARS for OAK_VMS
10/17/90 jsm added SYSV autodetect
10/18/90 jmd added OCOMP_VER define
10/20/90 bkd fixed reference to O_NOLIMIT_H for Apollo.
10/22/90 bkd added O_ALIGNSIZE and oroundup macros.
10/22/90 ted shuffled OAK_APOLLO automatic symbol definition around.
10/22/90 ted added O_FORCE_REPAINT flag to fix apollo repaint bug.
10/30/90 jsm Modified SYSV autodetect to allow turbo compiles
10/30/90 jsm Added the OAK_SYSVR30 define
10/30/90 jmd added OAK_SYS define, OAK_COMP
10/31/90 jmd added autodetect for HPUX
12/05/90 ted added FNULL for JPI TSC.
12/5/90 bkd moved NO_PROTO definition for Unix inside ifdef __STDC__
12/6/90 bkd added ifndef to OAK_UNIX definitions of SIZE_T and TIME_T
and added ifndef to definition of FALSE
12/7/90 bkd added ifdef for OAK_UMIPS
12/10/90 bkd added autodetect for Xenix 386
12/11/90 bkd added autodetect for AIX
12/12/90 jmd fixed O_NOLIMIT define for DG, added O_DIRECT for Xenix
12/14/90 bkd changed default UNIX system from SYSVR4 to SYSVR32, added
VOID definition for OAK_BSD, fixed Xenix autodetect
(was triggered under SCO UNIX), removed O_DIRECT for Xenix.
12/17/90 jmd added define of FNULL for APOLLO
12/19/90 ted/bkd Rearranged unix OAK_SYS usage because SYS-V default was
hitting command-line declared unix systems.
This file depends on a symbol being #define'd for the Compiler or OS.
Use one of the following:
M5
M1
M6
TC
TCP
LC
MW
Z2
W8
W8386
CI
TSC
OAK_UNIX
OAK_UMIPS
OAK_XENIX386
OAK_APOLLO
OAK_ULTRIX
OAK_VMS
OAK_STRATUS
OAK_DG
OAK_QNX
OAK_SYSVR30
OAK_SYSVR32
In addition, the symbol OAK_OS2 or OAK_OS2FAPI may be #define'd here.
Other files to look at:
oakpriv.h
ostdlib.h OS specific only
olimits.h OS specific only
oakdir.h OS specific only
dispmode.h OS specific only
scancode.h OS specific only
pcmode.h PC specific only
cursdecl.h UNIX specific only
*/
/* -------------------------------------------------------------------------- */
/* Define OAK_OS2 if you want to compile for OS/2, protected mode only. */
/* #define OAK_OS2 */
/* Define OAK_OS2FAPI for OS/2 with family mode support. */
/* #define OAK_OS2FAPI */
#ifdef OAK_OS2FAPI
# define OAK_OS2
#endif
/* -------------------------------------------------------------------------- */
/* Automatic definition of DOS compiler */
/* Automatically take care of #definine'ing M6 */
#ifdef _MSC_VER
# define M6
# define OAK_SYS
#endif
/* Microsoft 5.1 is the same as 5.0 */
#ifdef M1
# define M5
#endif
/* Microsoft 6.0 is the same as 5.x */
#ifdef M5
# define M6
#endif
/* Automatically take care of #definine'ing TC */
#ifdef __TURBOC__
# ifdef __cplusplus
# define TCP
# define OAK_SYS
# else
# define TC
# define OAK_SYS
# endif
#endif
/* Automatically take care of #define'ing TSC */
#ifdef __TSC__
# define TSC
# define OAK_SYS
#endif
/* Automatically take care of #definine'ing LC */
#ifdef LATTICE
# define LC
# define OAK_SYS
#endif
/* Automatically do Zortech */
#ifdef __ZTC__
# define Z2
# define OAK_SYS
#endif
/* Automatically do Watcom */
#ifdef __WATCOMC__
# ifdef __386__
# define W8386
# define OAK_SYS
# else
# define W8
# define OAK_SYS
# endif
#endif
/* Automatically Define CI for C86 */
#ifdef C86
# define CI
# define OAK_SYS
#endif
/* ------------------------------------ */
/* Automatic definition of non-DOS, non-Unix compiler and OS symbols */
/* Automatically define OAK_APOLLO for Apollo */
#ifdef apollo
# define OAK_APOLLO
# define OAK_SYS
#endif
/* Automatically define OAK_VMS for VAX/VMS system */
#ifdef VMS
# define OAK_VMS
# define OAK_SYS
#endif
/* Automatically define OAK_QNX for QNX */
#ifdef QNX
# define OAK_QNX
# define OAK_SYS
#endif
/* ------------------------------------ */
/* Automatic definition of Unix compiler and OS symbols */
/* detect SunOS */
#ifdef sun
# ifdef unix
# define OAK_SUNOS
# endif
#endif
/* detect HP/UX */
#ifdef __hpux
# define OAK_HPUX
#endif
/* automatically define OAK_XENIX386 for XENIX */
#ifdef M_XENIX
# ifndef unix
# ifdef M_I386
# define OAK_XENIX386
# endif
# endif
#endif
/* detect IBM AIX */
#ifdef _AIX
# define OAK_AIX
#endif
/* End of autodetect section */
/* -------------------------------------------------------------------------- */
/* UNIX stuff:
OAK_UNIX defined for all flavors,
various feature flags set accordingly in cursdecl.h
*/
#ifdef OAK_SYSVR30
# define OAK_UNIX
# define OAK_SYS
#endif
#ifdef OAK_SYSVR4
# define OAK_UNIX
# define OAK_SYS
#endif
#ifdef OAK_HPUX
# define OAK_UNIX
# define OAK_SYS
#endif
#ifdef OAK_XENIX386
# define OAK_UNIX
# define OAK_SYS
#endif
#ifdef OAK_SCOUNIX
# define OAK_UNIX
# define OAK_SYS
#endif
#ifdef OAK_BSD
# define OAK_UNIX
# define O_DIRECT
# define VOID char
# define OAK_SYS
#endif
#ifdef OAK_ULTRIX
# define OAK_UNIX
# define SIZE_T size_t
# define TIME_T time_t
# define OAK_SYS
#endif
#ifdef OAK_SUNOS
# define OAK_UNIX
# define OAK_SYS
#endif
#ifdef OAK_AIX
# define OAK_UNIX
# define OAK_SYS
#endif
#ifdef OAK_NCRTOWER
# define OAK_UNIX
# define OAK_SYS
#endif
#ifdef OAK_UMIPS
# define OAK_UNIX
# define VOID char
# define OAK_SYS
#endif
/* by default, detect system V (this goes last) */
#ifdef unix
# ifndef OAK_SYS
# ifndef OAK_SYSVR32
# define OAK_SYSVR32
# endif
# endif
#endif
#ifdef OAK_SYSVR32
# define OAK_UNIX
# define OAK_SYS
#endif
/* -------------------------------------------------------------------------- */
/* Extra autodetect stuff that depends on OAK_UNIX being defined */
/* Automatically do MetaWare High C (unless we're under UNIX/AIX) */
#ifdef __HIGHC__
# ifndef OAK_UNIX
# define MW
# define OAK_SYS
# endif
#endif
#ifdef DATAGENERAL /* Data General AOS/VS C Dependent Code */
# ifndef OAK_UNIX /* auto detect AOS/VS, not DG-UNIX */
# define OAK_DG
# define OAK_SYS
# endif
#endif
/* -------------------------------------------------------------------------- */
/* Selectively define stuff we need for the various systems */
/* Microsoft C version 5,6.x dependent code */
#ifdef M6
# ifdef M5
# define OAK_COMP "Microsoft 5.1"
# else
# define OAK_COMP "Microsoft 6.0"
# endif
# define oak_notused(var) var
# ifndef OAK_OS2
# define OAK_DOS TRUE
# endif
typedef unsigned char byte;
typedef int boolean;
#endif
#ifdef TC /* Turbo C Dependent Code */
# define OAK_COMP "Turbo C"
# define oak_notused(var) (var = var)
# define OAK_DOS TRUE
# define FNULL 0 /* NULL for function pointers */
typedef unsigned char byte;
typedef int boolean;
#endif
#ifdef TCP /* Turbo C++ Dependent Code */
# define OAK_COMP "Turbo C++"
# define oak_notused(var) (var = var)
# define OAK_DOS TRUE
typedef unsigned char byte;
typedef int boolean;
#endif
#ifdef TSC /* JPI TopSpeed C Dependent Code */
# define OAK_COMP "Topspeed C"
# define oak_notused(var) (var = var)
# ifndef OAK_OS2
# define OAK_DOS TRUE
# endif
# define FNULL 0 /* NULL for function pointers */
typedef unsigned char byte;
typedef int boolean;
#endif
#ifdef LC /* Lattice C Dependent Code */
# define OAK_COMP "Lattice C"
# ifndef OAK_OS2
# define OAK_DOS TRUE
# endif
# define oak_notused(var) (var = 0)
# define SEEK_SET 0
# define SEEK_CUR 1
# define SEEK_END 2
# define SIZE_T unsigned
# define TIME_T long
typedef unsigned char byte;
typedef int boolean;
#endif
#ifdef MW /* Meta Ware High C Dependent Code */
# define OAK_COMP "MetaWare High C"
# define OAK_DOS TRUE
# define OAK_DOS386 TRUE
# define oak_notused(var) (var = var)
# define NO_PROTO
# define OSTATIC
# define FNULL 0 /* NULL for function pointers */
typedef unsigned char byte;
typedef int boolean;
#endif
#ifdef Z2 /* Zortech C 2.0+ Dependent Code */
# define OAK_COMP "Zortech C++ 2.0"
# define oak_notused(var) (var = var)
# define OAK_DOS TRUE
# define FNULL ((VOID *) 0) /* NULL for function pointers */
typedef unsigned char byte;
typedef int boolean;
#endif
/* Watcom C 8.0 Dependent Code */
#ifdef W8
# define OAK_COMP "Watcom 8.0"
# define oak_notused(var) (var = var)
# ifndef OAK_OS2
# define OAK_DOS TRUE
# endif
typedef unsigned char byte;
typedef int boolean;
#endif
/* Watcom C 8.0 386 Dependent Code */
#ifdef W8386
# define OAK_COMP "Watcom 8.0 386"
# define oak_notused(var) (var = var)
# define OAK_DOS TRUE
# define OAK_DOS386 TRUE
typedef unsigned char byte;
typedef int boolean;
#endif
#ifdef CI /* Computer Innovations C86 specific Code */
# ifdef OAK_QNX
# define OAK_COMP "QNX"
# else
# define OAK_COMP "Computer Innovations C86"
# endif
# define oak_notused(var) (var = var)
# define FNULL ((VOID *) 0) /* NULL for function pointers */
typedef unsigned char byte;
typedef int boolean;
#endif
#ifdef OAK_DG
# define OAK_COMP "DG AOS/VS"
# define oak_notused(var)
# define O_NOLIMIT_H
# define O_NOSTDLIB_H
# define SEEK_SET 0
# define SEEK_CUR 1
# define SEEK_END 2
# define SIZE_T unsigned
# define TIME_T long
# define NO_PROTO
# define FNULL 0 /* NULL for function pointers */
typedef unsigned char byte;
typedef int boolean;
#endif
#ifdef OAK_VMS
# define OAK_COMP "VMS"
# define oak_notused(var)
# define O_FORCE_REPAINT
# define SEEK_SET 0
# define SEEK_CUR 1
# define SEEK_END 2
# define SIZE_T unsigned
# define TIME_T long
typedef unsigned char byte;
typedef int boolean;
# define OEXTERN globalref
# define OGLOBAL globaldef
#endif
#ifdef OAK_STRATUS /* STRATUS Dependent Code */
# define OAK_COMP "Stratus VOS"
# define oak_notused(var)
# define NO_PROTO
# define O_NOSTDLIB_H
typedef unsigned char byte;
typedef int boolean;
#endif
#ifdef OAK_APOLLO
# define OAK_COMP "Apollo Domain"
# define oak_notused(var)
# define O_DIRECT
# define O_NOLIMIT_H
# define O_NOSTDLIB_H
# define FNULL 0 /* NULL for function pointers */
# ifndef SEEK_SET
# define SEEK_SET 0
# define SEEK_CUR 1
# define SEEK_END 2
# endif
# define SIZE_T unsigned
# define TIME_T long
typedef unsigned char byte;
/* fix definition of toupper/lower */
# define otolower(c) ((isupper(c)) ? (tolower(c)) : (c))
# define otoupper(c) ((islower(c)) ? (toupper(c)) : (c))
/* For boolean typedef */
# include <apollo/base.h>
#endif
#ifdef OAK_UNIX /* UNIX Dependent Code */
# define oak_notused(var)
# define OAK_COMP "UNIX"
# define O_FORCE_REPAINT
# ifndef __STDC__
/* K&R UNIX compiler */
# define O_NOLIMIT_H
# define O_NOSTDLIB_H
# define NO_PROTO
# else
/* ANSI UNIX compiler */
# endif
# define SEEK_SET 0
# define SEEK_CUR 1
# define SEEK_END 2
# ifndef SIZE_T
# define SIZE_T unsigned
# endif
# ifndef TIME_T
# define TIME_T long
# endif
# define FNULL 0 /* NULL for function pointers */
typedef unsigned char byte;
typedef int boolean;
#endif
/* -------------------------------------------------------------------------- */
/* Machine architecture defines: */
#ifdef sparc
# define O_ALIGNSIZE sizeof(long)
#endif /* sparc */
#ifdef OAK_HPUX
# define O_ALIGNSIZE sizeof(long)
#endif /* hp9000 */
#ifndef O_ALIGNSIZE
# define O_ALIGNSIZE sizeof(char)
#endif /* !O_ALIGNSIZE */
/* -------------------------------------------------------------------------- */
/* portable macros */
#ifndef otolower
# define otolower(c) tolower(c)
#endif
#ifndef otoupper
# define otoupper(c) toupper(c)
#endif
#ifndef oroundup
# define oroundup(n,gran) (((n + gran - 1) / gran) * gran)
#endif /* !ordoundup */
/* data types and constants */
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
typedef void (*VOID_FPTR)(void);
#ifndef FNULL
#define FNULL ((VOID_FPTR) 0) /* NULL for function pointers */
#endif
#ifndef VOID
#define VOID void /* define VOID to char on older systems */
#endif
#ifndef SIZE_T
#define SIZE_T size_t /* define SIZE_T to unsigned on older systems */
#endif
#ifndef TIME_T
#define TIME_T time_t /* define TIME_T to long on older systems */
#endif
/* defines for compilers that don't handle static structures correctly */
#ifndef OEXTERN
# define OEXTERN extern
#endif
#ifndef OGLOBAL
# define OGLOBAL
#endif
#ifndef OSTATIC
# define OSTATIC static
#endif
/** Reentrancy protection functions **/
#ifndef OAK_DOS
# define hard_Claim() hard_ProtectDmgr()
# define hard_Release() hard_UnProtectDmgr()
#else
# define hard_Claim()
# define hard_Release()
#endif
/*** useful constants ***/
#define OAK_HERE 0
#define OAK_UP -1
#define OAK_DOWN -2
#define OAK_RIGHT -3
#define OAK_LEFT -4
/*** use fancy characters in borders? ***/
#ifdef OAK_DOS
# define BORDER_CHARS
#endif
#ifdef OAK_OS2
# define BORDER_CHARS
#endif
#ifdef OAK_VMS
# define BORDER_CHARS
#endif
/* -------------------------------------------------------------------------- */