summaryrefslogtreecommitdiff
path: root/games/gnuchess/patches/patch-ab
diff options
context:
space:
mode:
authorjlam <jlam>2000-10-15 01:53:39 +0000
committerjlam <jlam>2000-10-15 01:53:39 +0000
commit80c8c0e3e942a3e5b0fdbb6d27297aa0b5461987 (patch)
tree443186d75233dce6339108138ecd86e4f8bfc518 /games/gnuchess/patches/patch-ab
parent41d7a34f754483641cdcf367d215d74e22237389 (diff)
downloadpkgsrc-80c8c0e3e942a3e5b0fdbb6d27297aa0b5461987.tar.gz
Update to gnuchess-5.00nb1: add code to allow building of opening books in
user-specified locations. Remove installation of default book...it's so small that it's pretty much useless anyway. See games/gnuchess-book-* for chess opening books for GNU Chess.
Diffstat (limited to 'games/gnuchess/patches/patch-ab')
-rw-r--r--games/gnuchess/patches/patch-ab58
1 files changed, 47 insertions, 11 deletions
diff --git a/games/gnuchess/patches/patch-ab b/games/gnuchess/patches/patch-ab
index 23fda70571e..59a84185728 100644
--- a/games/gnuchess/patches/patch-ab
+++ b/games/gnuchess/patches/patch-ab
@@ -1,12 +1,48 @@
-$NetBSD: patch-ab,v 1.3 2000/03/26 08:29:25 jlam Exp $
+$NetBSD: patch-ab,v 1.4 2000/10/15 01:53:40 jlam Exp $
---- book.h.orig Fri Oct 15 23:41:03 1999
-+++ book.h Thu Feb 17 23:11:33 2000
-@@ -23,5 +23,5 @@
- bug-gnu-chess@gnu.org
- cracraft@ai.mit.edu, cracraft@stanfordalumni.org, cracraft@earthlink.net
- */
--#define BOOKSRC "book.pgn"
--#define BOOKBIN "book.dat"
-+#define BOOKSRC LIBDIR "book.pgn"
-+#define BOOKBIN LIBDIR "book.dat"
+--- book.c.orig Sat Oct 23 06:07:21 1999
++++ book.c
+@@ -85,7 +85,7 @@
+ mcnt = -1;
+ side = board.side;
+ xside = 1^side;
+- rfp = fopen(BOOKBIN,"r+b");
++ rfp = fopen(BOOKBIN,"rb"); /* don't need to open read/write */
+ if (rfp == NULL) {
+ if (!(flags & XBOARD))
+ fprintf(ofp," no book (%s).\n",BOOKBIN);
+@@ -215,8 +215,13 @@
+ return(1);
+ }
+
+-int genbook(void);
+-int genbook()
++/*
++ * Change genbook() to accept source (pgn book) and target (bin book)
++ * paths. This lets us generate a book from a pgn file different from
++ * the ones in BOOKSRC and BOOKBIN.
++ */
++int genbook(char *, char *);
++int genbook(char *src, char *tgt)
+ {
+ int i,j;
+ short found, epsilon;
+@@ -225,13 +230,13 @@
+ leaf *ptr;
+ FILE *wfp,*rfp;
+
+- printf("Trying to generate book %s from %s...\n",BOOKBIN,BOOKSRC);
+- if ((wfp = fopen(BOOKBIN,"w+b"))==NULL) {
+- printf("Couldn't open the bin book (%s) for write.\n",BOOKBIN);
++ printf("Trying to generate book %s from %s...\n",tgt,src);
++ if ((wfp = fopen(tgt,"w+b"))==NULL) {
++ printf("Couldn't open the bin book (%s) for write.\n",tgt);
+ return(0);
+ }
+- if ((rfp = fopen(BOOKSRC,"r"))==NULL) {
+- printf("Couldn't open the pgn book (%s) for read.\n",BOOKSRC);
++ if ((rfp = fopen(src,"r"))==NULL) {
++ printf("Couldn't open the pgn book (%s) for read.\n",src);
+ fclose(wfp);
+ return(0);
+ }