[comp.sources.games] v03i047: xchess - chess display program using X windows, Part06/06

games-request@tekred.TEK.COM (01/19/88)

Submitted by: faustus@ic.berkeley.edu (Wayne A. Christopher)
Comp.sources.games: Volume 3, Issue 47
Archive-name: xchess/Part06

#! /bin/sh

# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of archive 6 (of 6)."
# Contents:  MANIFEST.BAK Makefile XCircle.c bishop_small.bitmap
#   bishop_small_outline.bitmap king_small.bitmap
#   king_small_outline.bitmap knight_small.bitmap
#   knight_small_outline.bitmap message.c pawn_small.bitmap
#   pawn_small_outline.bitmap popup.c program.c queen_small.bitmap
#   queen_small_outline.bitmap rook_small.bitmap
#   rook_small_outline.bitmap scrollText/scrollText.h scrollText/st.h
#   std.h xchess.icon
# Wrapped by billr@tekred on Mon Jan 18 08:48:23 1988
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f MANIFEST.BAK -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"MANIFEST.BAK\"
else
echo shar: Extracting \"MANIFEST.BAK\" \(2021 characters\)
sed "s/^X//" >MANIFEST.BAK <<'END_OF_MANIFEST.BAK'
X   File Name		Archive #	Description
X-----------------------------------------------------------
X COPYING                   3	
X MANIFEST                  1	
X Makefile                  6	
X README                    1	
X XCircle.c                 6	
X bishop.bitmap             5	
X bishop_mask.bitmap        4	
X bishop_outline.bitmap     4	
X bishop_small.bitmap       6	
X bishop_small_outline.bitmap 6	
X board.c                   4	
X button.c                  3	
X clock.c                   4	
X control.c                 1	
X jail.c                    3	
X king.bitmap               5	
X king_mask.bitmap          5	
X king_outline.bitmap       4	
X king_small.bitmap         6	
X king_small_outline.bitmap 6	
X knight.bitmap             5	
X knight_mask.bitmap        5	
X knight_outline.bitmap     4	
X knight_small.bitmap       6	
X knight_small_outline.bitmap 6	
X message.c                 6	
X parse.c                   1	
X pawn.bitmap               5	
X pawn_mask.bitmap          5	
X pawn_outline.bitmap       4	
X pawn_small.bitmap         6	
X pawn_small_outline.bitmap 6	
X popup.c                   6	
X program.c                 6	
X queen.bitmap              5	
X queen_mask.bitmap         5	
X queen_outline.bitmap      4	
X queen_small.bitmap        6	
X queen_small_outline.bitmap 6	
X record.c                  3	
X rook.bitmap               5	
X rook_mask.bitmap          5	
X rook_outline.bitmap       4	
X rook_small.bitmap         6	
X rook_small_outline.bitmap 6	
X scrollText                1	
X scrollText/Makefile       1	
X scrollText/codeview.1     5	
X scrollText/codeview.c     1	
X scrollText/scrollText.3   3	
X scrollText/scrollText.c   2	
X scrollText/scrollText.h   6	
X scrollText/st.h           6	
X shade.bitmap              5	
X std.c                     3	
X std.h                     6	
X valid.c                   3	
X window.c                  1	
X xchess.1                  4	
X xchess.c                  4	
X xchess.cur                2	
X xchess.h                  3	
X xchess.icon               6	
X xchess_mask.cur           4	
END_OF_MANIFEST.BAK
if test 2021 -ne `wc -c <MANIFEST.BAK`; then
    echo shar: \"MANIFEST.BAK\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f Makefile -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"Makefile\"
