Scid  4.7.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Macros | Typedefs | Enumerations | Functions | Variables
common.h File Reference
#include <cstddef>
#include <stdint.h>
#include "error.h"
#include <assert.h>
Include dependency graph for common.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define BBUF_SIZE   256000
 
#define ASSERT(f)   assert(f)
 
#define BIT_7(x)   ((x) & 128)
 
#define BIT_6(x)   ((x) & 64)
 
#define BIT_5(x)   ((x) & 32)
 
#define BIT_4(x)   ((x) & 16)
 
#define BIT_3(x)   ((x) & 8)
 
#define BIT_2(x)   ((x) & 4)
 
#define BIT_1(x)   ((x) & 2)
 
#define BIT_0(x)   ((x) & 1)
 
#define UPPER_4_BITS(x)   (((x) & 240) >> 4)
 
#define LOWER_4_BITS(x)   ((x) & 15)
 
#define UPPER_12_BITS(x)   (((x) & (4096 * 4095)) >> 12)
 
#define LOWER_12_BITS(x)   ((x) & 4095)
 

Typedefs

typedef unsigned short versionT
 
typedef unsigned char byte
 
typedef uint16_t ushort
 
typedef uint32_t uint
 
typedef int32_t sint
 
typedef signed int compareT
 
typedef byte pieceT
 
typedef byte colorT
 
typedef byte squareT
 
typedef byte directionT
 
typedef byte rankT
 
typedef byte fyleT
 
typedef byte leftDiagT
 
typedef byte rightDiagT
 
typedef pieceT boardT[66]
 
typedef byte smallBoardT[32]
 
typedef byte castleDirT
 
typedef ushort statusT
 
typedef char sanStringT[10]
 
typedef char fileNameT[512]
 
typedef uint fileLengthT
 
typedef uint dateT
 
typedef uint32_t idNumberT
 
typedef unsigned nameT
 
typedef uint gamenumT
 
typedef ushort eloT
 
typedef ushort ecoT
 
typedef char ecoStringT[6]
 
typedef byte resultT
 

Enumerations

enum  fileModeT {
  FMODE_None = 0, FMODE_ReadOnly, FMODE_WriteOnly, FMODE_Both,
  FMODE_Create, FMODE_Memory
}
 
enum  {
  NAME_PLAYER, NAME_EVENT, NAME_SITE, NAME_ROUND,
  NUM_NAME_TYPES, NAME_INVALID = 99
}
 

Functions

colorT color_Flip (colorT c)
 
char color_Char (colorT c)
 
colorT piece_Color (pieceT p)
 
colorT piece_Color_NotEmpty (pieceT p)
 
pieceT piece_Type (pieceT p)
 
pieceT piece_Make (colorT c, pieceT p)
 
bool piece_IsWhite (pieceT p)
 
bool piece_IsBlack (pieceT p)
 
bool piece_IsKing (pieceT p)
 
bool piece_IsQueen (pieceT p)
 
bool piece_IsRook (pieceT p)
 
bool piece_IsBishop (pieceT p)
 
bool piece_IsKnight (pieceT p)
 
bool piece_IsPawn (pieceT p)
 
bool piece_IsSlider (pieceT p)
 
char piece_Char (pieceT p)
 
pieceT piece_FromChar (int x)
 
int piece_Value (pieceT p)
 
rankT rank_FromChar (char c)
 
fyleT fyle_FromChar (char c)
 
squareT square_Make (fyleT f, rankT r)
 
fyleT square_Fyle (squareT sq)
 
rankT square_Rank (squareT sq)
 
leftDiagT square_LeftDiag (squareT sq)
 
rightDiagT square_RightDiag (squareT sq)
 
colorT square_Color (squareT sq)
 
squareT square_FlipFyle (squareT sq)
 
squareT square_FlipRank (squareT sq)
 
squareT square_FlipDiag (squareT sq)
 
uint square_Distance (squareT from, squareT to)
 
squareT square_NearestCorner (squareT sq)
 
bool square_IsCornerSquare (squareT sq)
 
bool square_IsEdgeSquare (squareT sq)
 
int square_EdgeDistance (squareT sq)
 
bool square_IsKnightHop (squareT from, squareT to)
 
char square_FyleChar (squareT sq)
 
char square_RankChar (squareT sq)
 
void square_Print (squareT sq, char *str)
 
directionT direction_Opposite (directionT d)
 
bool direction_IsDiagonal (directionT dir)
 
int direction_Delta (directionT dir)
 
int board_Compare (const pieceT *b1, const pieceT *b2)
 
bool square_Adjacent (squareT from, squareT to)
 

Variables

const versionT SCID_VERSION = 400
 
const versionT SCID_OLDEST_VERSION = 300
 
const char SCID_VERSION_STRING [] = "4.7.0"
 
const char SCID_WEBSITE [] = "http://scid.sourceforge.net/"
 
const char PGN_SUFFIX [] = ".pgn"
 
const compareT LESS_THAN = -1
 
const compareT EQUAL_TO = 0
 
const compareT GREATER_THAN = 1
 
const ecoT ECO_None = 0
 
