X-Git-Url: http://winboard.nl/cgi-bin?p=polyglot.git;a=blobdiff_plain;f=uci.h;h=0a471fd07dec96be195b92d9b858ecf2ede4411a;hp=5d28aa579fd2244e00a80b087dc8b8bec5715617;hb=1087eb7b2d8447adf9a7deb549d4004a87b46b10;hpb=e7a2abd9bd4fce9ebbd70793b00d9d5f99886348 diff --git a/uci.h b/uci.h index 5d28aa5..0a471fd 100644 --- a/uci.h +++ b/uci.h @@ -13,19 +13,22 @@ #include "option.h" #include "util.h" -// constants +// macros -const int OptionNb = 256; +// I need to make a uniform string type. -struct uci_t { +#define UciStringSize 4096 + +// types + +typedef struct { engine_t * engine; const char * name; const char * author; - int option_nb; - option_t option[OptionNb]; + option_list_t option[1]; bool ready; int ready_nb; @@ -59,19 +62,22 @@ struct uci_t { int root_move_pos; int root_move_nb; bool multipv_mode; -}; - -enum dummy_event_t { - EVENT_NONE = 0, - EVENT_UCI = 1 << 0, - EVENT_READY = 1 << 1, - EVENT_STOP = 1 << 2, - EVENT_MOVE = 1 << 3, - EVENT_PV = 1 << 4, - EVENT_DEPTH = 1 << 5, - EVENT_DRAW = 1 << 6, - EVENT_RESIGN= 1 << 7 -}; + char info[UciStringSize]; +} uci_t; + +typedef enum { + EVENT_NONE = 0, + EVENT_UCI = 1 << 0, + EVENT_READY = 1 << 1, + EVENT_STOP = 1 << 2, + EVENT_MOVE = 1 << 3, + EVENT_PV = 1 << 4, + EVENT_DEPTH = 1 << 5, + EVENT_DRAW = 1 << 6, + EVENT_RESIGN = 1 << 7, + EVENT_ILLEGAL_MOVE = 1 << 8, + EVENT_INFO = 1 << 9 +} dummy_event_t; // variables @@ -86,27 +92,11 @@ extern void uci_send_stop (uci_t * uci); extern void uci_send_stop_sync (uci_t * uci); extern void uci_send_ucinewgame (uci_t * uci); extern void uci_set_threads (uci_t * uci, int n); -extern bool uci_thread_option_exist(uci_t * uci); extern const char * uci_thread_option(uci_t * uci); -extern int uci_get_option (uci_t * uci, const char * name); - -extern bool uci_option_exist (uci_t * uci, const char option[]); -extern void uci_send_option (uci_t * uci, const char option[], const char format[], ...); - -extern void uci_close (uci_t * uci); - -extern void uci_clear (uci_t * uci); - -extern int uci_parse (uci_t * uci, const char string[]); - -void uci_set_option(uci_t * uci, - const char * name, - const char * default_, - const char * type, - const char * max, - const char * min, - int var_nb, - const char * var[]); +extern bool uci_send_option (uci_t * uci, const char option[], const char format[], ...); +extern void uci_close (uci_t * uci); +extern void uci_clear (uci_t * uci); +extern int uci_parse (uci_t * uci, const char string[]); #endif // !defined UCI_H