else
echo shar: Extracting \"Makefile\" \(2482 characters\)
sed "s/^X//" >Makefile <<'END_OF_Makefile'
X
X# RCS Info: $Revision: 1.5 $ on $Date: 86/11/26 12:09:19 $
X#           $Source: /users/faustus/xchess/RCS/Makefile,v $
X# Copyright (c) 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
X#
X# Makefile for xchess.
X
XCC = cc
X
XCFILES	=\
X	board.c\
X	button.c\
X	clock.c\
X	control.c\
X	jail.c\
X	message.c\
X	parse.c\
X	popup.c\
X	program.c\
X	record.c\
X	std.c\
X	valid.c\
X	window.c\
X	XCircle.c
X
XCOBJS	=\
X	board.o\
X	button.o\
X	clock.o\
X	control.o\
X	jail.o\
X	message.o\
X	parse.o\
X	popup.o\
X	program.o\
X	record.o\
X	std.o\
X	valid.o\
X	window.o\
X	XCircle.o
X
XHFILES	=\
X	std.h\
X	xchess.h
X
XSOURCE = $(CFILES)
X
XALLFILES = $(SOURCE) $(HFILES)
X
XINCLUDE = -I.
X
XDEFINES = -DDEF_PROGRAM=\"/usr/public/gnuchess\"
X
XCFLAGS = $(DEFINES) $(INCLUDE) -g -pg
XLINTFLAGS = -u -z -lc -DLINT $(DEFINES) $(INCLUDE)
XLINTLIB = ../lib/llib-lX.ln
XLDFLAGS = -z -lXMenu -lX -lm -g
XGPLDFLAGS = -z -lXMenu_p -lX -lm_p -g -pg
X
X.c.o: $*.c
X	$(CC) $(CFLAGS) -pg -c $*.c
X.s.o: $*.s
X	$(CC) $(CFLAGS) -pg -c $*.s
X
Xall: xchess scrollText/scrollText.a
X	@echo "All done."
X
Xeverything: all tags depend lint wc
X	@echo "All done."
X
Xxchess:	xchess.o $(COBJS) scrollText/scrollText.a
X	$(CC) -o xchess xchess.o $(COBJS) scrollText/libScroll.a \
X	$(LDFLAGS)
X
XscrollText/scrollText.a:
X	cd scrollText; make; cd ..
X
Xgpxchess: xchess.o $(COBJS)
X	$(CC) -o gpxchess xchess.o $(COBJS) scrollText/libScroll.a \
X	$(GPLDFLAGS)
X
Xlint:	$(SOURCE)
X	lint $(LINTFLAGS) $(SOURCE) $(LINTLIB) | \
X	grep -v "multiply declared"
X
Xqgrind: $(ALLFILES)
X	qgrind -lc $(ALLFILES)
X
Xvgrind:	$(ALLFILES)
X	vgrind -lc $(ALLFILES)
X
Xopt: all
X
Xreopt: all
X
Xinstall: all
X
Xsource:	$(SOURCE) 
X
Xtags: $(ALLFILES)
X	ctags -w -t *.c *.h > /dev/null 2>&1
X
Xwc: $(ALLFILES)
X	@wc $(ALLFILES)
X
Xprint: $(ALLFILES)
X	@pr $(ALLFILES)
X
Xclean:
X	rm -f *.o *.a *.out xchess tags foo tmp
X
Xtar:
X	tar -cvf xchess.tar Makefile *.h *.c *.bitmap *.icon *.cur *.1\
X	scrollText/Makefile scrollText/*.h scrollText/*.c scrollText/*.1\
X	scrollText/*.3
X
X$(ALLFILES):
X	co $@
X
Xdepend: $(SOURCE)
X	cc -M $(CFLAGS) $(CFILES) > makedep
X	echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep
X	echo '$$r makedep' >>eddep
X	echo 'w' >>eddep
X	ed - Makefile < eddep
X	rm eddep makedep 
X	echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile
X	echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile
X	echo '# see make depend above' >> Makefile
X
X#-----------------------------------------------------------------
X# DO NOT DELETE THIS LINE -- make depend uses it
X# DEPENDENCIES MUST END AT END OF FILE
X
Xxchess.o $(COBJS): $(HFILES)
X
END_OF_Makefile
if test 2482 -ne `wc -c <Makefile`; then
    echo shar: \"Makefile\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f XCircle.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"XCircle.c\"
else
echo shar: Extracting \"XCircle.c\" \(3820 characters\)
sed "s/^X//" >XCircle.c <<'END_OF_XCircle.c'
X/* This file contains code for X-CHESS.
X   Copyright (C) 1986 Free Software Foundation, Inc.
X
XThis file is part of X-CHESS.
X
XX-CHESS is distributed in the hope that it will be useful,
Xbut WITHOUT ANY WARRANTY.  No author or distributor
Xaccepts responsibility to anyone for the consequences of using it
Xor for whether it serves any particular purpose or works at all,
Xunless he says so in writing.  Refer to the X-CHESS General Public
XLicense for full details.
X
XEveryone is granted permission to copy, modify and redistribute
XX-CHESS, but only under the conditions described in the
XX-CHESS General Public License.   A copy of this license is
Xsupposed to have been given to you along with X-CHESS so you
Xcan know your rights and responsibilities.  It should be in a
Xfile named COPYING.  Among other things, the copyright notice
Xand this notice must be preserved on all copies.  */
X
X
X/* RCS Info: $Revision: 1.2 $ on $Date: 86/11/23 17:17:04 $
X *           $Source: /users/faustus/xchess/RCS/XCircle.c,v $
X * Copyright (c) 1986 Wayne A. Christopher, U. C. Berkeley CAD Group
X *	Permission is granted to do anything with this code except sell it
X *	or remove this message.
X *
X */
X
X#include <stdio.h>
X#include <X/Xlib.h>
X#include <math.h>
X
X#define PI 3.1415926535897932384
X
X#define MAXVERTS 1000
X
Xvoid
XXCircle(win, x, y, rad, start, end, width, height, pixel, func, planes)
X	Window win;
X	int x, y, rad;
X	double start, end;
X	int pixel;
X	int width, height;
X	int func, planes;
X{
X	Vertex verts[MAXVERTS];
X	double xp, yp, ang;
X	int lx, ly, xpt, ypt, i;
X	double gradincr = 2 / (double) rad;
X	int bk = 0;
X
X	while (end >= PI * 2)
X		end -= PI * 2;
X	while (start >= PI * 2)
X		start -= PI * 2;
X	while (end < 0)
X		end += PI * 2;
X	while (start < 0)
X		start += PI * 2;
X	if (end == start) {
X		if (end < gradincr)
X			end = end + PI * 2 - gradincr / 2;
X		else
X			end -= gradincr / 2;
X	}
X	for (ang = start, i = 0; i < MAXVERTS; ) {
X
X		xp = x + rad * cos(ang);
X		yp = y + rad * sin(ang);
X
X		xpt = xp;
X		ypt = yp;
X
X		if (!i || (lx != xpt) || (ly != ypt)) {
X			verts[i].x = xpt;
X			verts[i].y = ypt;
X			verts[i].flags = 0;
X			i++;
X		}
X		lx = xpt;
X		ly = ypt;
X		if (bk)
X			break;
X		if (((ang < end) && (ang + gradincr > end)) || ((end < start)
X				&& (ang + gradincr > 2 * PI)
X				&& (ang + gradincr - 2 * PI > end))) {
X			ang = end;
X			bk = 1;
X		} else if (ang == end) {
X			break;
X		} else {
X			ang += gradincr;
X		}
X		if (ang >= PI * 2)
X			ang -= PI * 2;
X	}
X
X	/* Now draw the thing.. */
X	XDraw(win, verts, i, width, height, pixel, func, planes);
X
X	return;
X}
X
X#ifdef notdef	VertexCurved is screwed up
X
Xvoid
XXCircle(win, x, y, rad, start, end, width, height, pixel, func, planes)
X	Window win;
X	int x, y, rad;
X	double start, end;
X	int pixel;
X	int width, height;
X	int func, planes;
X{
X	Vertex verts[7];
X	int i, j, sv, ev;
X	int dp = 0;
X
X	for (i = j = 0 ; i < 4; i++) {
X		verts[j].x = x + rad * cos((double) (PI * i / 2));
X		verts[j].y = y + rad * sin((double) (PI * i / 2));
X		verts[j].flags = VertexCurved;
X		if ((start >= PI * i / 2) && (start < PI * (i + 1) / 2) &&
X				(start != end)) {
X			j++;
X			verts[j].x = x + rad * cos(start);
X			verts[j].y = y + rad * sin(start);
X			verts[j].flags = VertexCurved;
X			sv = j;
X		} else if ((end >= PI * i / 2) && (end < PI * (i + 1) / 2)
X				&& (start != end)) {
X			j++;
X			verts[j].x = x + rad * cos(end);
X			verts[j].y = y + rad * sin(end);
X			verts[j].flags = VertexCurved;
X			ev = j;
X		}
X		j++;
X	}
X	verts[0].flags |= VertexStartClosed;
X	verts[j].x = verts[0].x;
X	verts[j].y = verts[0].y;
X	verts[j].flags = (verts[0].flags & ~VertexStartClosed) | 
X			VertexEndClosed;
X	for (i = 0; i < 15; i++) {
X		if (dp)
X			verts[i % 7].flags |= VertexDontDraw;
X		if (i % 7 == ev)
X			dp = 1;
X		else if (i % 7 == sv)
X			dp = 0;
X	}
X	XDraw(win, verts, j + 1, width, height, pixel, func, planes);
X
X	return;
X}
X
X#endif notdef
X
END_OF_XCircle.c
if test 3820 -ne `wc -c <XCircle.c`; then
    echo shar: \"XCircle.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f bishop_small.bitmap -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"bishop_small.bitmap\"
else
echo shar: Extracting \"bishop_small.bitmap\" \(1539 characters\)
sed "s/^X//" >bishop_small.bitmap <<'END_OF_bishop_small.bitmap'
X/* This file contains code for X-CHESS.
X   Copyright (C) 1986 Free Software Foundation, Inc.
X
XThis file is part of X-CHESS.
X
XX-CHESS is distributed in the hope that it will be useful,
Xbut WITHOUT ANY WARRANTY.  No author or distributor
Xaccepts responsibility to anyone for the consequences of using it
Xor for whether it serves any particular purpose or works at all,
Xunless he says so in writing.  Refer to the X-CHESS General Public
XLicense for full details.
X
XEveryone is granted permission to copy, modify and redistribute
XX-CHESS, but only under the conditions described in the
XX-CHESS General Public License.   A copy of this license is
Xsupposed to have been given to you along with X-CHESS so you
Xcan know your rights and responsibilities.  It should be in a
Xfile named COPYING.  Among other things, the copyright notice
Xand this notice must be preserved on all copies.  */
X
X#define bishop_small_width 32
X#define bishop_small_height 32
Xstatic short bishop_small_bits[] = {
X   0x0000, 0x0000, 0x7000, 0x001c,
X   0x7000, 0x001c, 0x7000, 0x001c,
X   0x2000, 0x0008, 0x6000, 0x0016,
X   0x6000, 0x0022, 0xf000, 0x0023,
X   0xf000, 0x0021, 0xf800, 0x0021,
X   0xf800, 0x0023, 0xf800, 0x0023,
X   0xf800, 0x0027, 0x3800, 0x0027,
X   0x3c00, 0x002f, 0x0c00, 0x002c,
X   0x0e00, 0x003c, 0x3e00, 0x003f,
X   0x3e00, 0x003f, 0x3e00, 0x003f,
X   0x3e00, 0x003f, 0xfe00, 0x007f,
X   0xfe00, 0x007f, 0xfe00, 0x007f,
X   0xfe00, 0x007f, 0xfe00, 0x007f,
X   0xfe00, 0x007f, 0xfe00, 0x007f,
X   0xfe00, 0x007f, 0xffe0, 0x07ff,
X   0x0000, 0x0000, 0x0000, 0x0000};
END_OF_bishop_small.bitmap
if test 1539 -ne `wc -c <bishop_small.bitmap`; then
    echo shar: \"bishop_small.bitmap\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f bishop_small_outline.bitmap -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"bishop_small_outline.bitmap\"