const byte RATING_Elo = 0
 
const byte RATING_Rating = 1
 
const byte RATING_Rapid = 2
 
const byte RATING_ICCF = 3
 
const byte RATING_USCF = 4
 
const byte RATING_DWZ = 5
 
const byte RATING_BCF = 6
 
const char * ratingTypeNames [17]
 
const uint NUM_RESULT_TYPES = 4
 
const resultT RESULT_None = 0
 
const resultT RESULT_White = 1
 
const resultT RESULT_Black = 2
 
const resultT RESULT_Draw = 3
 
const uint RESULT_SCORE [4] = { 1, 2, 0, 1 }
 
const char RESULT_CHAR [4] = { '*', '1', '0', '=' }
 
const char RESULT_STR [4][4] = { "*", "1-0", "0-1", "=-=" }
 
const char RESULT_LONGSTR [4][8] = { "*", "1-0", "0-1", "1/2-1/2" }
 
const resultT RESULT_OPPOSITE [4]
 
const uint NUM_COLOR_TYPES = 2
 
const colorT WHITE = 0
 
const colorT BLACK = 1
 
const colorT NOCOLOR = 2
 
const char COLOR_CHAR [3] = {'W', 'B', '_' }
 
const castleDirT QSIDE = 0
 
const castleDirT KSIDE = 1
 
const pieceT INVALID_PIECE = 0
 
const pieceT KING = 1
 
const pieceT QUEEN = 2
 
const pieceT ROOK = 3
 
const pieceT BISHOP = 4
 
const pieceT KNIGHT = 5
 
const pieceT PAWN = 6
 
const pieceT EMPTY = 7
 
const pieceT END_OF_BOARD = 0
 
const pieceT WK = 1
 
const pieceT WQ = 2
 
const pieceT WR = 3
 
const pieceT WB = 4
 
const pieceT WN = 5
 
const pieceT WP = 6
 
const pieceT BK = 9
 
const pieceT BQ = 10
 
const pieceT BR = 11
 
const pieceT BB = 12
 
const pieceT BN = 13
 
const pieceT BP = 14
 
const pieceT WM = 16
 
const pieceT BM = 17
 
const uint MAX_PIECE_TYPES = 18
 
const char PIECE_CHAR [] = "xKQRBNP.xkqrbnpxMm"
 
const pieceT PIECE_FLIP [MAX_PIECE_TYPES]
 
const bool PIECE_IS_SLIDER [8]
 
const int PIECE_VALUE [MAX_PIECE_TYPES]
 
const squareT A1 = 0
 
const squareT B1 = 1
 
const squareT C1 = 2
 
const squareT D1 = 3
 
const squareT E1 = 4
 
const squareT F1 = 5
 
const squareT G1 = 6
 
const squareT H1 = 7
 
const squareT A2 = 8
 
const squareT B2 = 9
 
const squareT C2 =10
 
const squareT D2 =11
 
const squareT E2 =12
 
const squareT F2 =13
 
const squareT G2 =14
 
const squareT H2 =15
 
const squareT A3 =16
 
const squareT B3 =17
 
const squareT C3 =18
 
const squareT D3 =19
 
const squareT E3 =20
 
const squareT F3 =21
 
const squareT G3 =22
 
const squareT H3 =23
 
const squareT A4 =24
 
const squareT B4 =25
 
const squareT C4 =26
 
const squareT D4 =27
 
const squareT E4 =28
 
const squareT F4 =29
 
const squareT G4 =30
 
const squareT H4 =31
 
const squareT A5 =32
 
const squareT B5 =33
 
const squareT C5 =34
 
const squareT D5 =35
 
const squareT E5 =36
 
const squareT F5 =37
 
const squareT G5 =38
 
const squareT H5 =39
 
const squareT A6 =40
 
const squareT B6 =41
 
const squareT C6 =42
 
const squareT D6 =43
 
const squareT E6 =44
 
const squareT F6 =45
 
const squareT G6 =46
 
const squareT H6 =47
 
const squareT A7 =48
 
const squareT B7 =49
 
const squareT C7 =50
 
const squareT D7 =51
 
const squareT E7 =52
 
const squareT F7 =53
 
const squareT G7 =54
 
const squareT H7 =55
 
const squareT A8 =56
 
const squareT B8 =57
 
const squareT C8 =58
 
const squareT D8 =59
 
const squareT E8 =60
 
const squareT F8 =61
 
const squareT G8 =62
 
const squareT H8 =63
 
const squareT COLOR_SQUARE = 64
 
const squareT NULL_SQUARE = 65
 
const squareT NS = 65
 
const rankT RANK_1 = 0
 
const rankT RANK_2 = 1
 
const rankT RANK_3 = 2
 
const rankT RANK_4 = 3
 
const rankT RANK_5 = 4
 
const rankT RANK_6 = 5
 
const rankT RANK_7 = 6
 
const rankT RANK_8 = 7
 
const rankT NO_RANK = 64
 
const fyleT A_FYLE = 0
 
const fyleT B_FYLE = 1
 
const fyleT C_FYLE = 2
 
const fyleT D_FYLE = 3
 
