/*  PERFECT CALC Constant Declarations Section  */
/*
#define IBM	1	    /* defined for IBM PC version! */
*/
/*      No Overlays in Lattice C version!
#define OVLON   1       /* overlay status -- comment out for all-in-core */
#define NUMOVL  4       /* number of overlays (not counting help pages) */
#define OVLLEN  20      /* number of records in an overlay */
*/

#define NUMHELP 16      /* number of help pages (not counting menu) */
#define HELPPL  3       /* number of records in a help page */
#define HELPLINES 8     /* number of lines in a help page */

/*
**	extra help stuff for Function Keys,
**	all the old #defines apply, they are all offset by "F1HlpPages"
**	allowing room at the beginning for the F-Keys help stuff.
*/
#define FHlpPages	4		/* number of help pages for F-Keys */
#define F1HlpPge	0		/* Page number for F1 help */
#define SF1HlpPge	1		/* Page number for Shift-F1 help */
#define CF1HlpPge	2		/* Page number for Control-F1 help */
#define AF1HlpPge	3		/* Page number for Alt-F1 help */

#define SWAPFILE        "PC.OVL"
#define ASWAPFILE       "A:PC.OVL"
#ifdef IBM
#define PRINTER		"LPT1:"
#else
#define PRINTER		"PRN:"
#endif

#define LIN     20      /* length of string arrays in PC.OVL */
#define LDEIN   10
#define LDCP    10
#define LCLS    6
#define LEOS    6
#define LEOL    6
#define LRV     10
#define LNV     10
#define LPIN    10
#define LPDEIN  10
#define LBOTTOM 84	/* change this when LKEYS is changed to keep it 512 */
#define LKEYS	156	/* double this since Keys[] is an "int" array */

/* Screen constants */
#define MAXLINE 255     /* max number of lines */
#define MAXCOL  52      /* max number of columns */
#define MINCOLW 0       /* minimum and maximum column widths */
#define MAXCOLW 77
#define MAXWIN  2       /* maximum # of windows allowed */
#define MAXBUF  7       /* maximum # of buffers allowed */
#define BUFDEFSIZE sizeof(struct buffer)

/* Defaults */
#define DFCOLW  9       /* column width */
#define DFDECPL 2       /* decimal places on output */
#define DFFILE  "DEFAULT.PC"    /* default filename */

/* General characters and codes */
#define ESC     033     /* Meta Prefix */
#define CTRLX   030     /* eXtended Prefix */
#define CTLI    011     /* Insert cursor */
#define ESCI    0351    /* Insert region */
#define BEL     007
#define FORMFEED 014
#define EOF     -1
#define NUL     0
#define DEL     0177
#define BEEP    putch(BEL)
#define TRUE    1
#define FALSE   0
#define NORELABS 0x7FFF /* no relative/absolute information */
	/******
	The VALUE field is 8 bytes, produced by sscanf for NUMBER type 
	elements, and the last byte is an exponent byte which is set to
	some illegal exponent to flag the error condition.  ERRVAL is the
	offset of this eighth byte, and is in effect a kind of common
	block.  The RELABS field is a 16-bit (int) quantity; the high bit
	is the locked/unlocked flag, and the next 15 are relative/absolute
	flags for up to 15 variables in a formula.
	******/
/* Element Definition */
#define SIZE    0       /* size of the element */
#define TYPE    2       /* type of the element */
#define VALUE   3      /* value: 8 bytes formulas and numbers; label string */
#define ERRVAL  10      /* this == -1 if error formula value */
#define RELABS  11      /* relative/absolute + locked/unlocked flags */
#define FORMTXT 13      /* formula text: encoded formula */
                        /* Note: last byte of ANY element is always 0 */

/* Element type indicators */
#define LABEL   'L'     /* label */
#define NUMBER  'N'     /* number */
#define FORMULA 'F'     /* formula */

/* Formula component definitions -- should be highest non-printable
   character codes to not interact with other string components or
   function codes (0,1,2,...).  Careful of ESC if you add anything! */
#define EXTELT  25      /* external reference */
#define VARELT  28      /* variable */
#define NUMELT  29      /* number */
#define FUNCELT 30      /* function */
#define BADTYPE 31      /* unrecognized function */
                        /* Note: an operator is itself, and functions are */
                        /* indices into the funcs[] array in PCCALC.C */

#define STRRV   1       /* reverse video flag */
#define STRNV   2       /* normal video flag */

#define DOWN    1       /* Axis() drawing & pick/put codes */
#define ACROSS  2
#define BOTH    3
#define NONE    4

#define SINGLE     1    /* type of pick buffer */
#define LINE       2
#define COL        3
#define LINES      4
#define COLS       5
#define RECTANGLE  6

#define YAXWIDTH 3              /* usual Y-axis width */
#define CURLDELIM "<"           /* usual cursor left delimiter */
#define CURRDELIM ">"           /* usual cursor right delimiter */

#define ERRVALUE 1.E300         /* error value */
#define VALDELIM '#'		/* delimiter for formula value */

/* These are the offsets in Keys[] of several functions */
/* They MUST be changed with changes in the (*Function[])() array */
#define READCOMD 74
#define RECALC   36
#define FORMCOMD 14
#define NUMCOMD	 16

/* Color definitions */
#define c_axis  Tdeinnul	/* color of axes */
#define c_color Tinnul		/* TRUE if user wants color */
#define c_comd  Tdcpnul		/* color of command line */
#define C_ERROR 12		/* color for error messages */
#define c_form  Teolnul		/* color for formulas */
#define C_HELP	7		/* color for help display */
#define c_neg   Tclsnul		/* color of negative numbers */
#define c_norm  Teosnul		/* color for regular numbers and text */

#define WARN_MEM 4096		/* threshold of low memory warning*/
				/* (temporary) */