home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 8
/
FreshFishVol8-CD1.bin
/
new
/
game
/
think
/
chaos
/
src
/
chaos.h
< prev
next >
Wrap
C/C++ Source or Header
|
1994-11-19
|
14KB
|
534 lines
/* Chaos: The Chess HAppening Organisation System V5.3
Copyright (C) 1993 Jochen Wiedmann
This program 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 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
$RCSfile: Chaos.h,v $
$Revision: 3.3 $
$Date: 1994/11/19 19:32:01 $
This is the include-file of the program. It defines the constants,
structures and prototypes.
Computer: Amiga 1200 Compiler: Dice 2.07.54 (3.0)
Author: Jochen Wiedmann
Am Eisteich 9
72555 Metzingen
Tel. 07123 / 14881
Internet: wiedmann@mailserv.zdv.uni-tuebingen.de
*/
#ifndef CHAOS_H
#define CHAOS_H
#ifndef CHAOS_CAT_CATALOG_H
#include "Chaos_Cat.h"
#endif
#ifdef AMIGA
#ifndef EXEC_LISTS_H
#include <exec/lists.h>
#endif
#ifndef EXEC_MEMORY_H
#include <exec/memory.h>
#endif
#ifndef EXEC_INTERRUPTS_H
#include <exec/interrupts.h>
#endif
#ifndef DOS_DOS_H
#include <dos/dos.h>
#endif
#ifndef DOS_EXALL_H
#include <dos/exall.h>
#endif
#ifndef INTUITION_INTUITION_H
#include <intuition/intuition.h>
#endif
#ifndef LIBRARIES_IFFPARSE_H
#include <libraries/iffparse.h>
#endif
#ifndef MUI_H
#include <libraries/mui.h>
#endif
#ifndef CLIB_EXEC_PROTOS_H
#include <clib/exec_protos.h>
#endif
#ifndef CLIB_DOS_PROTOS_H
#include <clib/dos_protos.h>
#endif
#ifndef CLIB_INTUITION_PROTOS_H
#include <clib/intuition_protos.h>
#endif
#ifndef CLIB_MUIMASTER_PROTOS_H
#include <clib/muimaster_protos.h>
#endif
#ifndef CLIB_ALIB_PROTOS_H
#include <clib/alib_protos.h>
#endif
#ifndef CLIB_UTILITY_PROTOS_H
#include <clib/utility_protos.h>
#endif
#ifndef CLIB_IFFPARSE_PROTOS_H
#include <clib/iffparse_protos.h>
#endif
#ifdef AZTEC_C
#ifndef PRAGMAS_EXEC_LIB_H
#include <pragmas/exec_lib.h>
#endif
#ifndef PRAGMAS_DOS_LIB_H
#include <pragmas/dos_lib.h>
#endif
#ifndef PRAGMAS_INTUITION_LIB_H
#include <pragmas/intuition_lib.h>
#endif
#ifndef PRAGMAS_MUIMASTER_LIB_H
#include <pragmas/muimaster_lib.h>
#endif
#ifndef PRAGMAS_UTILITY_LIB_H
#include <pragmas/utility_lib.h>
#endif
#ifndef PRAGMAS_IFFPARSE_LIB_H
#include <pragmas/iffparse_lib.h>
#endif
#endif /* AZTEC_C */
#if defined(_DCC) || defined(__SASC) || defined(__MAXON__)
#ifndef PRAGMAS_EXEC_PRAGMAS_H
#include <pragmas/exec_pragmas.h>
#endif
#ifndef PRAGMAS_DOS_PRAGMAS_H
#include <pragmas/dos_pragmas.h>
#endif
#ifndef PRAGMAS_INTUITION_PRAGMAS_H
#include <pragmas/intuition_pragmas.h>
#endif
#ifndef PRAGMAS_MUIMASTER_PRAGMAS_H
#include <pragmas/muimaster_pragmas.h>
#endif
#ifndef PRAGMAS_UTILITY_PRAGMAS_H
#include <pragmas/utility_pragmas.h>
#endif
#ifndef PRAGMAS_IFFPARSE_PRAGMAS_H
#include <pragmas/iffparse_pragmas.h>
#endif
#endif /* _DCC || __SASC || __MAXON__ */
#ifdef __GNUC__
#ifndef _INLINE_EXEC_H
#include <inline/exec.h>
#endif
#ifndef _INLINE_DOS_H
#include <inline/dos.h>
#endif
#ifndef _INLINE_INTUITION_H
#include <inline/intuition.h>
#endif
#ifndef _INLINE_MUIMASTER_H
#include <inline/muimaster.h>
#endif
#ifndef _INLINE_UTILITY_H
#include <inline/utility.h>
#endif
#ifndef _INLINE_IFFPARSE_H
#include <inline/iffparse.h>
#endif
#endif /* !__GNUC__ */
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <time.h>
#else /* !AMIGA */
#include <stdio.h>
#include <NonAmiga.h>
#endif /* AMIGA */
#define TRNFILENAME_LEN 512
#define TRNNAME_LEN 60
#define TNMODEB_SWISS_PAIRING 0
#define TNMODEB_ROUND_ROBIN 1
#define TNMODEB_BUCHHOLZ 2
#define TNMODEB_EXT_BUCHHOLZ 3
#define TNMODEB_SONNEBORN_BERGER 4
#define TNMODEB_SHIFT_SYSTEM 5
#define TNMODEF_SWISS_PAIRING (1 << TNMODEB_SWISS_PAIRING)
#define TNMODEF_ROUND_ROBIN (1 << TNMODEB_ROUND_ROBIN)
#define TNMODEF_BUCHHOLZ (1 << TNMODEB_BUCHHOLZ)
#define TNMODEF_EXT_BUCHHOLZ (1 << TNMODEB_EXT_BUCHHOLZ)
#define TNMODEF_SONNEBORN_BERGER (1 << TNMODEB_SONNEBORN_BERGER)
#define TNMODE_TABMASK (TNMODEF_BUCHHOLZ|TNMODEF_EXT_BUCHHOLZ| \
TNMODEF_SONNEBORN_BERGER)
#define TNMODEF_SHIFT_SYSTEM (1 << TNMODEB_SHIFT_SYSTEM)
#define SwissPairingTournament (TrnMode & TNMODEF_SWISS_PAIRING)
#define RoundRobinTournament (TrnMode & TNMODEF_ROUND_ROBIN)
/*
The struct Player holds all data of one participant.
*/
#define NAMELEN 30
#define BIRTHDAYLEN 10
#define PHONENRLEN 20
#define DWZLEN 10
struct Player
{ struct Node Tn_Node; /* This is used to build the alpha-
betically sorted list of players. */
struct Player *LT_Succ; /* An internal list is builded when */
struct Player *LT_Pred; /* pairing the games. These fields */
/* are used for it. */
struct Player *RankNext; /* Next in list of internal rankings */
struct Player *Opponent; /* Used for pairings */
struct Player *Helpptr; /* Used for different things */
struct Game *First_Game; /* List of games */
int Flags; /* See below */
short Nr; /* Used for pairings */
short GFlags, BoardNr; /* Used for pairings */
short Points, Buchholz; /* Points, Buchholzpoints and extended */
long ExtBuchholz; /* Buchholzpoints */
short HowMuchWhite; /* < 0 = Black; > 0 = White */
short HowMuchWhiteLast; /* < 0 = Black; > 0 = White */
short ELO; /* International ELO number */
char DWZ[DWZLEN+1]; /* German rating number */
char Name[NAMELEN+1]; /* Name and prename */
char Street[NAMELEN+1]; /* address */
char Village[NAMELEN+1];
char PhoneNr[PHONENRLEN+1];
char ChessClub[NAMELEN+1]; /* Schachclub des Teilnehmers */
char BirthDay[BIRTHDAYLEN+1]; /* Geburtsdatum des Teilnehmers */
};
/*
Possible Flags in the player structure
*/
#define TNFLAGSB_SENIOR 31
#define TNFLAGSB_JUNIOR 30
#define TNFLAGSB_WOMAN 29
#define TNFLAGSB_JUNIORA 28
#define TNFLAGSB_JUNIORB 27
#define TNFLAGSB_JUNIORC 26
#define TNFLAGSB_JUNIORD 25
#define TNFLAGSB_JUNIORE 24
#define TNFLAGSB_WITHDRAWN 0 /* Player has withdrawn */
#define TNFLAGSB_HADFREE 1 /* Player had a free round */
#define TNFLAGSB_NOTDOWN 2 /* Internally used for pairings */
#define TNFLAGSB_SELECTED 3 /* Internally used for player selections */
#define TNFLAGSF_SENIOR (1 << TNFLAGSB_SENIOR)
#define TNFLAGSF_JUNIOR (1 << TNFLAGSB_JUNIOR)
#define TNFLAGSF_WOMAN (1 << TNFLAGSB_WOMAN)
#define TNFLAGSF_JUNIORA (1 << TNFLAGSB_JUNIORA)
#define TNFLAGSF_JUNIORB (1 << TNFLAGSB_JUNIORB)
#define TNFLAGSF_JUNIORC (1 << TNFLAGSB_JUNIORC)
#define TNFLAGSF_JUNIORD (1 << TNFLAGSB_JUNIORD)
#define TNFLAGSF_JUNIORE (1 << TNFLAGSB_JUNIORE)
#define TNFLAGSF_WITHDRAWN (1 << TNFLAGSB_WITHDRAWN)
#define TNFLAGSF_HADFREE (1 << TNFLAGSB_HADFREE)
#define TNFLAGSF_NOTDOWN (1 << TNFLAGSB_NOTDOWN)
#define TNFLAGSF_SELECTED (1 << TNFLAGSB_SELECTED)
/*
The Game structure holds all data of one game. The games of one
participant build a linked list. Each game is therefore represented
by two game structures: One in the white players list and one in the
black players list.
*/
struct Game
{ struct Game *Next; /* Pointer to next game */
struct Player *Opponent; /* Pointer to Opponent */
short BoardNr; /* Board number */
short Result; /* Result (-1 = Result is missing) */
short Flags; /* See below */
};
/*
Possible flags in the game structure
*/
#define GMFLAGSB_NOFIGHT 0
#define GMFLAGSB_POINTFORFREE 1
#define GMFLAGSB_WITHDRAWN 2
#define GMFLAGSB_WHITE 3
#define GMFLAGSF_NOFIGHT (1 << GMFLAGSB_NOFIGHT)
#define GMFLAGSF_POINTFORFREE (1 << GMFLAGSB_POINTFORFREE)
#define GMFLAGSF_WITHDRAWN (1 << GMFL