* ----------------------------------------------------------------------
* Copyright (c) 1993, 1994, 1995 Matthias Mutz
* Copyright (c) 1999 Michael Vanier and the Free Software Foundation
+ * Copyright (c) 2008, 2013, 2014 Yann Dirson and the Free Software Foundation
*
* GNU SHOGI is based on GNU CHESS
*
*
* GNU Shogi is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 1, or (at your option) any
- * later version.
+ * Free Software Foundation; either version 3 of the License,
+ * or (at your option) any later version.
*
* GNU Shogi is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* for more details.
*
* You should have received a copy of the GNU General Public License along
- * with GNU Shogi; see the file COPYING. If not, write to the Free
- * Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * with GNU Shogi; see the file COPYING. If not, see
+ * <http://www.gnu.org/licenses/>.
* ----------------------------------------------------------------------
*
*/
-#include "version.h"
#include "gnushogi.h"
#include <signal.h>
binbookfile = NULL;
#endif
}
-
break;
#ifdef BINBOOK
case 'B':
argc--;
argv++;
-
if (argc > 0)
binbookfile = argv[0];
-
break;
#endif
+#ifdef HAVE_LIBCURSES
case 'C':
/* Curses interface. */
display_type = DISPLAY_CURSES;
-
+ dsp = &curses_display;
break;
-
+#endif
case 'h':
/* Need the "+" syntax here... */
hash = ((argv[0][0] == '-') ? false : true);
break;
-
case 'l':
argc--;
argv++;
if (argc > 0)
Lang = argv[0];
-
break;
-
case 'L':
argc--;
argv++;
strcpy(listfile, argv[0]);
break;
-
case 's':
argc--;
argv++;
if (argc > 0)
strcpy(savefile, argv[0]);
-
break;
-
case 'P':
argc--;
argv++;
if (argc > 0)
bookmaxply = atoi(argv[0]);
-
break;
-
case 'R':
/* Raw text interface. */
display_type = DISPLAY_RAW;
-
+ dsp = &raw_display;
break;
-
case 'S':
argc--;
argv++;
if (argc > 0)
rehash = atoi(argv[0]);
-
if (rehash > MAXrehash)
rehash = MAXrehash;
-
break;
-
case 'T':
argc--;
argv++;
if (argc > 0)
ttblsize = atoi(argv[0]);
-
- if ((ttblsize <= MINTTABLE))
+ if (ttblsize <= MINTTABLE)
ttblsize = (MINTTABLE) + 1;
-
break;
#ifdef HASHFILE
long j;
struct fileentry n;
- printf(CP[66]);
+ fputs("Filling transposition file, wait!\n", stdout);
n.f = n.t = 0;
n.flags = 0;
n.depth = 0;
}
else
{
- printf(CP[50], HASHFILE);
+ printf("Create failed for %s\n", HASHFILE);
}
return 0;
-
case 't': /* Create or test persistent transposition table. */
hashfile = fopen(HASHFILE, RWA_ACC);
int nr[MAXDEPTH];
struct fileentry n;
- printf(CP[49]);
+ fputs("Counting transposition file entries, wait!\n", stdout);
for (i = 0; i < MAXDEPTH; i++)
nr[i] = 0;
}
}
- printf(CP[109], nr[0], i);
+ printf("The file contains %d entries out of max %ld\n", nr[0], i);
for (j = 1; j < MAXDEPTH; j++)
printf("%d ", nr[j]);
return 0;
-
#endif /* HASHFILE */
#endif /* ttblsz */
case 'v':
- fprintf(stderr, CP[102], version, patchlevel);
+ fprintf(stderr, "gnushogi version %s\n", PACKAGE_VERSION);
exit(1);
case 'X':
/* X interface. */
display_type = DISPLAY_X;
-
+ dsp = &raw_display;
break;
-
case 'x':
argc--;
argv++;
if (argc > 0)
xwin = argv[0];
-
break;
-
default:
- fprintf(stderr, CP[113]);
+ fputs("Usage: gnushogi [-a] [-t] [-c size] [-s savefile][-l listfile] [-x xwndw]\n", stderr);
exit(1);
}
if (argc > 9)
{
- printf("%s\n", CP[220]);
+ printf("Time Control Error\n");
exit(1);
}
XC++;
else
{
- printf("%s\n", CP[220]);
+ printf("Time Control Error\n");
exit(1);
}
* an error message and quit.
*/
- printf("%s\n", CP[233]);
+ printf("Invalid command-line arguments:\n");
print_arglist(argc, argv);
exit(1);
}