2013-05-18 02:21:28 -04:00
# ifndef _ESTRUCT_H_
# define _ESTRUCT_H_
2005-05-31 11:50:56 -04:00
/* ESTRUCT.H
*
* Structure and preprocessor defines
*
* written by Dave G . Conroy
* modified by Steve Wilhite , George Jones
* substantially modified by Daniel Lawrence
* modified by Petri Kutvonen
*/
2013-05-18 20:43:30 -04:00
2005-05-31 11:50:56 -04:00
# ifdef MSDOS
# undef MSDOS
# endif
# ifdef EGA
# undef EGA
# endif
# ifdef CTRLZ
# undef CTRLZ
# endif
2010-08-14 23:11:27 -04:00
/* Machine/OS definitions. */
2005-05-31 11:50:56 -04:00
# if defined(AUTOCONF) || defined(MSDOS) || defined(BSD) || defined(SYSV) || defined(VMS)
2010-08-14 23:11:27 -04:00
/* Make an intelligent guess about the target system. */
2005-05-31 11:50:56 -04:00
# if defined(__TURBOC__)
2010-08-14 23:11:27 -04:00
# define MSDOS 1 /* MS/PC DOS 3.1-4.0 with Turbo C 2.0 */
2005-05-31 11:50:56 -04:00
# else
2010-08-14 23:11:27 -04:00
# define MSDOS 0
2005-05-31 11:50:56 -04:00
# endif
# if defined(BSD) || defined(sun) || defined(ultrix) || (defined(vax) && defined(unix)) || defined(ultrix) || defined(__osf__)
# ifndef BSD
2010-08-14 23:11:27 -04:00
# define BSD 1 /* Berkeley UNIX */
2005-05-31 11:50:56 -04:00
# endif
# else
2010-08-14 23:11:27 -04:00
# define BSD 0
2005-05-31 11:50:56 -04:00
# endif
# if defined(SVR4) || defined(__linux__) /* ex. SunOS 5.3 */
2010-08-14 23:11:27 -04:00
# define SVR4 1
# define SYSV 1
2005-05-31 11:50:56 -04:00
# undef BSD
# endif
2013-09-14 09:31:42 -04:00
# if defined(SYSV) || defined(u3b2) || defined(_AIX) || (defined(i386) && defined(unix)) || defined(__hpux) || defined( __unix__)
2010-08-14 23:11:27 -04:00
# define USG 1 /* System V UNIX */
2005-05-31 11:50:56 -04:00
# else
2010-08-14 23:11:27 -04:00
# define USG 0
2005-05-31 11:50:56 -04:00
# endif
# if defined(VMS) || (defined(vax) && ! defined(unix))
2010-08-14 23:11:27 -04:00
# define VMS 1 /* VAX/VMS */
2005-05-31 11:50:56 -04:00
# else
2010-08-14 23:11:27 -04:00
# define VMS 0
2005-05-31 11:50:56 -04:00
# endif
2010-08-14 23:11:27 -04:00
# define V7 0 /* No more. */
2005-05-31 11:50:56 -04:00
# else
2005-09-30 18:26:09 -04:00
# define MSDOS 1 /* MS-DOS */
# define V7 0 /* V7 UNIX or Coherent or BSD4.2 */
# define BSD 0 /* UNIX BSD 4.2 and ULTRIX */
# define USG 0 /* UNIX system V */
# define VMS 0 /* VAX/VMS */
2005-05-31 11:50:56 -04:00
2005-09-30 18:26:09 -04:00
# endif /*autoconf */
2005-05-31 11:50:56 -04:00
# ifndef AUTOCONF
/* Compiler definitions */
2005-09-30 18:26:09 -04:00
# define UNIX 0 /* a random UNIX compiler */
# define MSC 0 /* MicroSoft C compiler, versions 3 up */
# define TURBO 1 /* Turbo C/MSDOS */
2005-05-31 11:50:56 -04:00
# else
# define UNIX (V7 | BSD | USG)
# define MSC 0
# define TURBO MSDOS
2005-09-30 18:26:09 -04:00
# endif /*autoconf */
2005-05-31 11:50:56 -04:00
/* Debugging options */
2005-09-30 18:26:09 -04:00
# define RAMSIZE 0 /* dynamic RAM memory usage tracking */
# define RAMSHOW 0 /* auto dynamic RAM reporting */
2005-05-31 11:50:56 -04:00
# ifndef AUTOCONF
/* Special keyboard definitions */
2005-09-30 18:26:09 -04:00
# define VT220 0 /* Use keypad escapes P.K. */
# define VT100 0 /* Handle VT100 style keypad. */
2005-05-31 11:50:56 -04:00
/* Terminal Output definitions */
2005-09-30 18:26:09 -04:00
# define ANSI 0 /* ANSI escape sequences */
# define VMSVT 0 /* various VMS terminal entries */
# define VT52 0 /* VT52 terminal (Zenith). */
# define TERMCAP 0 /* Use TERMCAP */
# define IBMPC 1 /* IBM-PC CGA/MONO/EGA driver */
2005-05-31 11:50:56 -04:00
# else
# define VT220 (UNIX | VMS)
# define VT100 0
# define ANSI 0
# define VMSVT VMS
# define VT52 0
# define TERMCAP UNIX
# define IBMPC MSDOS
2010-08-14 23:11:27 -04:00
# endif /* Autoconf. */
2005-05-31 11:50:56 -04:00
/* Configuration options */
2010-08-14 23:11:27 -04:00
# define CVMVAS 1 /* arguments to page forward/back in pages */
# define CLRMSG 0 /* space clears the message line with no insert */
# define CFENCE 1 /* fench matching in CMODE */
# define TYPEAH 1 /* type ahead causes update to be skipped */
# define VISMAC 0 /* update display during keyboard macros */
# define CTRLZ 0 /* add a ^Z at end of files under MSDOS only */
# define ADDCR 0 /* ajout d'un CR en fin de chaque ligne (ST520) */
# define NBRACE 1 /* new style brace matching command */
# define REVSTA 1 /* Status line appears in reverse video */
2005-05-31 11:50:56 -04:00
# ifndef AUTOCONF
2010-08-14 23:11:27 -04:00
# define COLOR 1 /* color commands and windows */
# define FILOCK 0 /* file locking under unix BSD 4.2 */
2005-05-31 11:50:56 -04:00
# else
# define COLOR MSDOS
# ifdef SVR4
# define FILOCK 1
# else
# define FILOCK BSD
# endif
2010-08-14 23:11:27 -04:00
# endif /* Autoconf. */
2005-05-31 11:50:56 -04:00
2013-09-23 08:55:59 -04:00
#if 0
2010-08-14 23:11:27 -04:00
# define ISRCH 1 /* Incremental searches like ITS EMACS */
# define WORDPRO 1 /* Advanced word processing features */
2013-09-23 09:30:31 -04:00
# define APROP 1 /* Add code for Apropos command */
2010-08-14 23:11:27 -04:00
# define CRYPT 1 /* file encryption enabled? */
# define MAGIC 1 /* include regular expression matching? */
# define AEDIT 1 /* advanced editing options: en/detabbing */
# define PROC 1 /* named procedures */
2013-09-23 08:29:49 -04:00
# endif
2010-08-14 23:11:27 -04:00
# define CLEAN 0 /* de-alloc memory on exit */
2005-05-31 11:50:56 -04:00
2010-08-14 23:11:27 -04:00
# define ASCII 1 /* always using ASCII char sequences for now */
# define EBCDIC 0 /* later IBM mainfraim versions will use EBCDIC */
2005-05-31 11:50:56 -04:00
# ifndef AUTOCONF
2010-08-14 23:11:27 -04:00
# define XONXOFF 0 /* don't disable XON-XOFF flow control P.K. */
# define NATIONL 0 /* interprete [,],\,{,},| as characters P.K. */
2005-05-31 11:50:56 -04:00
# else
# define XONXOFF (UNIX | VMS)
# define NATIONL (UNIX | VMS)
2010-08-14 23:11:27 -04:00
# endif /* Autoconf. */
2005-05-31 11:50:56 -04:00
2010-08-14 23:11:27 -04:00
# define PKCODE 1 /* include my extensions P.K., define always */
# define IBMCHR MSDOS /* use IBM PC character set P.K. */
# define SCROLLCODE 1 /* scrolling code P.K. */
2005-05-31 11:50:56 -04:00
2010-08-14 23:11:27 -04:00
/* System dependant library redefinitions, structures and includes. */
2005-05-31 11:50:56 -04:00
2010-08-14 23:11:27 -04:00
# if TURBO
# include <dos.h>
# include <mem.h>
2005-05-31 11:50:56 -04:00
# undef peek
# undef poke
# define peek(a,b,c,d) movedata(a,b,FP_SEG(c),FP_OFF(c),d)
# define poke(a,b,c,d) movedata(FP_SEG(c),FP_OFF(c),a,b,d)
# endif
# if VMS
# define atoi xatoi
# define abs xabs
# define getname xgetname
# endif
2010-08-14 23:11:27 -04:00
# if MSDOS & MSC
2005-05-31 11:50:56 -04:00
# include <dos.h>
# include <memory.h>
# define peek(a,b,c,d) movedata(a,b,FP_SEG(c),FP_OFF(c),d)
# define poke(a,b,c,d) movedata(FP_SEG(c),FP_OFF(c),a,b,d)
# define movmem(a, b, c) memcpy(b, a, c)
# endif
# if VMS
# define unlink(a) delete(a)
# endif
2010-08-14 23:11:27 -04:00
/* Define some ability flags. */
2005-05-31 11:50:56 -04:00
# if IBMPC
# define MEMMAP 1
# else
# define MEMMAP 0
# endif
# if MSDOS | V7 | USG | BSD
# define ENVFUNC 1
# else
# define ENVFUNC 0
# endif
2010-08-14 23:11:27 -04:00
/* Internal constants. */
2005-05-31 11:50:56 -04:00
2005-09-30 18:26:09 -04:00
# define NFILEN 80 /* # of bytes, file name */
# define NSTRING 128 /* # of bytes, string buffers */
# define NPAT 128 /* # of bytes, pattern */
# define HUGE 1000 /* Huge number */
2012-07-10 21:14:02 -04:00
# define CONTROL 0x10000000 /* Control flag, or'ed in */
# define META 0x20000000 /* Meta flag, or'ed in */
# define CTLX 0x40000000 /* ^X flag, or'ed in */
# define SPEC 0x80000000 /* special key (function keys) */
2005-05-31 11:50:56 -04:00
/* Internal defined functions */
# ifdef abs
# undef abs
# endif
/* DIFCASE represents the integer difference between upper
and lower case letters . It is an xor - able value , which is
fortunate , since the relative positions of upper to lower
case letters is the opposite of ascii in ebcdic .
*/
# ifdef islower
# undef islower
# endif
# if PKCODE
# ifdef isupper
# undef isupper
# endif
# endif
# if ASCII
# define DIFCASE 0x20
# if NATIONL
# define LASTUL ']'
# define LASTLL '}'
# else
# define LASTUL 'Z'
# define LASTLL 'z'
# endif
# if IBMCHR
# define isletter(c) (('a' <= c && LASTLL >= c) || ('A' <= c && LASTUL >= c) || (128<=c && c<=167))
# define islower(c) (('a' <= c && LASTLL >= c))
# define isupper(c) (('A' <= c && LASTUL >= c))
# else
# define isletter(c) isxletter((0xFF & (c)))
# define islower(c) isxlower((0xFF & (c)))
# define isupper(c) isxupper((0xFF & (c)))
# define isxletter(c) (('a' <= c && LASTLL >= c) || ('A' <= c && LASTUL >= c) || (192<=c && c<=255))
# define isxlower(c) (('a' <= c && LASTLL >= c) || (224 <= c && 252 >= c))
# define isxupper(c) (('A' <= c && LASTUL >= c) || (192 <= c && 220 >= c))
# endif
# endif
# if EBCDIC
# define DIFCASE 0x40
# define isletter(c) (('a' <= c && 'i' >= c) || ('j' <= c && 'r' >= c) || ('s' <= c && 'z' >= c) || ('A' <= c && 'I' >= c) || ('J' <= c && 'R' >= c) || ('S' <= c && 'Z' >= c))
# define islower(c) (('a' <= c && 'i' >= c) || ('j' <= c && 'r' >= c) || ('s' <= c && 'z' >= c))
# if PKCODE
# define isupper(c) (('A' <= c && 'I' >= c) || ('J' <= c && 'R' >= c) || ('S' <= c && 'Z' >= c))
# endif
# endif
/* Dynamic RAM tracking and reporting redefinitions */
# if RAMSIZE
# define malloc allocate
# define free release
# endif
/* De-allocate memory always on exit (if the operating system or
main program can not
*/
# if CLEAN
# define exit(a) cexit(a)
2013-06-05 21:28:34 -04:00
int cexit ( int status ) ;
2005-05-31 11:50:56 -04:00
# endif
2013-05-18 02:21:28 -04:00
# endif