else
echo shar: Extracting \"bishop_small_outline.bitmap\" \(1563 characters\)
sed "s/^X//" >bishop_small_outline.bitmap <<'END_OF_bishop_small_outline.bitmap'
X/* This file contains code for X-CHESS.
X   Copyright (C) 1986 Free Software Foundation, Inc.
X
XThis file is part of X-CHESS.
X
XX-CHESS is distributed in the hope that it will be useful,
Xbut WITHOUT ANY WARRANTY.  No author or distributor
Xaccepts responsibility to anyone for the consequences of using it
Xor for whether it serves any particular purpose or works at all,
Xunless he says so in writing.  Refer to the X-CHESS General Public
XLicense for full details.
X
XEveryone is granted permission to copy, modify and redistribute
XX-CHESS, but only under the conditions described in the
XX-CHESS General Public License.   A copy of this license is
Xsupposed to have been given to you along with X-CHESS so you
Xcan know your rights and responsibilities.  It should be in a
Xfile named COPYING.  Among other things, the copyright notice
Xand this notice must be preserved on all copies.  */
X
X#define bishop_small_outline_width 32
X#define bishop_small_outline_height 32
Xstatic short bishop_small_outline_bits[] = {
X   0x0000, 0x0000, 0x7000, 0x001c,
X   0x5000, 0x0014, 0x7000, 0x001c,
X   0x2000, 0x0008, 0x6000, 0x0016,
X   0x6000, 0x0022, 0xf000, 0x0023,
X   0x1000, 0x0021, 0x1800, 0x0021,
X   0x0800, 0x0023, 0x0800, 0x0022,
X   0x0800, 0x0026, 0x0800, 0x0024,
X   0xcc00, 0x002c, 0xc400, 0x0028,
X   0xf600, 0x003b, 0xf200, 0x0023,
X   0xc200, 0x0020, 0xc200, 0x0020,
X   0xc200, 0x0020, 0xc200, 0x0060,
X   0x0200, 0x0040, 0x0200, 0x0040,
X   0x0200, 0x0040, 0x0200, 0x0040,
X   0x0200, 0x0040, 0x0200, 0x0040,
X   0x0200, 0x0040, 0xffe0, 0x07ff,
X   0x0000, 0x0000, 0x0000, 0x0000};
END_OF_bishop_small_outline.bitmap
if test 1563 -ne `wc -c <bishop_small_outline.bitmap`; then
    echo shar: \"bishop_small_outline.bitmap\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f king_small.bitmap -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"king_small.bitmap\"
else
echo shar: Extracting \"king_small.bitmap\" \(1533 characters\)
sed "s/^X//" >king_small.bitmap <<'END_OF_king_small.bitmap'
X/* This file contains code for X-CHESS.
X   Copyright (C) 1986 Free Software Foundation, Inc.
X
XThis file is part of X-CHESS.
X
XX-CHESS is distributed in the hope that it will be useful,
Xbut WITHOUT ANY WARRANTY.  No author or distributor
Xaccepts responsibility to anyone for the consequences of using it
Xor for whether it serves any particular purpose or works at all,
Xunless he says so in writing.  Refer to the X-CHESS General Public
XLicense for full details.
X
XEveryone is granted permission to copy, modify and redistribute
XX-CHESS, but only under the conditions described in the
XX-CHESS General Public License.   A copy of this license is
Xsupposed to have been given to you along with X-CHESS so you
Xcan know your rights and responsibilities.  It should be in a
Xfile named COPYING.  Among other things, the copyright notice
Xand this notice must be preserved on all copies.  */
X
X#define king_small_width 32
X#define king_small_height 32
Xstatic short king_small_bits[] = {
X   0x0000, 0x0000, 0x0000, 0x0000,
X   0x0000, 0x0000, 0x0000, 0x00e0,
X   0x8000, 0x009f, 0x7000, 0x0020,
X   0x0c00, 0x0040, 0x0200, 0x0180,
X   0x0180, 0x0300, 0x0040, 0x0600,
X   0x6040, 0x0830, 0x6020, 0x1030,
X   0x0020, 0x6000, 0x0020, 0x4000,
X   0x0010, 0x8000, 0x0010, 0x8002,
X   0x0010, 0x8001, 0x0110, 0x8001,
X   0x0310, 0x841f, 0x0210, 0x8400,
X   0x0610, 0x8600, 0x1c20, 0x4200,
X   0xf020, 0x43ff, 0x0020, 0x4000,
X   0x0040, 0x2000, 0x0040, 0x2000,
X   0x0180, 0x1800, 0xff00, 0x0fff,
X   0x0000, 0x0000, 0x0000, 0x0000,
X   0x0000, 0x0000, 0x0000, 0x0000};
END_OF_king_small.bitmap
if test 1533 -ne `wc -c <king_small.bitmap`; then
    echo shar: \"king_small.bitmap\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f king_small_outline.bitmap -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"king_small_outline.bitmap\"
else
echo shar: Extracting \"king_small_outline.bitmap\" \(1557 characters\)
sed "s/^X//" >king_small_outline.bitmap <<'END_OF_king_small_outline.bitmap'
X/* This file contains code for X-CHESS.
X   Copyright (C) 1986 Free Software Foundation, Inc.
X
XThis file is part of X-CHESS.
X
XX-CHESS is distributed in the hope that it will be useful,
Xbut WITHOUT ANY WARRANTY.  No author or distributor
Xaccepts responsibility to anyone for the consequences of using it
Xor for whether it serves any particular purpose or works at all,
Xunless he says so in writing.  Refer to the X-CHESS General Public
XLicense for full details.
X
XEveryone is granted permission to copy, modify and redistribute
XX-CHESS, but only under the conditions described in the
XX-CHESS General Public License.   A copy of this license is
Xsupposed to have been given to you along with X-CHESS so you
Xcan know your rights and responsibilities.  It should be in a
Xfile named COPYING.  Among other things, the copyright notice
Xand this notice must be preserved on all copies.  */
X
X#define king_small_outline_width 32
X#define king_small_outline_height 32
Xstatic short king_small_outline_bits[] = {
X   0x0000, 0x0000, 0x1000, 0x0090,
X   0x1006, 0x00b1, 0x1222, 0x00e1,
X   0x9224, 0x009f, 0x7240, 0x50a0,
X   0x0e04, 0x5040, 0x0240, 0x7180,
X   0x01c8, 0x7300, 0x00d8, 0x4600,
X   0x60d8, 0x0830, 0x60a0, 0x1030,
X   0x0020, 0x6000, 0x0020, 0x4000,
X   0x0010, 0x8000, 0x0010, 0x8002,
X   0x0010, 0x8001, 0x0110, 0x8001,
X   0x0310, 0x841f, 0x0210, 0x8400,
X   0x0610, 0x8600, 0x1c20, 0x4200,
X   0xf020, 0x43ff, 0x0020, 0x4000,
X   0x0040, 0x2000, 0x0040, 0x2000,
X   0x0180, 0x1800, 0xff00, 0x0fff,
X   0x0000, 0x0000, 0x0000, 0x0000,
X   0x0000, 0x0000, 0x0000, 0x0000};
END_OF_king_small_outline.bitmap
if test 1557 -ne `wc -c <king_small_outline.bitmap`; then
    echo shar: \"king_small_outline.bitmap\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f knight_small.bitmap -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"knight_small.bitmap\"
else
echo shar: Extracting \"knight_small.bitmap\" \(1539 characters\)
sed "s/^X//" >knight_small.bitmap <<'END_OF_knight_small.bitmap'
X/* This file contains code for X-CHESS.
X   Copyright (C) 1986 Free Software Foundation, Inc.
X
XThis file is part of X-CHESS.
X
XX-CHESS is distributed in the hope that it will be useful,
Xbut WITHOUT ANY WARRANTY.  No author or distributor
Xaccepts responsibility to anyone for the consequences of using it
Xor for whether it serves any particular purpose or works at all,
Xunless he says so in writing.  Refer to the X-CHESS General Public
XLicense for full details.
X
XEveryone is granted permission to copy, modify and redistribute
XX-CHESS, but only under the conditions described in the
XX-CHESS General Public License.   A copy of this license is
Xsupposed to have been given to you along with X-CHESS so you
Xcan know your rights and responsibilities.  It should be in a
Xfile named COPYING.  Among other things, the copyright notice
Xand this notice must be preserved on all copies.  */
X
X#define knight_small_width 32
X#define knight_small_height 32
Xstatic short knight_small_bits[] = {
X   0x0000, 0x0000, 0x0600, 0x0080,
X   0xee00, 0x027f, 0xfe00, 0x017f,
X   0xff00, 0x04ff, 0xff00, 0x02ff,
X   0xff80, 0x09ff, 0xfcc0, 0x07ff,
X   0xfce0, 0x11ff, 0xffe0, 0x0dff,
X   0xffe0, 0x03ff, 0xfff0, 0x3fff,
X   0xfff0, 0x03ff, 0xfff0, 0x7fff,
X   0xfff8, 0x07ff, 0xc7fc, 0x7fff,
X   0xc1fe, 0x07ff, 0xc1fa, 0x7fff,
X   0xc0ce, 0x07ff, 0xc06c, 0x7fff,
X   0xe028, 0x07ff, 0xe000, 0x7fff,
X   0xe000, 0x0fff, 0xf000, 0x7fff,
X   0xf000, 0x0fff, 0xf000, 0x7fff,
X   0xf800, 0x0fff, 0xf800, 0x7fff,
X   0xfc00, 0x0fff, 0xff00, 0x7fff,
X   0x0000, 0x0000, 0x0000, 0x0000};
END_OF_knight_small.bitmap
if test 1539 -ne `wc -c <knight_small.bitmap`; then
    echo shar: \"knight_small.bitmap\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f knight_small_outline.bitmap -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"knight_small_outline.bitmap\"
