./pachi -r RULESET to set rules from commandline
[pachi/nmclean.git] / gtp.h
blob8f8aec3b94bb909ea5962983023b4922f3331357
1 #ifndef PACHI_GTP_H
2 #define PACHI_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(const 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