/*	TC	A Table Calculator
 *		Common definitions
 *
 *		James Gosling, September 1982
 *
 */



#define MAXROWS 50
#define MAXCOLS 20

struct ent {
    double v;
    char *label;
    struct enode *expr;
    short flags;
    char row, col;
};

struct enode {
    int op;
    union {
	double k;
	struct ent *v;
	struct {
	    struct enode *left, *right;
	} o;
    } e;
};

/* op values */
#define O_VAR 'v'
#define O_CONST 'k'
#define O_REDUCE(c) (c+0200)

/* flag values */
#define is_valid     0001
#define is_changed   0002
#define is_lchanged  0004
#define is_leftflush 0010

struct ent *tbl[MAXROWS][MAXCOLS];

int strow, stcol;
int currow, curcol;
int FullUpdate;
int maxrow, maxcol;
int fwidth[MAXCOLS];
int precision[MAXCOLS];
char line[1000];
int linelim;
int changed;
struct enode *new();
struct ent *lookat();
struct enode *copye();