const fyleT E_FYLE = 4
 
const fyleT F_FYLE = 5
 
const fyleT G_FYLE = 6
 
const fyleT H_FYLE = 7
 
const fyleT NO_FYLE = 64
 
const uint rankFyleDist [64]
 
const int edgeDist [66]
 
const directionT NULL_DIR = 0
 
const directionT UP = 1
 
const directionT DOWN = 2
 
const directionT LEFT = 4
 
const directionT RIGHT = 8
 
const directionT UP_LEFT = (UP | LEFT)
 
const directionT UP_RIGHT = (UP | RIGHT)
 
const directionT DOWN_LEFT = (DOWN | LEFT)
 
const directionT DOWN_RIGHT = (DOWN | RIGHT)
 
const directionT dirOpposite [11]
 
const bool dirIsDiagonal [11]
 
const int dirDelta [11]
 
const boardT START_BOARD
 
const colorT BOARD_SQUARECOLOR [66]
 

Macro Definition Documentation

◆ ASSERT

#define ASSERT (   f)    assert(f)

Definition at line 59 of file common.h.

◆ BBUF_SIZE

#define BBUF_SIZE   256000

Definition at line 36 of file common.h.

◆ BIT_0

#define BIT_0 (   x)    ((x) & 1)

Definition at line 71 of file common.h.

◆ BIT_1

#define BIT_1 (   x)    ((x) & 2)

Definition at line 70 of file common.h.

◆ BIT_2

#define BIT_2 (   x)    ((x) & 4)

Definition at line 69 of file common.h.

◆ BIT_3

#define BIT_3 (   x)    ((x) & 8)

Definition at line 68 of file common.h.

◆ BIT_4

#define BIT_4 (   x)    ((x) & 16)

Definition at line 67 of file common.h.

◆ BIT_5

#define BIT_5 (   x)    ((x) & 32)

Definition at line 66 of file common.h.

◆ BIT_6

#define BIT_6 (   x)    ((x) & 64)

Definition at line 65 of file common.h.

◆ BIT_7

#define BIT_7 (   x)    ((x) & 128)

Definition at line 64 of file common.h.

◆ LOWER_12_BITS

#define LOWER_12_BITS (   x)    ((x) & 4095)

Definition at line 81 of file common.h.

◆ LOWER_4_BITS

#define LOWER_4_BITS (   x)    ((x) & 15)

Definition at line 76 of file common.h.

◆ UPPER_12_BITS

#define UPPER_12_BITS (   x)    (((x) & (4096 * 4095)) >> 12)

Definition at line 80 of file common.h.

◆ UPPER_4_BITS

#define UPPER_4_BITS (   x)    (((x) & 240) >> 4)

Definition at line 75 of file common.h.

Typedef Documentation

◆ boardT

typedef pieceT boardT[66]

Definition at line 115 of file common.h.

◆ byte

typedef unsigned char byte

Definition at line 89 of file common.h.

◆ castleDirT

typedef byte castleDirT

Definition at line 121 of file common.h.

◆ colorT

typedef byte colorT

Definition at line 104 of file common.h.

◆ compareT

typedef signed int compareT

Definition at line 97 of file common.h.

◆ dateT

typedef uint dateT

Definition at line 147 of file common.h.

◆ directionT

typedef byte directionT

Definition at line 106 of file common.h.

◆ ecoStringT

typedef char ecoStringT[6]

Definition at line 166 of file common.h.

◆ ecoT

typedef ushort ecoT

Definition at line 165 of file common.h.

◆ eloT

typedef ushort eloT

Definition at line 164 of file common.h.

◆ fileLengthT

typedef uint fileLengthT

Definition at line 134 of file common.h.

◆ fileNameT

typedef char fileNameT[512]

Definition at line 133 of file common.h.

◆ fyleT

typedef byte fyleT

Definition at line 108 of file common.h.

◆ gamenumT

typedef uint gamenumT

Definition at line 163 of file common.h.

◆ idNumberT

typedef uint32_t idNumberT

Definition at line 152 of file common.h.

◆ leftDiagT

typedef byte leftDiagT

Definition at line 109 of file common.h.

◆ nameT

typedef unsigned nameT

Definition at line 153 of file common.h.

◆ pieceT

typedef byte pieceT

Definition at line 103 of file common.h.

◆ rankT

typedef byte rankT

Definition at line 107 of file common.h.

◆ resultT

typedef byte resultT

Definition at line 187 of file common.h.

◆ rightDiagT

typedef byte rightDiagT

Definition at line 110 of file common.h.

◆ sanStringT

typedef char sanStringT[10]

Definition at line 129 of file common.h.

◆ sint

typedef int32_t sint

Definition at line 92 of file common.h.

◆ smallBoardT

typedef byte smallBoardT[32]

Definition at line 117 of file common.h.

◆ squareT

typedef byte squareT

Definition at line 105 of file common.h.

◆ statusT

typedef ushort statusT

Definition at line 125 of file common.h.

◆ uint

typedef uint32_t uint

Definition at line 91 of file common.h.

◆ ushort

typedef uint16_t ushort

