1: # include <stdio.h> 2: # include <assert.h> 3: # include <sys/types.h> 4: # include <sgtty.h> 5: # include <signal.h> 6: # include <math.h> 7: 8: #define ESC '\033' 9: #define CTRL(x) ('x' & 037) 10: 11: struct tbuffer { 12: long t[4]; 13: } tbuffer; 14: 15: char *CL, *UP, *DO, *ND, *BS, 16: *HO, *CM, 17: *TA, *LL, 18: *KL, *KR, *KU, *KD, 19: *TI, *TE, *KS, *KE; 20: int LINES, COLUMNS; /* physical screen size. */ 21: int lcnt, ccnt; /* user's idea of screen size */ 22: char xBC, PC; 23: int AM, BW; 24: char tbuf[1024], tcapbuf[128]; 25: char *tgetstr(), *tgoto(); 26: int Klength; /* length of KX strings */ 27: int chunk; /* amount of money given at a time */ 28: #ifdef debug 29: #define cashvalue (loot-penalty)/25 30: #else 31: #define cashvalue chunk*(loot-penalty)/25 32: #endif 33: 34: struct point { 35: int col, line; 36: }; 37: struct point cursor; 38: struct sgttyb orig, new; 39: #ifdef TIOCLGET 40: struct ltchars olttyc, nlttyc; 41: #endif 42: struct point *point();