Commit | Line | Data |
---|---|---|
b6f0a7e4 DF |
1 | /* |
2 | * Copyright (c) 1980 Regents of the University of California. | |
a825d20f | 3 | * All rights reserved. |
b6f0a7e4 | 4 | * |
a825d20f | 5 | * Redistribution and use in source and binary forms are permitted |
65c7d3b6 KB |
6 | * provided that the above copyright notice and this paragraph are |
7 | * duplicated in all such forms and that any documentation, | |
8 | * advertising materials, and other materials related to such | |
9 | * distribution and use acknowledge that the software was developed | |
10 | * by the University of California, Berkeley. The name of the | |
11 | * University may not be used to endorse or promote products derived | |
12 | * from this software without specific prior written permission. | |
13 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR | |
14 | * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED | |
15 | * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. | |
a825d20f | 16 | * |
65c7d3b6 | 17 | * @(#)snake.h 5.4 (Berkeley) %G% |
b6f0a7e4 | 18 | */ |
0bed9e87 SL |
19 | |
20 | # include <stdio.h> | |
21 | # include <assert.h> | |
22 | # include <sys/types.h> | |
23 | # include <sgtty.h> | |
24 | # include <signal.h> | |
25 | # include <math.h> | |
26 | ||
27 | #define ESC '\033' | |
28 | ||
29 | struct tbuffer { | |
30 | long t[4]; | |
31 | } tbuffer; | |
32 | ||
33 | char *CL, *UP, *DO, *ND, *BS, | |
34 | *HO, *CM, | |
35 | *TA, *LL, | |
36 | *KL, *KR, *KU, *KD, | |
37 | *TI, *TE, *KS, *KE; | |
38 | int LINES, COLUMNS; /* physical screen size. */ | |
39 | int lcnt, ccnt; /* user's idea of screen size */ | |
40 | char xBC, PC; | |
41 | int AM, BW; | |
42 | char tbuf[1024], tcapbuf[128]; | |
43 | char *tgetstr(), *tgoto(); | |
44 | int Klength; /* length of KX strings */ | |
45 | int chunk; /* amount of money given at a time */ | |
46 | #ifdef debug | |
47 | #define cashvalue (loot-penalty)/25 | |
48 | #else | |
49 | #define cashvalue chunk*(loot-penalty)/25 | |
50 | #endif | |
51 | ||
52 | struct point { | |
53 | int col, line; | |
54 | }; | |
55 | struct point cursor; | |
56 | struct sgttyb orig, new; | |
57 | #ifdef TIOCLGET | |
58 | struct ltchars olttyc, nlttyc; | |
59 | #endif | |
60 | struct point *point(); | |
3f5f62ac KB |
61 | |
62 | #define same(s1, s2) ((s1)->line == (s2)->line && (s1)->col == (s2)->col) | |
63 |