Definition at line 90 of file common.h.

◆ versionT

typedef unsigned short versionT

Definition at line 38 of file common.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
NAME_PLAYER 
NAME_EVENT 
NAME_SITE 
NAME_ROUND 
NUM_NAME_TYPES 
NAME_INVALID 

Definition at line 154 of file common.h.

◆ fileModeT

enum fileModeT
Enumerator
FMODE_None 
FMODE_ReadOnly 
FMODE_WriteOnly 
FMODE_Both 
FMODE_Create 
FMODE_Memory 

Definition at line 136 of file common.h.

Function Documentation

◆ board_Compare()

int board_Compare ( const pieceT b1,
const pieceT b2 
)
inline

Definition at line 663 of file common.h.

◆ color_Char()

char color_Char ( colorT  c)
inline

Definition at line 217 of file common.h.

◆ color_Flip()

colorT color_Flip ( colorT  c)
inline

Definition at line 214 of file common.h.

◆ direction_Delta()

int direction_Delta ( directionT  dir)
inline

Definition at line 624 of file common.h.

◆ direction_IsDiagonal()

bool direction_IsDiagonal ( directionT  dir)
inline

Definition at line 600 of file common.h.

◆ direction_Opposite()

directionT direction_Opposite ( directionT  d)
inline

Definition at line 577 of file common.h.

◆ fyle_FromChar()

fyleT fyle_FromChar ( char  c)
inline

Definition at line 373 of file common.h.

◆ piece_Char()

char piece_Char ( pieceT  p)
inline

Definition at line 325 of file common.h.

◆ piece_Color()

colorT piece_Color ( pieceT  p)
inline

Definition at line 285 of file common.h.

◆ piece_Color_NotEmpty()

colorT piece_Color_NotEmpty ( pieceT  p)
inline

Definition at line 289 of file common.h.

◆ piece_FromChar()

pieceT piece_FromChar ( int  x)
inline

Definition at line 328 of file common.h.

◆ piece_IsBishop()

bool piece_IsBishop ( pieceT  p)
inline

Definition at line 313 of file common.h.

◆ piece_IsBlack()

bool piece_IsBlack ( pieceT  p)
inline

Definition at line 301 of file common.h.

◆ piece_IsKing()

bool piece_IsKing ( pieceT  p)
inline

Definition at line 304 of file common.h.

◆ piece_IsKnight()

bool piece_IsKnight ( pieceT  p)
inline

Definition at line 316 of file common.h.

◆ piece_IsPawn()

bool piece_IsPawn ( pieceT  p)
inline

Definition at line 319 of file common.h.

◆ piece_IsQueen()

bool piece_IsQueen ( pieceT  p)
inline

Definition at line 307 of file common.h.

◆ piece_IsRook()

bool piece_IsRook ( pieceT  p)
inline

Definition at line 310 of file common.h.

◆ piece_IsSlider()

bool piece_IsSlider ( pieceT  p)
inline

Definition at line 322 of file common.h.

◆ piece_IsWhite()

bool piece_IsWhite ( pieceT  p)
inline

Definition at line 298 of file common.h.

◆ piece_Make()

pieceT piece_Make ( colorT  c,
pieceT  p 
)
inline

Definition at line 295 of file common.h.

◆ piece_Type()

pieceT piece_Type ( pieceT  p)
inline

Definition at line 292 of file common.h.

◆ piece_Value()

int piece_Value ( pieceT  p)
inline

Definition at line 341 of file common.h.

◆ rank_FromChar()

rankT rank_FromChar ( char  c)
inline

Definition at line 369 of file common.h.

◆ square_Adjacent()

bool square_Adjacent ( squareT  from,
squareT  to 
)
inline

Definition at line 677 of file common.h.

◆ square_Color()

colorT square_Color ( squareT  sq)
inline

Definition at line 410 of file common.h.

◆ square_Distance()

uint square_Distance ( squareT  from,
squareT  to 
)
inline

Definition at line 454 of file common.h.

◆ square_EdgeDistance()

int square_EdgeDistance ( squareT  sq)
inline

Definition at line 503 of file common.h.

◆ square_FlipDiag()

squareT square_FlipDiag ( squareT  sq)
inline

Definition at line 434 of file common.h.

◆ square_FlipFyle()

squareT square_FlipFyle ( squareT  sq)
inline

Definition at line 418 of file common.h.

◆ square_FlipRank()

squareT square_FlipRank ( squareT  sq)
inline

Definition at line 426 of file common.h.

◆ square_Fyle()

fyleT square_Fyle ( squareT  sq)
inline

Definition at line 384 of file common.h.

◆ square_FyleChar()

char square_FyleChar ( squareT  sq)
inline

Definition at line 520 of file common.h.

◆ square_IsCornerSquare()

bool square_IsCornerSquare ( squareT  sq)
inline

Definition at line 475 of file common.h.

◆ square_IsEdgeSquare()

bool square_IsEdgeSquare ( squareT  sq)
inline

Definition at line 481 of file common.h.

◆ square_IsKnightHop()

bool square_IsKnightHop ( squareT  from,
squareT  to 
)
inline

