X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=uci.h;h=0a471fd07dec96be195b92d9b858ecf2ede4411a;hb=acb140befabd8b0f1a8606470013b420d05b4fb7;hp=7291cdc14e74a5d33bdd12eea26f904ec35ae396;hpb=64f72f31685ea1dff12b19b22cfaf7a53ccc079f;p=polyglot.git diff --git a/uci.h b/uci.h index 7291cdc..0a471fd 100644 --- a/uci.h +++ b/uci.h @@ -10,32 +10,25 @@ #include "engine.h" #include "line.h" #include "move.h" +#include "option.h" #include "util.h" -// constants +// macros -const int OptionNb = 256; +// I need to make a uniform string type. -// types +#define UciStringSize 4096 -struct option_t { - const char * name; - const char * value; - const char * type; - const char * max; - const char * min; - const char * var; -}; +// types -struct uci_t { +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; @@ -69,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 @@ -96,25 +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 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 * value, - const char * type, - const char * max, - const char * min, - const char * var); +extern const char * uci_thread_option(uci_t * uci); +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