else
echo shar: Extracting \"knight_small_outline.bitmap\" \(1563 characters\)
sed "s/^X//" >knight_small_outline.bitmap <<'END_OF_knight_small_outline.bitmap'
X/* This file contains code for X-CHESS.
X   Copyright (C) 1986 Free Software Foundation, Inc.
X
XThis file is part of X-CHESS.
X
XX-CHESS is distributed in the hope that it will be useful,
Xbut WITHOUT ANY WARRANTY.  No author or distributor
Xaccepts responsibility to anyone for the consequences of using it
Xor for whether it serves any particular purpose or works at all,
Xunless he says so in writing.  Refer to the X-CHESS General Public
XLicense for full details.
X
XEveryone is granted permission to copy, modify and redistribute
XX-CHESS, but only under the conditions described in the
XX-CHESS General Public License.   A copy of this license is
Xsupposed to have been given to you along with X-CHESS so you
Xcan know your rights and responsibilities.  It should be in a
Xfile named COPYING.  Among other things, the copyright notice
Xand this notice must be preserved on all copies.  */
X
X#define knight_small_outline_width 32
X#define knight_small_outline_height 32
Xstatic short knight_small_outline_bits[] = {
X   0x0000, 0x0000, 0x0600, 0x0080,
X   0xee00, 0x027f, 0x3a00, 0x0140,
X   0x0300, 0x04c0, 0x0100, 0x0280,
X   0x0180, 0x0980, 0x0cc0, 0x0700,
X   0x0c60, 0x1100, 0x0020, 0x0d00,
X   0x0020, 0x0300, 0x0030, 0x3e00,
X   0x0010, 0x0200, 0x0010, 0x7e00,
X   0x7c18, 0x0400, 0x470c, 0x7c00,
X   0x4106, 0x0400, 0x41f2, 0x7c00,
X   0x40de, 0x0400, 0x406c, 0x7c00,
X   0x6028, 0x0400, 0x2000, 0x7c00,
X   0x2000, 0x0800, 0x3000, 0x7800,
X   0x1000, 0x0800, 0x1000, 0x7800,
X   0x1800, 0x0800, 0x0800, 0x7800,
X   0x0c00, 0x0800, 0xff00, 0x7fff,
X   0x0000, 0x0000, 0x0000, 0x0000};
END_OF_knight_small_outline.bitmap
if test 1563 -ne `wc -c <knight_small_outline.bitmap`; then
    echo shar: \"knight_small_outline.bitmap\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f message.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"message.c\"
else
echo shar: Extracting \"message.c\" \(2895 characters\)
sed "s/^X//" >message.c <<'END_OF_message.c'
X/* This file contains code for X-CHESS.
X   Copyright (C) 1986 Free Software Foundation, Inc.
X
XThis file is part of X-CHESS.
X
XX-CHESS is distributed in the hope that it will be useful,
Xbut WITHOUT ANY WARRANTY.  No author or distributor
Xaccepts responsibility to anyone for the consequences of using it
Xor for whether it serves any particular purpose or works at all,
Xunless he says so in writing.  Refer to the X-CHESS General Public
XLicense for full details.
X
XEveryone is granted permission to copy, modify and redistribute
XX-CHESS, but only under the conditions described in the
XX-CHESS General Public License.   A copy of this license is
Xsupposed to have been given to you along with X-CHESS so you
Xcan know your rights and responsibilities.  It should be in a
Xfile named COPYING.  Among other things, the copyright notice
Xand this notice must be preserved on all copies.  */
X
X
X/* RCS Info: $Revision: 1.4 $ on $Date: 86/11/26 12:10:22 $
X *           $Source: /users/faustus/xchess/RCS/message.c,v $
X * Copyright (c) 1986 Wayne A. Christopher, U. C. Berkeley CAD Group
X *	Permission is granted to do anything with this code except sell it
X *	or remove this message.
X *
X * Do stuff with the message window.  Font 0 is the normal font, font 1
X * is large, and font 3 is normal red.
X */
X/*
X * Converted imbedded ^F and ^H characters to \006 and \010,
X * respectively.   billr@tekred.tek.com  1/18/88
X */
X
X#include "xchess.h"
X
X#define MESSAGE_HEADER	"\0061  XChess Messages\0060\n\n"
X
Xvoid
Xmessage_init(win)
X	windata *win;
X{
X	TxtGrab(win->messagewin, "xchess", win->medium, 
X			win->textback.pixel, win->textcolor.pixel,
X				win->cursorcolor.pixel);
X	TxtAddFont(win->messagewin, 1, win->large, win->textcolor.pixel);
X	TxtAddFont(win->messagewin, 2, win->medium, win->errortext.pixel);
X	TxtAddFont(win->messagewin, 3, win->medium, win->playertext.pixel);
X
X	TxtWriteStr(win->messagewin, MESSAGE_HEADER);
X	return;
X}
X
Xvoid
Xmessage_add(win, string, err)
X	windata *win;
X	char *string;
X	bool err;
X{
X	XSetDisplay(win->display);
X	if (err) {
X		TxtWriteStr(win->messagewin, "\0062");
X		TxtWriteStr(win->messagewin, string);
X		TxtWriteStr(win->messagewin, "\0060");
X		XFeep(0);
X	} else
X		TxtWriteStr(win->messagewin, string);
X	return;
X}
X
Xvoid
Xmessage_send(win, event)
X	windata *win;
X	XEvent *event;
X{
X	XKeyOrButtonEvent *ev = (XKeyOrButtonEvent *) event;
X	windata *ow = (win == win1) ? win2 : win1;
X	char buf[BSIZE], *s;
X	int i;
X
X	s = XLookupMapping(ev, &i);
X	strncpy(buf, s, i);
X	buf[i] = '\0';
X	for (s = buf; *s; s++)
X		if (*s == '\r')
X			*s = '\n';
X		else if (*s == '\177')
X			*s = '\010';
X
X	XSetDisplay(win->display);
X	TxtWriteStr(win->messagewin, "\0063");
X	TxtWriteStr(win->messagewin, buf);
X	TxtWriteStr(win->messagewin, "\0060");
X	if (ow) {
X		XSetDisplay(ow->display);
X		TxtWriteStr(ow->messagewin, "\0063");
X		TxtWriteStr(ow->messagewin, buf);
X		TxtWriteStr(ow->messagewin, "\0060");
X	}
X	return;
X}
X
END_OF_message.c
if test 2895 -ne `wc -c <message.c`; then
    echo shar: \"message.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f pawn_small.bitmap -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"pawn_small.bitmap\"
else
echo shar: Extracting \"pawn_small.bitmap\" \(1533 characters\)
sed "s/^X//" >pawn_small.bitmap <<'END_OF_pawn_small.bitmap'
X/* This file contains code for X-CHESS.
X   Copyright (C) 1986 Free Software Foundation, Inc.
X
XThis file is part of X-CHESS.
X
XX-CHESS is distributed in the hope that it will be useful,
Xbut WITHOUT ANY WARRANTY.  No author or distributor
Xaccepts responsibility to anyone for the consequences of using it
Xor for whether it serves any particular purpose or works at all,
Xunless he says so in writing.  Refer to the X-CHESS General Public
XLicense for full details.
X
XEveryone is granted permission to copy, modify and redistribute
XX-CHESS, but only under the conditions described in the
XX-CHESS General Public License.   A copy of this license is
Xsupposed to have been given to you along with X-CHESS so you
Xcan know your rights and responsibilities.  It should be in a
Xfile named COPYING.  Among other things, the copyright notice
Xand this notice must be preserved on all copies.  */
X
X#define pawn_small_width 32
X#define pawn_small_height 32
Xstatic short pawn_small_bits[] = {
X   0x0000, 0x0000, 0xe000, 0x0007,
X   0xf000, 0x000f, 0xf800, 0x001f,
X   0xf800, 0x001f, 0xf800, 0x001f,
X   0xf800, 0x001f, 0xf800, 0x001f,
X   0xf000, 0x000f, 0xe000, 0x0007,
X   0xe000, 0x0007, 0xff80, 0x01ff,
X   0xff80, 0x01ff, 0xe000, 0x0007,
X   0xe000, 0x0007, 0xe000, 0x0007,
X   0xe000, 0x0007, 0xe000, 0x0007,
X   0xe000, 0x0007, 0xe000, 0x0007,
X   0xe000, 0x0007, 0xe000, 0x0007,
X   0xe000, 0x0007, 0xe000, 0x0007,
X   0xf000, 0x000f, 0xf800, 0x001f,
X   0xfc00, 0x003f, 0xff00, 0x00ff,
X   0xffe0, 0x07ff, 0xfff0, 0x0fff,
X   0x0000, 0x0000, 0x0000, 0x0000};
END_OF_pawn_small.bitmap
if test 1533 -ne `wc -c <pawn_small.bitmap`; then
    echo shar: \"pawn_small.bitmap\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f pawn_small_outline.bitmap -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"pawn_small_outline.bitmap\"