Definition at line 509 of file common.h.

◆ square_LeftDiag()

leftDiagT square_LeftDiag ( squareT  sq)
inline

Definition at line 396 of file common.h.

◆ square_Make()

squareT square_Make ( fyleT  f,
rankT  r 
)
inline

Definition at line 377 of file common.h.

◆ square_NearestCorner()

squareT square_NearestCorner ( squareT  sq)
inline

Definition at line 465 of file common.h.

◆ square_Print()

void square_Print ( squareT  sq,
char *  str 
)
inline

Definition at line 532 of file common.h.

◆ square_Rank()

rankT square_Rank ( squareT  sq)
inline

Definition at line 390 of file common.h.

◆ square_RankChar()

char square_RankChar ( squareT  sq)
inline

Definition at line 526 of file common.h.

◆ square_RightDiag()

rightDiagT square_RightDiag ( squareT  sq)
inline

Definition at line 402 of file common.h.

Variable Documentation

◆ A1

const squareT A1 = 0

Definition at line 348 of file common.h.

◆ A2

const squareT A2 = 8

Definition at line 349 of file common.h.

◆ A3

const squareT A3 =16

Definition at line 350 of file common.h.

◆ A4

const squareT A4 =24

Definition at line 351 of file common.h.

◆ A5

const squareT A5 =32

Definition at line 352 of file common.h.

◆ A6

const squareT A6 =40

Definition at line 353 of file common.h.

◆ A7

const squareT A7 =48

Definition at line 354 of file common.h.

◆ A8

const squareT A8 =56

Definition at line 355 of file common.h.

◆ A_FYLE

const fyleT A_FYLE = 0

Definition at line 365 of file common.h.

◆ B1

const squareT B1 = 1

Definition at line 348 of file common.h.

◆ B2

const squareT B2 = 9

Definition at line 349 of file common.h.

◆ B3

const squareT B3 =17

Definition at line 350 of file common.h.

◆ B4

const squareT B4 =25

Definition at line 351 of file common.h.

◆ B5

const squareT B5 =33

Definition at line 352 of file common.h.

◆ B6

const squareT B6 =41

Definition at line 353 of file common.h.

◆ B7

const squareT B7 =49

Definition at line 354 of file common.h.

◆ B8

const squareT B8 =57

Definition at line 355 of file common.h.

◆ B_FYLE

const fyleT B_FYLE = 1

Definition at line 365 of file common.h.

◆ BB

const pieceT BB = 12

Definition at line 242 of file common.h.

◆ BISHOP

const pieceT BISHOP = 4

Definition at line 229 of file common.h.

◆ BK

const pieceT BK = 9

Definition at line 242 of file common.h.

◆ BLACK

const colorT BLACK = 1

Definition at line 208 of file common.h.

◆ BM

const pieceT BM = 17

Definition at line 245 of file common.h.

◆ BN

const pieceT BN = 13

Definition at line 242 of file common.h.

◆ BOARD_SQUARECOLOR

const colorT BOARD_SQUARECOLOR[66]
Initial value:

Definition at line 650 of file common.h.

◆ BP

const pieceT BP = 14

Definition at line 242 of file common.h.

◆ BQ

const pieceT BQ = 10

Definition at line 242 of file common.h.

◆ BR

const pieceT BR = 11

Definition at line 242 of file common.h.

◆ C1

const squareT C1 = 2

Definition at line 348 of file common.h.

◆ C2

const squareT C2 =10

Definition at line 349 of file common.h.

◆ C3

const squareT C3 =18

Definition at line 350 of file common.h.

◆ C4

const squareT C4 =26

Definition at line 351 of file common.h.

◆ C5

const squareT C5 =34

Definition at line 352 of file common.h.

◆ C6

const squareT C6 =42

Definition at line 353 of file common.h.

◆ C7

const squareT C7 =50

Definition at line 354 of file common.h.

◆ C8

const squareT C8 =58

Definition at line 355 of file common.h.

◆ C_FYLE

const fyleT C_FYLE = 2

Definition at line 365 of file common.h.

◆ COLOR_CHAR

const char COLOR_CHAR[3] = {'W', 'B', '_' }

Definition at line 211 of file common.h.

◆ COLOR_SQUARE

const squareT COLOR_SQUARE = 64

Definition at line 356 of file common.h.

◆ D1

const squareT D1 = 3

Definition at line 348 of file common.h.

◆ D2

const squareT D2 =11

Definition at line 349 of file common.h.

◆ D3

const squareT D3 =19

Definition at line 350 of file common.h.

◆ D4

const squareT D4 =27

Definition at line 351 of file common.h.

◆ D5

const squareT D5 =35

Definition at line 352 of file common.h.

◆ D6

const squareT D6 =43

Definition at line 353 of file common.h.

◆ D7

const squareT D7 =51

Definition at line 354 of file common.h.

◆ D8

const squareT D8 =59

Definition at line 355 of file common.h.

◆ D_FYLE

const fyleT D_FYLE = 3

Definition at line 365 of file common.h.

◆ dirDelta

