1 /* 2 * Copyright (c) 1980 Regents of the University of California. 3 * All rights reserved. 4 * 5 * %sccs.include.redist.c% 6 * 7 * @(#)snake.h 5.6 (Berkeley) 02/03/93 8 */ 9 10 # include <stdio.h> 11 # include <assert.h> 12 # include <sys/types.h> 13 # include <sgtty.h> 14 # include <signal.h> 15 # include <math.h> 16 17 #define ESC '\033' 18 19 struct tbuffer { 20 long t[4]; 21 } tbuffer; 22 23 char *CL, *UP, *DO, *ND, *BS, 24 *HO, *CM, 25 *TA, *LL, 26 *KL, *KR, *KU, *KD, 27 *TI, *TE, *KS, *KE; 28 int LINES, COLUMNS; /* physical screen size. */ 29 int lcnt, ccnt; /* user's idea of screen size */ 30 char xBC, PC; 31 int AM, BW; 32 char tbuf[1024], tcapbuf[128]; 33 char *tgetstr(), *tgoto(); 34 int Klength; /* length of KX strings */ 35 int chunk; /* amount of money given at a time */ 36 #ifdef debug 37 #define cashvalue (loot-penalty)/25 38 #else 39 #define cashvalue chunk*(loot-penalty)/25 40 #endif 41 42 struct point { 43 int col, line; 44 }; 45 struct point cursor; 46 struct sgttyb orig, new; 47 #ifdef TIOCLGET 48 struct ltchars olttyc, nlttyc; 49 #endif 50 struct point *point(); 51 #if __STDC__ 52 void apr(struct point *, const char *, ...); 53 void pr(const char *, ...); 54 #else 55 void apr(); 56 void pr(); 57 #endif 58 59 #define same(s1, s2) ((s1)->line == (s2)->line && (s1)->col == (s2)->col) 60