else
echo shar: Extracting \"pawn_small_outline.bitmap\" \(1557 characters\)
sed "s/^X//" >pawn_small_outline.bitmap <<'END_OF_pawn_small_outline.bitmap'
X/* This file contains code for X-CHESS.
X   Copyright (C) 1986 Free Software Foundation, Inc.
X
XThis file is part of X-CHESS.
X
XX-CHESS is distributed in the hope that it will be useful,
Xbut WITHOUT ANY WARRANTY.  No author or distributor
Xaccepts responsibility to anyone for the consequences of using it
Xor for whether it serves any particular purpose or works at all,
Xunless he says so in writing.  Refer to the X-CHESS General Public
XLicense for full details.
X
XEveryone is granted permission to copy, modify and redistribute
XX-CHESS, but only under the conditions described in the
XX-CHESS General Public License.   A copy of this license is
Xsupposed to have been given to you along with X-CHESS so you
Xcan know your rights and responsibilities.  It should be in a
Xfile named COPYING.  Among other things, the copyright notice
Xand this notice must be preserved on all copies.  */
X
X#define pawn_small_outline_width 32
X#define pawn_small_outline_height 32
Xstatic short pawn_small_outline_bits[] = {
X   0x0000, 0x0000, 0xe000, 0x0007,
X   0x3000, 0x000c, 0x1800, 0x0018,
X   0x0800, 0x0010, 0x0800, 0x0010,
X   0x0800, 0x0010, 0x1800, 0x0018,
X   0x3000, 0x000c, 0x2000, 0x0004,
X   0x2000, 0x0004, 0x3f80, 0x01fc,
X   0x3f80, 0x01fc, 0x2000, 0x0004,
X   0x2000, 0x0004, 0x2000, 0x0004,
X   0x2000, 0x0004, 0x2000, 0x0004,
X   0x2000, 0x0004, 0x2000, 0x0004,
X   0x2000, 0x0004, 0x2000, 0x0004,
X   0x2000, 0x0004, 0x2000, 0x0004,
X   0xf000, 0x000f, 0x1800, 0x0018,
X   0x0c00, 0x0030, 0x0700, 0x00e0,
X   0x01e0, 0x0780, 0xfff0, 0x0fff,
X   0x0000, 0x0000, 0x0000, 0x0000};
END_OF_pawn_small_outline.bitmap
if test 1557 -ne `wc -c <pawn_small_outline.bitmap`; then
    echo shar: \"pawn_small_outline.bitmap\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f popup.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"popup.c\"
else
echo shar: Extracting \"popup.c\" \(3134 characters\)
sed "s/^X//" >popup.c <<'END_OF_popup.c'
X/* This file contains code for X-CHESS.
X   Copyright (C) 1986 Free Software Foundation, Inc.
X
XThis file is part of X-CHESS.
X
XX-CHESS is distributed in the hope that it will be useful,
Xbut WITHOUT ANY WARRANTY.  No author or distributor
Xaccepts responsibility to anyone for the consequences of using it
Xor for whether it serves any particular purpose or works at all,
Xunless he says so in writing.  Refer to the X-CHESS General Public
XLicense for full details.
X
XEveryone is granted permission to copy, modify and redistribute
XX-CHESS, but only under the conditions described in the
XX-CHESS General Public License.   A copy of this license is
Xsupposed to have been given to you along with X-CHESS so you
Xcan know your rights and responsibilities.  It should be in a
Xfile named COPYING.  Among other things, the copyright notice
Xand this notice must be preserved on all copies.  */
X
X
X/* RCS Info: $Revision: 1.2 $ on $Date: 86/11/26 12:10:38 $
X *           $Source: /users/faustus/xchess/RCS/popup.c,v $
X * Copyright (c) 1986 Wayne A. Christopher, U. C. Berkeley CAD Group 
X *	 faustus@cad.berkeley.edu, ucbvax!faustus
X * Permission is granted to modify and re-distribute this code in any manner
X * as long as this notice is preserved.  All standard disclaimers apply.
X *
X * A simple pop-up menu system.
X */
X
X#include "xchess.h"
X
X/* Open a small window with some text in it and two buttons -- yes and no.
X * Use black and white pixel, and the medium font.
X */
X
Xbool
Xpop_question(win, text)
X	windata *win;
X	char *text;
X{
X	char *s, *t;
X	int nlines = 1, ncols = 0, i = 0, j;
X	int x, y;
X	Window w;
X	bool ch;
X	XEvent ev;
X	Pixmap btile, ttile;
X
X	for (s = text; *s; s++) {
X		if ((*s == '\n') && s[1])
X			nlines++;
X		if ((*s == '\n') || !s[1]) {
X			if (i > ncols)
X				ncols = i;
X			i = 0;
X		} else
X			i++;
X	}
X
X	if (ncols < 12)
X		ncols = 12;
X	nlines += 4;
X	ncols += 4;
X
X	x = (BASE_WIDTH - ncols * win->medium->width) / 2;
X	y = (BASE_HEIGHT - nlines * win->medium->height) / 2;
X
X	XSync(0);
X	XSetDisplay(win->display);
X	btile = XMakeTile(win->border.pixel);
X	ttile = XMakeTile(win->textback.pixel);
X	w = XCreateWindow(win->basewin, x, y, ncols *
X			win->medium->width, nlines * win->medium->height,
X			BORDER_WIDTH, btile, ttile);
X	XMapWindow(w);
X
X	for (i = 0, s = text; i < nlines - 4; i++) {
X		for (t = s, j = 0; *t && (*t != '\n'); t++, j++)
X			;
X		XText(w, (ncols - j) / 2 * win->medium->width, (i + 1) *
X				win->medium->height, s, j, win->medium->id,
X				win->textcolor.pixel, win->textback.pixel);
X		s = t + 1;
X	}
X	XText(w, (ncols - 8) * win->medium->width / 4, (nlines - 2) *
X			win->medium->height, "YES", 3, win->medium->id,
X			win->textcolor.pixel, win->textback.pixel);
X	XText(w, (ncols - 4) * win->medium->width * 3 / 4, (nlines - 2) *
X			win->medium->height, "NO", 2, win->medium->id,
X			win->textcolor.pixel, win->textback.pixel);
X	
X	XSelectInput(w, ButtonPressed);
X	XWindowEvent(w, ButtonPressed, &ev);
X	x = ((XKeyOrButtonEvent *) &ev)->x;
X	y = ((XKeyOrButtonEvent *) &ev)->y;
X
X	if (x > ncols * win->medium->width / 2)
X		ch = false;
X	else
X		ch = true;
X
X	XFreePixmap(btile);
X	XFreePixmap(ttile);
X	XDestroyWindow(w);
X	return (ch);
X}
X
END_OF_popup.c
if test 3134 -ne `wc -c <popup.c`; then
    echo shar: \"popup.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f program.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"program.c\"