const int dirDelta[11]
Initial value:
= {
0,
8,
-8,
0,
-1,
7,
-9,
0,
1,
9,
-7
}

Definition at line 609 of file common.h.

◆ dirIsDiagonal

const bool dirIsDiagonal[11]
Initial value:
= {
false,
false,
false,
false,
false,
true,
true,
false,
false,
true,
true
}

Definition at line 585 of file common.h.

◆ dirOpposite

const directionT dirOpposite[11]
Initial value:
= {
DOWN,
UP,
LEFT,
}
const directionT UP
Definition: common.h:552
const directionT LEFT
Definition: common.h:554
const directionT UP_LEFT
Definition: common.h:556
const directionT RIGHT
Definition: common.h:555
const directionT UP_RIGHT
Definition: common.h:557
const directionT NULL_DIR
Definition: common.h:551
const directionT DOWN
Definition: common.h:553
const directionT DOWN_RIGHT
Definition: common.h:559
const directionT DOWN_LEFT
Definition: common.h:558

Definition at line 561 of file common.h.

◆ DOWN

const directionT DOWN = 2

Definition at line 553 of file common.h.

◆ DOWN_LEFT

const directionT DOWN_LEFT = (DOWN | LEFT)

Definition at line 558 of file common.h.

◆ DOWN_RIGHT

const directionT DOWN_RIGHT = (DOWN | RIGHT)

Definition at line 559 of file common.h.

◆ E1

const squareT E1 = 4

Definition at line 348 of file common.h.

◆ E2

const squareT E2 =12

Definition at line 349 of file common.h.

◆ E3

const squareT E3 =20

Definition at line 350 of file common.h.

◆ E4

const squareT E4 =28

Definition at line 351 of file common.h.

◆ E5

const squareT E5 =36

Definition at line 352 of file common.h.

◆ E6

const squareT E6 =44

Definition at line 353 of file common.h.

◆ E7

const squareT E7 =52

Definition at line 354 of file common.h.

◆ E8

const squareT E8 =60

Definition at line 355 of file common.h.

◆ E_FYLE

const fyleT E_FYLE = 4

Definition at line 365 of file common.h.

◆ ECO_None

const ecoT ECO_None = 0

Definition at line 168 of file common.h.

◆ edgeDist

const int edgeDist[66]
Initial value:
= {
0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 1, 1, 1, 1, 1, 0,
0, 1, 2, 2, 2, 2, 1, 0,
0, 1, 2, 3, 3, 2, 1, 0,
0, 1, 2, 3, 3, 2, 1, 0,
0, 1, 2, 2, 2, 2, 1, 0,
0, 1, 1, 1, 1, 1, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0,
-1, -1
}

Definition at line 490 of file common.h.

◆ EMPTY

const pieceT EMPTY = 7

Definition at line 239 of file common.h.

◆ END_OF_BOARD

const pieceT END_OF_BOARD = 0

Definition at line 240 of file common.h.

◆ EQUAL_TO

const compareT EQUAL_TO = 0

Definition at line 99 of file common.h.

◆ F1

const squareT F1 = 5

Definition at line 348 of file common.h.

◆ F2

const squareT F2 =13

Definition at line 349 of file common.h.

◆ F3

const squareT F3 =21

Definition at line 350 of file common.h.

◆ F4

const squareT F4 =29

Definition at line 351 of file common.h.

◆ F5

const squareT F5 =37

Definition at line 352 of file common.h.

◆ F6

const squareT F6 =45

Definition at line 353 of file common.h.

◆ F7

const squareT F7 =53

Definition at line 354 of file common.h.

◆ F8

const squareT F8 =61

Definition at line 355 of file common.h.

◆ F_FYLE

const fyleT F_FYLE = 5

Definition at line 365 of file common.h.

◆ G1

const squareT G1 = 6

Definition at line 348 of file common.h.

◆ G2

const squareT G2 =14

Definition at line 349 of file common.h.

◆ G3

const squareT G3 =22

Definition at line 350 of file common.h.

◆ G4

const squareT G4 =30

Definition at line 351 of file common.h.

◆ G5

const squareT G5 =38

Definition at line 352 of file common.h.

◆ G6

const squareT G6 =46

Definition at line 353 of file common.h.

◆ G7

const squareT G7 =54

Definition at line 354 of file common.h.

◆ G8

const squareT G8 =62

Definition at line 355 of file common.h.

◆ G_FYLE

const fyleT G_FYLE = 6

Definition at line 366 of file common.h.

◆ GREATER_THAN

const compareT GREATER_THAN = 1

Definition at line 99 of file common.h.

◆ H1

const squareT H1 = 7

Definition at line 348 of file common.h.

◆ H2

const squareT H2 =15

Definition at line 349 of file common.h.

◆ H3

const squareT H3 =23

Definition at line 350 of file common.h.

◆ H4

const squareT H4 =31

Definition at line 351 of file common.h.

◆ H5

const squareT H5 =39

Definition at line 352 of file common.h.

◆ H6

const squareT H6 =47

Definition at line 353 of file common.h.

◆ H7

const squareT H7 =55

Definition at line 354 of file common.h.

◆ H8

