Move some helper scripts and files to tools/ subdirectory
[pachi/pachi-r6144.git] / gtp.h
blob06e507bdfa3bc0bab6691964df55b47473c1dd6d
1 #ifndef ZZGO_GTP_H
2 #define ZZGO_GTP_H
4 struct board;
5 struct engine;
6 struct time_info;
8 enum parse_code {
9 P_OK,
10 P_NOREPLY,
11 P_DONE_OK,
12 P_DONE_ERROR,
13 P_ENGINE_RESET,
14 P_UNKNOWN_COMMAND,
17 enum parse_code gtp_parse(struct board *b, struct engine *e, struct time_info *ti, char *buf);
18 void gtp_reply(int id, ...);
19 bool gtp_is_valid(char *cmd);
21 #define is_gamestart(cmd) (!strcasecmp((cmd), "boardsize"))
22 #define is_reset(cmd) (is_gamestart(cmd) || !strcasecmp((cmd), "clear_board") || !strcasecmp((cmd), "kgs-rules"))
23 #define is_repeated(cmd) (strstr((cmd), "pachi-genmoves"))
25 #endif