My Project
base.h
Go to the documentation of this file.
1
11#ifndef EDAX_BASE_H
12#define EDAX_BASE_H
13
14#include "game.h"
15#include <stdbool.h>
16
17/* structures */
18struct Search;
19
24typedef struct WthorHeader {
25 char century;
26 char year;
27 char month;
28 char day;
30 char game_type;
31 char depth;
32 char reserved;
33 unsigned short n;
34 unsigned short game_year;
35 int n_games;
37
38typedef struct WthorBase {
40 char (*tournament)[26];
42 char (*player)[20];
45 int n_games;
47
48typedef struct Base {
51 int size;
53
54/* function declarations */
56bool wthor_load(WthorBase*, const char*);
57bool wthor_save(WthorBase*, const char*);
58void wthor_test(const char*, struct Search*);
59void wthor_eval(const char*, struct Search*, unsigned long long histogram[129][65]);
60void wthor_edaxify(const char*);
61
62#define foreach_wthorgame(wgame, wbase) \
63 for ((wgame) = (wbase)->game ; (wgame) < (wbase)->game + (wbase)->header->n_games; ++(wgame))
64
65void base_init(Base*);
66void base_free(Base*);
67bool base_load(Base*, const char*);
68void base_save(const Base*, const char*);
69void base_append(Base*, const Game*);
70void base_to_problem(Base*, const int, const char*);
71void base_to_FEN(Base*, const int, const char*);
72void base_analyze(Base*, struct Search*, const int, const bool);
73void base_complete(Base*, struct Search*);
74void base_unique(Base*);
75void base_compare(const char*, const char*);
76
77#endif /* EDAX_BASE_H */
78
void base_to_FEN(Base *, const int, const char *)
Convert a game database to a set of problems.
Definition: base.c:867
bool wthor_save(WthorBase *, const char *)
Save a wthor base.
Definition: base.c:387
void base_save(const Base *, const char *)
Save a game database.
Definition: base.c:788
void base_unique(Base *)
Make games unique in the game database.
Definition: base.c:720
bool base_load(Base *, const char *)
Load a game database.
Definition: base.c:740
void wthor_test(const char *, struct Search *)
Test Search with a wthor base.
Definition: base.c:516
void base_complete(Base *, struct Search *)
Base analysis.
Definition: base.c:919
bool wthor_load(WthorBase *, const char *)
Load a wthor base.
Definition: base.c:332
void base_free(Base *)
Free resources of a game database.
Definition: base.c:684
void base_init(Base *)
Initialize a game database.
Definition: base.c:672
void wthor_eval(const char *, struct Search *, unsigned long long histogram[129][65])
Test Eval with a wthor base.
Definition: base.c:611
void base_to_problem(Base *, const int, const char *)
Convert a game database to a set of problems.
Definition: base.c:841
void base_append(Base *, const Game *)
Add a game to a game database.
Definition: base.c:696
void wthor_init(WthorBase *)
Initialize a Wthor base.
Definition: base.c:316
void wthor_edaxify(const char *)
Change players to "Edax (delorme)" and tourney to "Etudes" in a wthor base.
Definition: base.c:651
void base_analyze(Base *, struct Search *, const int, const bool)
Base analysis.
Definition: base.c:893
void base_compare(const char *, const char *)
Base Compare.
Definition: base.c:943
Definition: base.h:48
Game * game
Definition: base.h:49
int n_games
Definition: base.h:50
int size
Definition: base.h:51
Definition: game.h:22
Definition: search.h:95
Definition: base.h:38
int n_players
Definition: base.h:43
WthorHeader header[1]
Definition: base.h:39
WthorGame * game
Definition: base.h:44
char(* tournament)[26]
Definition: base.h:40
int n_tournaments
Definition: base.h:41
int n_games
Definition: base.h:45
char(* player)[20]
Definition: base.h:42
Definition: game.h:38
Header for wthor files.
Definition: base.h:24
char month
Definition: base.h:27
char depth
Definition: base.h:31
char year
Definition: base.h:26
unsigned short n
Definition: base.h:33
char day
Definition: base.h:28
unsigned short game_year
Definition: base.h:34
char century
Definition: base.h:25
char reserved
Definition: base.h:32
int n_games
Definition: base.h:35
char game_type
Definition: base.h:30
char board_size
Definition: base.h:29