const squareT H8 =63

Definition at line 355 of file common.h.

◆ H_FYLE

const fyleT H_FYLE = 7

Definition at line 366 of file common.h.

◆ INVALID_PIECE

const pieceT INVALID_PIECE = 0

Definition at line 225 of file common.h.

◆ KING

const pieceT KING = 1

Definition at line 226 of file common.h.

◆ KNIGHT

const pieceT KNIGHT = 5

Definition at line 230 of file common.h.

◆ KSIDE

const castleDirT KSIDE = 1

Definition at line 219 of file common.h.

◆ LEFT

const directionT LEFT = 4

Definition at line 554 of file common.h.

◆ LESS_THAN

const compareT LESS_THAN = -1

Definition at line 99 of file common.h.

◆ MAX_PIECE_TYPES

const uint MAX_PIECE_TYPES = 18

Definition at line 247 of file common.h.

◆ NO_FYLE

const fyleT NO_FYLE = 64

Definition at line 366 of file common.h.

◆ NO_RANK

const rankT NO_RANK = 64

Definition at line 361 of file common.h.

◆ NOCOLOR

const colorT NOCOLOR = 2

Definition at line 209 of file common.h.

◆ NS

const squareT NS = 65

Definition at line 357 of file common.h.

◆ NULL_DIR

const directionT NULL_DIR = 0

Definition at line 551 of file common.h.

◆ NULL_SQUARE

const squareT NULL_SQUARE = 65

Definition at line 357 of file common.h.

◆ NUM_COLOR_TYPES

const uint NUM_COLOR_TYPES = 2

Definition at line 205 of file common.h.

◆ NUM_RESULT_TYPES

const uint NUM_RESULT_TYPES = 4

Definition at line 186 of file common.h.

◆ PAWN

const pieceT PAWN = 6

Definition at line 231 of file common.h.

◆ PGN_SUFFIX

const char PGN_SUFFIX[] = ".pgn"

Definition at line 49 of file common.h.

◆ PIECE_CHAR

const char PIECE_CHAR[] = "xKQRBNP.xkqrbnpxMm"

Definition at line 252 of file common.h.

◆ PIECE_FLIP

const pieceT PIECE_FLIP[MAX_PIECE_TYPES]
Initial value:
= {
BK, BQ, BR, BB, BN, BP,
WK, WQ, WR, WB, WN, WP,
}
const pieceT WK
Definition: common.h:241
const pieceT BB
Definition: common.h:242
const pieceT BK
Definition: common.h:242
const pieceT BN
Definition: common.h:242
const pieceT BQ
Definition: common.h:242
const pieceT WQ
Definition: common.h:241
const pieceT BP
Definition: common.h:242
const pieceT EMPTY
Definition: common.h:239
const pieceT WB
Definition: common.h:241
const pieceT WM
Definition: common.h:245
const pieceT WP
Definition: common.h:241
const pieceT END_OF_BOARD
Definition: common.h:240
const pieceT BR
Definition: common.h:242
const pieceT WN
Definition: common.h:241
const pieceT BM
Definition: common.h:245
const pieceT WR
Definition: common.h:241

Definition at line 256 of file common.h.

◆ PIECE_IS_SLIDER

const bool PIECE_IS_SLIDER[8]
Initial value:
= {
false,
false, true, true, true, false, false,
false,
}

Definition at line 264 of file common.h.

◆ PIECE_VALUE

const int PIECE_VALUE[MAX_PIECE_TYPES]
Initial value:
= {
0,
100, 9, 5, 3, 3, 1,
0, 0,
-100, -9, -5, -3, -3, -1,
0, 3, -3
}

Definition at line 272 of file common.h.

◆ QSIDE

const castleDirT QSIDE = 0

Definition at line 219 of file common.h.

◆ QUEEN

const pieceT QUEEN = 2

Definition at line 227 of file common.h.

◆ RANK_1

const rankT RANK_1 = 0

Definition at line 360 of file common.h.

◆ RANK_2

const rankT RANK_2 = 1

Definition at line 360 of file common.h.

◆ RANK_3

const rankT RANK_3 = 2

Definition at line 360 of file common.h.

◆ RANK_4

const rankT RANK_4 = 3

Definition at line 360 of file common.h.

◆ RANK_5

const rankT RANK_5 = 4

Definition at line 360 of file common.h.

◆ RANK_6

const rankT RANK_6 = 5

Definition at line 360 of file common.h.

◆ RANK_7

const rankT RANK_7 = 6

Definition at line 361 of file common.h.

◆ RANK_8

const rankT RANK_8 = 7

Definition at line 361 of file common.h.

◆ rankFyleDist

const uint rankFyleDist[64]
Initial value:
= {
0, 1, 2, 3, 4, 5, 6, 7,
1, 0, 1, 2, 3, 4, 5, 6,
2, 1, 0, 1, 2, 3, 4, 5,
3, 2, 1, 0, 1, 2, 3, 4,
4, 3, 2, 1, 0, 1, 2, 3,
5, 4, 3, 2, 1, 0, 1, 2,
6, 5, 4, 3, 2, 1, 0, 1,
7, 6, 5, 4, 3, 2, 1, 0
}

