#define DAEMON_PROG "/afs/sipb/user/web/src/xbugchess/@sys/daemon"



#include <stdio.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xos.h>
#include <X11/Xresource.h>

#include <errno.h>       /* obligatory includes */
#include <signal.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/wait.h>
#ifdef rsaix
#include <sys/select.h>
#endif
#include <netinet/in.h>
#include <netdb.h>

#include <fcntl.h>

#include <sys/types.h>
#include <sys/timeb.h>

#define NOPIECE -1

#define PORTNUM 2152
#define WHITE 1
#define BLACK 0
#define PAWN 1
#define ROOK 2
#define KNIGHT 3
#define BISHOP 4
#define QUEEN 5
#define KING 6
#define QMUTANT 7

#define PIECE_TAKEN_ANNOUNCE_BECAUSE_KEN_IS_A_SCHMUCK 100
#define END_OF_GAME 101 
#define YELL 102

#define BORING 0
#define SPEEDCHESS 1
#define BUGCHESS 2


#define XSERVER 6000

typedef struct cboard_struct {
  int used;
  char names[4][50];
  char *msg[4];
} CBoard;

typedef struct pclock {
  struct timeb marker;
  struct timeb time_left;
} Pclock;

typedef struct clock_data {
  long totaltime;
  Pclock myclock, opclock, *clock[2];
  int whoseturn;
  int pause;
  int mycolor;
  int opcolor;
  CBoard board;
} Clock;

struct clock_data *make_clock();

