Joseki: Encapsulate dictionary in struct joseki_dict
[pachi/json.git] / joseki / base.h
blob2eee3eb88b95e1c1996257e2ed47160c573f02e5
1 #ifndef ZZGO_JOSEKI_BASE_H
2 #define ZZGO_JOSEKI_BASE_H
4 #include "board.h"
6 /* Single joseki situation - moves for S_BLACK-1, S_WHITE-1. */
7 struct joseki_pattern {
8 /* moves[] is a pass-terminated list or NULL */
9 coord_t *moves[2];
12 /* The joseki dictionary for given board size. */
13 struct joseki_dict {
14 int bsize;
16 #define joseki_hash_bits 20 // 8M w/ 32-bit pointers
17 #define joseki_hash_mask ((1 << joseki_hash_bits) - 1)
18 struct joseki_pattern *patterns;
21 extern struct joseki_dict *jdict;
23 struct joseki_dict *joseki_init(int bsize);
24 struct joseki_dict *joseki_load(int bsize);
25 void joseki_done(struct joseki_dict *);
27 #endif