1 /*
2                 GNU GO - the game of Go (Wei-Chi)
3                 Version 1.1   last revised 3-1-89
4            Copyright (C) Free Software Foundation, Inc.
5                       written by Man L. Li
6                       modified by Wayne Iba
7                     documented by Bob Webber
8                     NeXT version by John Neil
9 */
10 /*
11 This program is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation - version 1.
14 
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 GNU General Public License in file COPYING for more details.
19 
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 
24 Please report any bug/fix, modification, suggestion to
25 
26 mail address:   Man L. Li
27                 Dept. of Computer Science
28                 University of Houston
29                 4800 Calhoun Road
30                 Houston, TX 77004
31 
32 e-mail address: manli@cs.uh.edu         (Internet)
33                 coscgbn@uhvax1.bitnet   (BITNET)
34                 70070,404               (CompuServe)
35 
36 For the NeXT version, please report any bug/fix, modification, suggestion to
37 
38 mail address:   John Neil
39                 Mathematics Department
40                 Portland State University
41                 PO Box 751
42                 Portland, OR  97207
43 
44 e-mail address: neil@math.mth.pdx.edu  (Internet)
45                 neil@psuorvm.bitnet    (BITNET)
46 */
47 
48 #ifndef SHARED_H
49 #define SHARED_H
50 
51 /* $Id: shared.h,v 1.1 2003/01/12 04:01:52 gcasa Exp $ */
52 
53 /*
54  * $Log: shared.h,v $
55  * Revision 1.1  2003/01/12 04:01:52  gcasa
56  * Committing the entire GNU Go and NeXT Go application to the repository.
57  * See COPYING file for GNU License.
58  *
59  * Revision 1.3  1997/07/06 19:38:26  ergo
60  * actual version
61  *
62  * Revision 1.3  1997/05/04 18:57:23  ergo
63  * added time control for moves
64  *
65  */
66 
67 #ifndef BIT
68 #define BIT(n) (1L << (n))
69 #endif /* BIT */
70 #define MAX_BRD_SZ 25
71 
72 typedef enum {
73 	UNKNOWN	=  0,
74 	BEEP	=  2, 	/* \7 telnet 		*/
75 	BOARD	=  3,	/* Board being drawn 	*/
76 	DOWN	=  4,	/* The server is going down */
77 	ERROR	=  5,	/* An error reported	*/
78     FIL		=  6,	/* File being sent	*/
79 	GAMES	=  7,	/* Games listing	*/
80     HELP	=  8,	/* Help file		*/
81 	INFO	=  9,	/* Generic info		*/
82 	LAST	= 10,	/* Last command		*/
83    	KIBITZ	= 11,	/* Kibitz strings	*/
84 	LOAD	= 12,	/* Loading a game	*/
85 	LOOK_M	= 13,	/* Look 		*/
86     MESSAGE	= 14,	/* Message lising	*/
87     MOVE	= 15,	/* Move #:(B) A1	*/
88 	OBSERVE	= 16,	/* Observe report	*/
89     PROMPT	=  1,	/* A Prompt (never)	*/
90     PROVERB	= 31,	/* Go Proverb 		<=== last value */
91 	REFRESH	= 17,	/* Refresh of a board	*/
92     SAVED	= 18,	/* Stored command	*/
93     SAY		= 19,	/* Say string		*/
94     SCORE	= 20,	/* Score report		*/
95     SHOUT	= 21,	/* Shout string		*/
96     SHOW 	= 29,	/* Shout string		*/
97     STATUS	= 22,	/* Current Game status	*/
98 	STORED	= 23,	/* Stored games		*/
99     TELL	= 24,	/* Tell string		*/
100 	THIST	= 25,	/* Thist report		*/
101 	TIM		= 26,	/* times command	*/
102 	TRANS	= 30,	/* Translation info	*/
103 	WHO		= 27,	/* who command		*/
104 	UNDO	= 28,	/* Undo report		*/
105 } MessageType;
106 
107 #define LOGGEDON WAITING
108 typedef enum {
109 	LOGON		= 0,
110 	PASSWORD	= 1,
111 	PASSWD_NEW	= 2,
112 	PASSWD_CONFIRM	= 3,
113 	REGISTER	= 4,
114 	WAITING		= 5,
115 	PLAYING		= 6,
116 	SCORING		= 7,
117 	OBSERVING	= 8,
118 	TEACHING	= 9
119 } State;
120 
121 typedef enum {
122 	Unkn_t = 0,
123 	Game_t,
124 	Help_t,
125 	Hand_t,
126 	Addr_t,
127 	Char_t,
128 	Decr_t,
129 	Defs_t,
130 	Incr_t,
131 	Best_t,
132 	Bloc_t,
133 	DOT_t,
134 	AcRe_t,
135 	Adjo_t,
136 	Addt_t,
137 	All_t,
138 	AMai_t,
139 	Bug_t,
140 	Comm_t,
141 	Conn_t,
142 	Cron_t,
143 	Decl_t,
144 	Dele_t,
145 	Done_t,
146 	DpyR_t,
147 	Dump_t,
148 	Exit_t,
149 	FdIs_t,
150 	Full_t,
151 	Info_t,
152 	Kibi_t,
153 	Kill_t,
154 	Komi_t,
155 	Last_t,
156 	Load_t,
157 	Lock_t,
158 	Look_t,
159 	Mail_t,
160 	Matc_t,
161 	Mess_t,
162 	Move_t,
163 	Obse_t,
164 	Pass_t,
165 	Play_t,
166 	Prov_t,
167 	PlMv_t,
168 	PSMa_t,
169 	Quit_t,
170 	Rank_t,
171 	Rati_t,
172 	Rnks_t,
173 	Refr_t,
174 	Reha_t,
175 	Remo_t,
176 	Rese_t,
177 	Resi_t,
178 	Save_t,
179 	Say_t,
180 	Sgf_t,
181 	Shou_t,
182 	Show_t,
183 	Shut_t,
184 	Spy_t,
185 	Stus_t,
186 	Stat_t,
187 	Stor_t,
188 	Supe_t,
189 	Teac_t,
190 	Tell_t,
191 	This_t,
192 	TIC_t,
193 	Time_t,
194 	Togg_t,
195 	Tran_t,
196 	Undo_t,
197 	UnOb_t,
198 	Upti_t,
199 	Viol_t,
200 	Watc_t,
201 	Shel_t,
202 	Who_t,
203 	Xsho_t,
204 	GmRe_t,
205 	AskM_t,
206 	InBy_t,
207 	CnSn_t,
208 	Ambi_t,
209 	NAgr_t
210 } CommandToken;
211 
212 typedef struct {
213 	char 			*str;
214 	CommandToken 	tok;
215 	char 			NeedArg;
216 	char 			SuperCommand;
217 	unsigned char 	amb;
218 	char 			*enabled;
219 } SearchComm;
220 
221 #define NUM_RANKS num_ranks
222 #define NUM_SPECIAL 2
223 
224 /*
225  * verticies
226  */
227 #define TOP 0
228 #define MID 1
229 #define BOT 2
230 
231 
232 extern int verts[3][MAX_BRD_SZ+1];
233 extern int num_ranks;
234 extern char *ranks[], *comranks[];
235 extern char *prompts[];
236 
237 #endif /* SHARED_H */
238 
239