else
echo shar: Extracting \"program.c\" \(3861 characters\)
sed "s/^X//" >program.c <<'END_OF_program.c'
X/* This file contains code for X-CHESS.
X   Copyright (C) 1986 Free Software Foundation, Inc.
X
XThis file is part of X-CHESS.
X
XX-CHESS is distributed in the hope that it will be useful,
Xbut WITHOUT ANY WARRANTY.  No author or distributor
Xaccepts responsibility to anyone for the consequences of using it
Xor for whether it serves any particular purpose or works at all,
Xunless he says so in writing.  Refer to the X-CHESS General Public
XLicense for full details.
X
XEveryone is granted permission to copy, modify and redistribute
XX-CHESS, but only under the conditions described in the
XX-CHESS General Public License.   A copy of this license is
Xsupposed to have been given to you along with X-CHESS so you
Xcan know your rights and responsibilities.  It should be in a
Xfile named COPYING.  Among other things, the copyright notice
Xand this notice must be preserved on all copies.  */
X
X
X/* RCS Info: $Revision: 1.2 $ on $Date: 86/11/23 17:18:10 $
X *           $Source: /users/faustus/xchess/RCS/program.c,v $
X * Copyright (c) 1986 Wayne A. Christopher, U. C. Berkeley CAD Group
X *	Permission is granted to do anything with this code except sell it
X *	or remove this message.
X *
X * The interface to whichever chess playing program we are using...
X */
X
X#include "xchess.h"
X#include <signal.h>
X#include <sys/time.h>
X
Xstatic int pid;
Xstatic FILE *from, *to;
X
Xbool
Xprogram_init(name)
X	char *name;
X{
X	int toprog[2], fromprog[2];
X	char buf[BSIZE];
X
X	pipe(toprog);
X	pipe(fromprog);
X
X	if (!(pid = fork())) {
X		/* Start up the program. */
X		dup2(toprog[0], 0);
X		dup2(fromprog[1], 1);
X		close(toprog[0]);
X		close(toprog[1]);
X		close(fromprog[0]);
X		close(fromprog[1]);
X		if (proghost)
X			execl("/usr/ucb/rsh", "rsh", proghost, name,
X					(char *) NULL);
X		else
X			execl(name, name, (char *) NULL);
X		perror(name);
X		exit(1);
X	}
X
X	close(toprog[0]);
X	close(fromprog[1]);
X
X	from = fdopen(fromprog[0], "r");
X	to = fdopen(toprog[1], "w");
X
X	/* Get the first line... */
X	fgets(buf, BSIZE, from);
X	if (debug)
X		fprintf(stderr, "program says %s", buf);
X	if (blackflag) {
X		fputs("switch\n", to);
X		fflush(to);
X		fgets(buf, BSIZE, from);
X		if (debug)
X			fprintf(stderr, "program says %s", buf);
X		message_add(win1, "GNU Chess playing white\n", false);
X	} else
X		message_add(win1, "GNU Chess playing black\n", false);
X
X	return (true);
X}
X
Xvoid
Xprogram_end()
X{
X	fclose(from);
X	fclose(to);
X	kill(pid, SIGTERM);
X	return;
X}
X
Xvoid
Xprogram_send(m)
X	move *m;
X{
X	char buf[BSIZE];
X
X	if ((m->type == MOVE) || (m->type == CAPTURE))
X		sprintf(buf, "%c%d%c%d\n", 'a' + m->fromx, SIZE - m->fromy,
X				'a' + m->tox, SIZE - m->toy);
X	else if (m->type == KCASTLE)
X		strcpy(buf, (m->piece.color == WHITE) ? "e1g1\n" : "e8g8\n");
X	else if (m->type == QCASTLE)
X		strcpy(buf, (m->piece.color == WHITE) ? "e1c1\n" : "e8c8\n");
X
X	if (debug)
X		fprintf(stderr, "sending program %s", buf);
X	fputs(buf, to);
X	fflush(to);
X
X	/* One junk line... */
X	fgets(buf, BSIZE, from);
X	if (debug)
X		fprintf(stderr, "program says %s", buf);
X	return;
X}
X
Xmove *
Xprogram_get()
X{
X	int rfd = (1 << fileno(from)), wfd = 0, xfd = 0;
X	static struct timeval notime = { 0, 0 };
X	char buf[BSIZE], *s;
X	move *m;
X	int i, n;
X
X	/* Do a poll... */
X
X	if (!(i = select(32, &rfd, &wfd, &xfd, &notime)) &&
X			!from->_cnt) {		/* Bad stuff... */
X		if (debug)
X			fprintf(stderr, "poll: nothing\n");
X		return (NULL);
X	}
X	if (i == -1) {
X		perror("select");
X		return (NULL);
X	}
X
X	fgets(buf, BSIZE, from);
X	if (debug)
X		fprintf(stderr, "got from program %s", buf);
X
X	for (s = buf; !isalpha(*s); s++)
X		;
X	m = parse_imove(chessboard, s, nexttomove);
X
X	if (!valid_move(m, chessboard)) {
X		fprintf(stderr, "Error: move %s is invalid!!\n", buf);
X		return (NULL);
X	}
X
X	/*
X	fgets(buf, BSIZE, from);
X	if (debug)
X		fprintf(stderr, "program says %s", buf);
X	*/
X	message_add(win1, buf, false);
X	return (m);
X}
X
Xvoid
Xprogram_undo()
X{
X	fputs("undo\n", to);
X	return;
X}
X
END_OF_program.c
if test 3861 -ne `wc -c <program.c`; then
    echo shar: \"program.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f queen_small.bitmap -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"queen_small.bitmap\"
else
echo shar: Extracting \"queen_small.bitmap\" \(1536 characters\)
sed "s/^X//" >queen_small.bitmap <<'END_OF_queen_small.bitmap'
X/* This file contains code for X-CHESS.
X   Copyright (C) 1986 Free Software Foundation, Inc.
X
XThis file is part of X-CHESS.
X
XX-CHESS is distributed in the hope that it will be useful,
Xbut WITHOUT ANY WARRANTY.  No author or distributor
Xaccepts responsibility to anyone for the consequences of using it
Xor for whether it serves any particular purpose or works at all,
Xunless he says so in writing.  Refer to the X-CHESS General Public
XLicense for full details.
X
XEveryone is granted permission to copy, modify and redistribute
XX-CHESS, but only under the conditions described in the
XX-CHESS General Public License.   A copy of this license is
Xsupposed to have been given to you along with X-CHESS so you
Xcan know your rights and responsibilities.  It should be in a
Xfile named COPYING.  Among other things, the copyright notice
Xand this notice must be preserved on all copies.  */
X
X#define queen_small_width 32
X#define queen_small_height 32
Xstatic short queen_small_bits[] = {
X   0x0000, 0x0000, 0x0000, 0x0000,
X   0x8000, 0x0000, 0x8000, 0x0000,
X   0x8080, 0x0080, 0x8080, 0x0080,
X   0x8180, 0x00c0, 0x8180, 0x00c0,
X   0xc100, 0x0041, 0xc100, 0x0041,
X   0xc302, 0x2061, 0xc306, 0x3061,
X   0xc304, 0x1061, 0xc30c, 0x1861,
X   0xc708, 0x0871, 0xc618, 0x0c31,
X   0xc638, 0x0e31, 0xce30, 0x0639,
X   0xce70, 0x0739, 0xee60, 0x033b,
X   0xeee0, 0x03bb, 0xffe0, 0x03ff,
X   0xffc0, 0x01ff, 0xffc0, 0x01ff,
X   0xff80, 0x00ff, 0xff80, 0x00ff,
X   0xff00, 0x007f, 0xff80, 0x00ff,
X   0xfff0, 0x07ff, 0xfff0, 0x07ff,
X   0x0000, 0x0000, 0x0000, 0x0000};
END_OF_queen_small.bitmap
if test 1536 -ne `wc -c <queen_small.bitmap`; then
    echo shar: \"queen_small.bitmap\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f queen_small_outline.bitmap -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"queen_small_outline.bitmap\"
