Castling fix.
[cboard.git] / src / common.h
bloba655086cffbc070fa6a45d8b13baabf00306c683
1 /* vim:tw=78:ts=8:sw=4:set ft=c: */
2 /*
3 Copyright (C) 2002-2006 Ben Kibbey <bjk@luxsci.net>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #ifndef COMMON_H
20 #define COMMON_H
22 #ifdef HAVE_SYS_WAIT_H
23 #include <sys/wait.h>
24 #endif
26 enum {
27 ENGINE_OFFLINE = -1, ENGINE_READY, ENGINE_THINKING, ENGINE_INITIALIZING
30 enum {
31 HUMAN, ENGINE
34 enum {
35 ENGINE_IN_FD,
36 ENGINE_OUT_FD,
39 #define CF_ENGINE_LOOP 0x01
40 #define CF_HUMAN 0x02
42 struct queue_s {
43 char *line;
44 int status;
47 struct engine_s {
48 int fd[2];
49 pid_t pid;
50 int status;
51 struct queue_s **queue;
55 * Attached to game[n].data.
57 struct userdata_s {
58 BOARD b;
59 struct engine_s *engine;
60 unsigned short flags;
61 unsigned n;
64 char **enginebuf;
66 void invalid_move(int n, const char *m);
67 void update_status_window(GAME g);
68 void add_engine_command(GAME *, int, char *fmt, ...);
70 #endif