/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 *
 * This file is part of SanKit -- A multiplatform set of C code
 * for reading and writing PGN formatted chess games. In addition
 * it can be used as an engine to determine in real time if proposed
 * moves are legal or not. It appears to generate near perfect PGN
 * from incorrectly formatted files.
 *
 * Copyright 1994 Steven J. Edwards All Rights Reserved.
 * Copyright 2009-2011 David Hoerl All Rights Reserved.
 *
 *
 * Redistribution and use in source and binary forms, with or without modification, are
 * permitted provided that the following conditions are met:
 *
 *    1. Redistributions of source code must retain the above copyright notice, this list of
 *       conditions and the following disclaimer.
 *
 *    2. Redistributions in binary form must reproduce the above copyright notice, this list
 *       of conditions and the following disclaimer in the documentation and/or other materials
 *       provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY David Hoerl ''AS IS'' AND ANY EXPRESS OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL David Hoerl OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

/*>>> sanvar.c: declarations for SAN variables */

/* Revised: 1993.09.04 */

#include <stdio.h>

#include "sandef.h"

/* program identification and control */

charptrT progname;
siT progdone;

/* the nil string */

charptrT nilstr;

/* ASCII character vectors */

char accv[cL];
char acpv[pL];
char acrv[rankL];
char acfv[fileL];

/* conversion vectors */

cT cv_c_cpv[cpL];
pT cv_p_cpv[cpL];
cpT cv_cp_cpv[rcL][pL];

/* special case promotion piece conversion */

pT cv_p_scmvv[scmvL];

/* color inversion */

cT inv_cv[rcL];

/* game termination strings */

charptrT gtcstrv[gtcL];

/* game termination input marker strings */

charptrT gtimstrv[gtimL];

/* game status conversions */

gtcT cv_gtc_gsv[gsL];

/* game termination input marker converstion */

gtcT cv_gtc_gtimv[gtimL];

/* dribble output file */

FILEptrT do_fptr;
FILEptrT st_fptr;

siT gameCount;
long fileOffset;
char parseError[80];

/* direction vectors */

dvT dvv[dxL];
xdvT xdvv[dxL];

/* global boards */

bT gb;
xbT gxb;

/* search strategy names */

charptrT ssstrv[ssL];

/* piece values */

cpevT valpv[pL];
cpevT valcpv[cpL];

/* position setup flag */

siT setup;

/* game termination code */

gtcT gtc;

/* piece locations and counts */

sqT plv[rcL][pmaxL];
siT plnv[rcL];

/* attackers: bitfield merge and count */

siT atkcsqv[rcL][sqL];

/* board indices for piece location vector */

siT biv[sqL];

/* history record count */

siT hn;

/* history stack base and current pointers */

hptrT hbase, hcurr;

/* current environment record */

eT curr_e;

/* current generation record */

gT curr_g;

/* count of records in analysis stack (also, the current ply) */

siT an;

/* analysis stack */

aT av[aL];

/* base of tree leg storage */

mptrT Tree;

/* head and tail of tag list */

tagptrT head_tagptr, tail_tagptr;

/* default reserved tag names */

charptrT rsvtagv[rsvtagL];

/* program option vectors: values, names, and helps */

siT optnv[optnL];
charptrT optnnamev[optnL];
charptrT optnhelpv[optnL];

/* command token vector */

siT tkn;
charptrT tkv[tkL];

/* scratch text vector */

char stv[tL];

/* command information vector */

ciT civ[cmdL];

/* search strategies */

ssT ssv[rcL];

/* material */

cpevT cpmv[rcL];

/* playing level */

siT level;

/* average response time */

secT artsec;

/* previous state information for play/unplay strategy transition */

eT prev_e;
mT prev_m;
bT prev_b;

/* the null move */

mT null_m;

/* strategy move selection result */

mT select_m;

/*<<< sanvar.c: EOF */