else
echo shar: Extracting \"queen_small_outline.bitmap\" \(1560 characters\)
sed "s/^X//" >queen_small_outline.bitmap <<'END_OF_queen_small_outline.bitmap'
X/* This file contains code for X-CHESS.
X   Copyright (C) 1986 Free Software Foundation, Inc.
X
XThis file is part of X-CHESS.
X
XX-CHESS is distributed in the hope that it will be useful,
Xbut WITHOUT ANY WARRANTY.  No author or distributor
Xaccepts responsibility to anyone for the consequences of using it
Xor for whether it serves any particular purpose or works at all,
Xunless he says so in writing.  Refer to the X-CHESS General Public
XLicense for full details.
X
XEveryone is granted permission to copy, modify and redistribute
XX-CHESS, but only under the conditions described in the
XX-CHESS General Public License.   A copy of this license is
Xsupposed to have been given to you along with X-CHESS so you
Xcan know your rights and responsibilities.  It should be in a
Xfile named COPYING.  Among other things, the copyright notice
Xand this notice must be preserved on all copies.  */
X
X#define queen_small_outline_width 32
X#define queen_small_outline_height 32
Xstatic short queen_small_outline_bits[] = {
X   0x0000, 0x0000, 0x0000, 0x0000,
X   0x8000, 0x0000, 0x8000, 0x0000,
X   0x8080, 0x0080, 0x8080, 0x0080,
X   0x8180, 0x00c0, 0x8180, 0x00c0,
X   0xc100, 0x0041, 0x4100, 0x0041,
X   0x4302, 0x2061, 0x4306, 0x3061,
X   0x4304, 0x1061, 0x430c, 0x1861,
X   0x4708, 0x0871, 0x4618, 0x0c31,
X   0x4638, 0x0e31, 0x4e30, 0x0639,
X   0x4e70, 0x0729, 0x6a60, 0x032b,
X   0x2ae0, 0x03ab, 0x3be0, 0x03ee,
X   0x0040, 0x0100, 0x00c0, 0x0180,
X   0xfc80, 0x009f, 0x0180, 0x00c0,
X   0x0100, 0x0040, 0xfd80, 0x00df,
X   0x00f0, 0x0780, 0xfff0, 0x07ff,
X   0x0000, 0x0000, 0x0000, 0x0000};
END_OF_queen_small_outline.bitmap
if test 1560 -ne `wc -c <queen_small_outline.bitmap`; then
    echo shar: \"queen_small_outline.bitmap\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f rook_small.bitmap -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"rook_small.bitmap\"
else
echo shar: Extracting \"rook_small.bitmap\" \(1533 characters\)
sed "s/^X//" >rook_small.bitmap <<'END_OF_rook_small.bitmap'
X/* This file contains code for X-CHESS.
X   Copyright (C) 1986 Free Software Foundation, Inc.
X
XThis file is part of X-CHESS.
X
XX-CHESS is distributed in the hope that it will be useful,
Xbut WITHOUT ANY WARRANTY.  No author or distributor
Xaccepts responsibility to anyone for the consequences of using it
Xor for whether it serves any particular purpose or works at all,
Xunless he says so in writing.  Refer to the X-CHESS General Public
XLicense for full details.
X
XEveryone is granted permission to copy, modify and redistribute
XX-CHESS, but only under the conditions described in the
XX-CHESS General Public License.   A copy of this license is
Xsupposed to have been given to you along with X-CHESS so you
Xcan know your rights and responsibilities.  It should be in a
Xfile named COPYING.  Among other things, the copyright notice
Xand this notice must be preserved on all copies.  */
X
X#define rook_small_width 32
X#define rook_small_height 32
Xstatic short rook_small_bits[] = {
X   0x0000, 0x0000, 0x0000, 0x0000,
X   0x0000, 0x0000, 0x73c0, 0x03ce,
X   0x73c0, 0x03ce, 0x73c0, 0x03ce,
X   0x73c0, 0x03ce, 0xffc0, 0x03ff,
X   0xff00, 0x00ff, 0xff00, 0x00ff,
X   0xff00, 0x00ff, 0xff00, 0x00ff,
X   0xff00, 0x00ff, 0xff00, 0x00ff,
X   0xff00, 0x00ff, 0xff00, 0x00ff,
X   0xff00, 0x00ff, 0xff00, 0x00ff,
X   0xff00, 0x00ff, 0xff00, 0x00ff,
X   0xff00, 0x00ff, 0xff00, 0x00ff,
X   0xff00, 0x00ff, 0xff00, 0x00ff,
X   0xff00, 0x00ff, 0xff00, 0x00ff,
X   0xff00, 0x00ff, 0xffe0, 0x07ff,
X   0xffe0, 0x07ff, 0xffe0, 0x07ff,
X   0x0000, 0x0000, 0x0000, 0x0000};
END_OF_rook_small.bitmap
if test 1533 -ne `wc -c <rook_small.bitmap`; then
    echo shar: \"rook_small.bitmap\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f rook_small_outline.bitmap -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"rook_small_outline.bitmap\"
else
echo shar: Extracting \"rook_small_outline.bitmap\" \(1557 characters\)
sed "s/^X//" >rook_small_outline.bitmap <<'END_OF_rook_small_outline.bitmap'
X/* This file contains code for X-CHESS.
X   Copyright (C) 1986 Free Software Foundation, Inc.
X
XThis file is part of X-CHESS.
X
XX-CHESS is distributed in the hope that it will be useful,
Xbut WITHOUT ANY WARRANTY.  No author or distributor
Xaccepts responsibility to anyone for the consequences of using it
Xor for whether it serves any particular purpose or works at all,
Xunless he says so in writing.  Refer to the X-CHESS General Public
XLicense for full details.
X
XEveryone is granted permission to copy, modify and redistribute
XX-CHESS, but only under the conditions described in the
XX-CHESS General Public License.   A copy of this license is
Xsupposed to have been given to you along with X-CHESS so you
Xcan know your rights and responsibilities.  It should be in a
Xfile named COPYING.  Among other things, the copyright notice
Xand this notice must be preserved on all copies.  */
X
X#define rook_small_outline_width 32
X#define rook_small_outline_height 32
Xstatic short rook_small_outline_bits[] = {
X   0x0000, 0x0000, 0x0000, 0x0000,
X   0x0000, 0x0000, 0x73c0, 0x03ce,
X   0x5240, 0x024a, 0x5240, 0x024a,
X   0x5240, 0x024a, 0xffc0, 0x03ff,
X   0x0100, 0x0080, 0x0100, 0x0080,
X   0x0100, 0x0080, 0x0100, 0x0080,
X   0x0100, 0x0080, 0x0100, 0x0080,
X   0x0100, 0x0080, 0x0100, 0x0080,
X   0x0100, 0x0080, 0x0100, 0x0080,
X   0x0100, 0x0080, 0x0100, 0x0080,
X   0x0100, 0x0080, 0x0100, 0x0080,
X   0x0100, 0x0080, 0x0100, 0x0080,
X   0x0100, 0x0080, 0x0100, 0x0080,
X   0x0100, 0x0080, 0xffe0, 0x07ff,
X   0x0020, 0x0400, 0xffe0, 0x07ff,
X   0x0000, 0x0000, 0x0000, 0x0000};
END_OF_rook_small_outline.bitmap
if test 1557 -ne `wc -c <rook_small_outline.bitmap`; then
    echo shar: \"rook_small_outline.bitmap\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f scrollText/scrollText.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"scrollText/scrollText.h\"
else
echo shar: Extracting \"scrollText/scrollText.h\" \(782 characters\)
sed "s/^X//" >scrollText/scrollText.h <<'END_OF_scrollText/scrollText.h'
X/*
X * Scrollable Text Window Header File
X *
X * David Harrison
X * University of California,  Berkeley
X * 1986
X *
X * This file contains definitions for a scrollable text window
X * with scroll bar support.
X */
X
Xint TxtGrab();
X   /* Take hold of a previously created window */
X
X#define TXT_NO_COLOR	-1
X
Xint TxtAddFont();
X   /* Loads a new font for use later */
Xint TxtWinP();
X   /* Returns non-zero value if the window is text window */
Xint TxtClear();
X   /* Clears text window and resets text buffer */
X
Xint TxtWriteStr();
X   /* Writes a string to window with immediate update */
Xint TxtJamStr();
X   /* Write a string without causing update to screen */
X
Xint TxtRepaint();
X   /* Repaints entire scrollable text window */
Xint TxtFilter();
X   /* Handles events related to text window */
END_OF_scrollText/scrollText.h
if test 782 -ne `wc -c <scrollText/scrollText.h`; then
    echo shar: \"scrollText/scrollText.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f scrollText/st.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"scrollText/st.h\"