Definition at line 440 of file common.h.

◆ RATING_BCF

const byte RATING_BCF = 6

Definition at line 178 of file common.h.

◆ RATING_DWZ

const byte RATING_DWZ = 5

Definition at line 177 of file common.h.

◆ RATING_Elo

const byte RATING_Elo = 0

Definition at line 172 of file common.h.

◆ RATING_ICCF

const byte RATING_ICCF = 3

Definition at line 175 of file common.h.

◆ RATING_Rapid

const byte RATING_Rapid = 2

Definition at line 174 of file common.h.

◆ RATING_Rating

const byte RATING_Rating = 1

Definition at line 173 of file common.h.

◆ RATING_USCF

const byte RATING_USCF = 4

Definition at line 176 of file common.h.

◆ ratingTypeNames

const char* ratingTypeNames[17]

Definition at line 71 of file game.cpp.

◆ RESULT_Black

const resultT RESULT_Black = 2

Definition at line 191 of file common.h.

◆ RESULT_CHAR

const char RESULT_CHAR[4] = { '*', '1', '0', '=' }

Definition at line 195 of file common.h.

◆ RESULT_Draw

const resultT RESULT_Draw = 3

Definition at line 192 of file common.h.

◆ RESULT_LONGSTR

const char RESULT_LONGSTR[4][8] = { "*", "1-0", "0-1", "1/2-1/2" }

Definition at line 197 of file common.h.

◆ RESULT_None

const resultT RESULT_None = 0

Definition at line 189 of file common.h.

◆ RESULT_OPPOSITE

const resultT RESULT_OPPOSITE[4]
Initial value:
= {
}
const resultT RESULT_Black
Definition: common.h:191
const resultT RESULT_Draw
Definition: common.h:192
const resultT RESULT_White
Definition: common.h:190
const resultT RESULT_None
Definition: common.h:189

Definition at line 198 of file common.h.

◆ RESULT_SCORE

const uint RESULT_SCORE[4] = { 1, 2, 0, 1 }

Definition at line 194 of file common.h.

◆ RESULT_STR

const char RESULT_STR[4][4] = { "*", "1-0", "0-1", "=-=" }

Definition at line 196 of file common.h.

◆ RESULT_White

const resultT RESULT_White = 1

Definition at line 190 of file common.h.

◆ RIGHT

const directionT RIGHT = 8

Definition at line 555 of file common.h.

◆ ROOK

const pieceT ROOK = 3

Definition at line 228 of file common.h.

◆ SCID_OLDEST_VERSION

const versionT SCID_OLDEST_VERSION = 300

Definition at line 44 of file common.h.

◆ SCID_VERSION

const versionT SCID_VERSION = 400

Definition at line 43 of file common.h.

◆ SCID_VERSION_STRING

const char SCID_VERSION_STRING[] = "4.7.0"

Definition at line 46 of file common.h.

◆ SCID_WEBSITE

const char SCID_WEBSITE[] = "http://scid.sourceforge.net/"

Definition at line 47 of file common.h.

◆ START_BOARD

const boardT START_BOARD
Initial value:
=
{
WR, WN, WB, WQ, WK, WB, WN, WR,
WP, WP, WP, WP, WP, WP, WP, WP,
BP, BP, BP, BP, BP, BP, BP, BP,
BR, BN, BB, BQ, BK, BB, BN, BR,
}
const pieceT WK
Definition: common.h:241
const pieceT BB
Definition: common.h:242
const pieceT BK
Definition: common.h:242
const pieceT BN
Definition: common.h:242
const pieceT BQ
Definition: common.h:242
const pieceT WQ
Definition: common.h:241
const pieceT BP
Definition: common.h:242
const pieceT EMPTY
Definition: common.h:239
const pieceT WB
Definition: common.h:241
const pieceT WP
Definition: common.h:241
const pieceT END_OF_BOARD
Definition: common.h:240
const pieceT BR
Definition: common.h:242
const pieceT WN
Definition: common.h:241
const pieceT WR
Definition: common.h:241

Definition at line 632 of file common.h.

◆ UP

const directionT UP = 1

Definition at line 552 of file common.h.

◆ UP_LEFT

const directionT UP_LEFT = (UP | LEFT)

Definition at line 556 of file common.h.

◆ UP_RIGHT

const directionT UP_RIGHT = (UP | RIGHT)

Definition at line 557 of file common.h.

◆ WB

const pieceT WB = 4

Definition at line 241 of file common.h.

◆ WHITE

const colorT WHITE = 0

Definition at line 207 of file common.h.

◆ WK

const pieceT WK = 1

Definition at line 241 of file common.h.

◆ WM

const pieceT WM = 16

Definition at line 245 of file common.h.

◆ WN

const pieceT WN = 5

Definition at line 241 of file common.h.

◆ WP

const pieceT WP = 6

Definition at line 241 of file common.h.

◆ WQ

const pieceT WQ = 2

Definition at line 241 of file common.h.

◆ WR

const pieceT WR = 3

Definition at line 241 of file common.h.