else
echo shar: Extracting \"scrollText/st.h\" \(1149 characters\)
sed "s/^X//" >scrollText/st.h <<'END_OF_scrollText/st.h'
X/* $Header$ */
X
X#ifndef ST_INCLUDED
X
X#define ST_INCLUDED
X
Xtypedef struct st_table_entry st_table_entry;
X
Xstruct st_table_entry {
X    char *key;
X    char *record;
X    st_table_entry *next;
X};
X
Xtypedef struct st_table st_table;
X
Xstruct st_table {
X    int (*compare)();
X    int (*hash)();
X    int num_bins;
X    int num_entries;
X    int max_density;
X    int reorder_flag;
X    double grow_factor;
X    st_table_entry **bins;
X};
X
X#define st_is_member(table,key) st_lookup(table,key,(char **) 0)
X
Xenum st_retval {ST_CONTINUE, ST_STOP, ST_DELETE};
X
Xint st_delete(), st_insert(), st_foreach(), st_free_table();
Xint st_lookup(), st_find_or_add(), st_add_direct();
Xst_table *st_init_table(), *st_init_table_with_params();
X
X#define ST_NUMCMP	((int (*)()) 0)
X#define ST_NUMHASH	((int (*)()) -2)
X
X#define ST_PTRCMP	((int (*)()) 0)
X#define ST_PTRHASH	((int (*)()) -1)
X
X#define st_numcmp	ST_NUMCMP
X#define st_numhash	ST_NUMHASH
X#define st_ptrcmp	ST_PTRCMP
X#define st_ptrhash	ST_PTRHASH
X
X#define ST_DEFAULT_MAX_DENSITY 5
X#define ST_DEFAULT_INIT_TABLE_SIZE 11
X#define ST_DEFAULT_GROW_FACTOR 2.0
X#define ST_DEFAULT_REORDER_FLAG 0
X
Xint st_strhash();
X
X#endif ST_INCLUDED
END_OF_scrollText/st.h
if test 1149 -ne `wc -c <scrollText/st.h`; then
    echo shar: \"scrollText/st.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f std.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"std.h\"
else
echo shar: Extracting \"std.h\" \(2535 characters\)
sed "s/^X//" >std.h <<'END_OF_std.h'
X/* This file contains code for X-CHESS.
X   Copyright (C) 1986 Free Software Foundation, Inc.
X
XThis file is part of X-CHESS.
X
XX-CHESS is distributed in the hope that it will be useful,
Xbut WITHOUT ANY WARRANTY.  No author or distributor
Xaccepts responsibility to anyone for the consequences of using it
Xor for whether it serves any particular purpose or works at all,
Xunless he says so in writing.  Refer to the X-CHESS General Public
XLicense for full details.
X
XEveryone is granted permission to copy, modify and redistribute
XX-CHESS, but only under the conditions described in the
XX-CHESS General Public License.   A copy of this license is
Xsupposed to have been given to you along with X-CHESS so you
Xcan know your rights and responsibilities.  It should be in a
Xfile named COPYING.  Among other things, the copyright notice
Xand this notice must be preserved on all copies.  */
X
X
X/* RCS Info: $Revision: 1.2 $ on $Date: 86/11/23 17:18:32 $
X *		   $Source: /users/faustus/xchess/RCS/std.h,v $
X * Copyright (c) 1986 Wayne A. Christopher, U. C. Berkeley CAD Group
X *
X * Standard definitions.
X */
X
X#define UNIX
X#define BSD
X
X#ifndef FILE
X#include <stdio.h>
X#endif
X#ifndef isalpha
X#include <ctype.h>
X#endif
X#ifndef HUGE
X#include <math.h>
X#endif
X#include <strings.h>
X
Xtypedef int bool;
X
X#define false 0
X#define true 1
X
X/* Externs defined in std.c */
X
Xextern char *tmalloc();
Xextern char *trealloc();
Xextern char *copy();
Xextern char *datestring();
Xextern char *getusername();
Xextern char *gethome();
Xextern char *gettok();
Xextern char *tildexpand();
Xextern void fatal();
Xextern void setenv();
Xextern void appendc();
Xextern int scannum();
Xextern int seconds();
Xextern bool prefix();
Xextern bool ciprefix();
Xextern bool cieq();
Xextern bool substring();
X
X/* Externs from libc */
X
Xextern char *getenv();
Xextern int errno;
Xextern char *sys_errlist[];
X
X/* Should use BSIZE instead of BUFSIZ... */
X
X#define BSIZE	   512
X
X/* Some standard macros. */
X
X#define eq(a,b)	 (!strcmp((a), (b)))
X#define isalphanum(c)   (isalpha(c) || isdigit(c))
X#define alloc(strname)  ((struct strname *) tmalloc(sizeof(struct strname)))
X#define tfree(ptr)  { if (ptr) free((char *) ptr); ptr = 0; }
X#define hexnum(c) ((((c) >= '0') && ((c) <= '9')) ? ((c) - '0') : ((((c) >= \
X		'a') && ((c) <= 'f')) ? ((c) - 'a' + 10) : ((((c) >= 'A') && \
X		((c) <= 'F')) ? ((c) - 'A' + 10) : 0)))
X
X#ifndef BSD
X#define random rand
X#define srandom srand
X#endif BSD
X
X#ifdef VMS
X
X#define EXIT_NORMAL	1
X#define EXIT_BAD	0
X
X#else VMS
X
X#define EXIT_NORMAL	0
X#define EXIT_BAD	1
X
X#endif VMS
X
END_OF_std.h
if test 2535 -ne `wc -c <std.h`; then
    echo shar: \"std.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f xchess.icon -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"xchess.icon\"
else
echo shar: Extracting \"xchess.icon\" \(1335 characters\)
sed "s/^X//" >xchess.icon <<'END_OF_xchess.icon'
X#define icon_width 48
X#define icon_height 48
Xstatic short icon_bits[] = {
X   0xffff, 0xffff, 0xffff, 0x0001,
X   0x0000, 0x8000, 0xffc1, 0xffff,
X   0x83ff, 0x0041, 0x0000, 0x8200,
X   0xf041, 0xf0f0, 0x82f0, 0xf041,
X   0xf0f0, 0x82f0, 0xf041, 0xf0f0,
X   0x82f0, 0xf041, 0xf0f0, 0x82f0,
X   0x0f41, 0x0f0f, 0x820f, 0x0f41,
X   0x0f0f, 0x820f, 0x0f41, 0x0f0f,
X   0x820f, 0x0f41, 0x0f0f, 0x820f,
X   0xf041, 0xf0f0, 0x82f0, 0xf041,
X   0xf0f0, 0x82f0, 0xf041, 0xf0f0,
X   0x82f0, 0xf041, 0xf0f0, 0x82f0,
X   0x0f41, 0x0f0f, 0x820f, 0x0f41,
X   0x0f0f, 0x820f, 0x0f41, 0x0f0f,
X   0x820f, 0x0f41, 0x0f0f, 0x820f,
X   0xf041, 0xf0f0, 0x82f0, 0xf041,
X   0xf0f0, 0x82f0, 0xf041, 0xf0f0,
X   0x82f0, 0xf041, 0xf0f0, 0x82f0,
X   0x0f41, 0x0f0f, 0x820f, 0x0f41,
X   0x0f0f, 0x820f, 0x0f41, 0x0f0f,
X   0x820f, 0x0f41, 0x0f0f, 0x820f,
X   0xf041, 0xf0f0, 0x82f0, 0xf041,
X   0xf0f0, 0x82f0, 0xf041, 0xf0f0,
X   0x82f0, 0xf041, 0xf0f0, 0x82f0,
X   0x0f41, 0x0f0f, 0x820f, 0x0f41,
X   0x0f0f, 0x820f, 0x0f41, 0x0f0f,
X   0x820f, 0x0f41, 0x0f0f, 0x820f,
X   0x0041, 0x0000, 0x8200, 0xffc1,
X   0xffff, 0x83ff, 0x0001, 0x0000,
X   0x8000, 0xc441, 0x3c89, 0x83cf,
X   0x2441, 0x0488, 0x8041, 0x2281,
X   0x0488, 0x8041, 0x2101, 0x1cf8,
X   0x83cf, 0x2281, 0x0488, 0x8208,
X   0x2441, 0x0488, 0x8208, 0xc441,
X   0x3c89, 0x83cf, 0x0001, 0x0000,
X   0x8000, 0xffff, 0xffff, 0xffff};
END_OF_xchess.icon
if test 1335 -ne `wc -c <xchess.icon`; then
    echo shar: \"xchess.icon\" unpacked with wrong size!
fi
# end of overwriting check
fi
echo shar: End of archive 6 \(of 6\).
cp /dev/null ark6isdone
MISSING=""
for I in 1 2 3 4 5 6 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 6 archives.
    rm -f ark[1-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0