summaryrefslogtreecommitdiff
path: root/src/uci/state.h
diff options
context:
space:
mode:
authorAargh Rai <aargh.rai+git@gmail.com>2026-07-04 19:53:16 +0530
committerAargh Rai <aargh.rai+git@gmail.com>2026-07-04 19:53:16 +0530
commit8535106616ccdc9f52c29ce7f46555e613c38b6e (patch)
tree73d50f1406e9dd2ce4f7ab71203942dbfbf0428c /src/uci/state.h
parentc21796b9d1eb85cc92ea37ac3101395cf9c2736f (diff)
uci state exists & options are printed on uci init
Diffstat (limited to 'src/uci/state.h')
-rw-r--r--src/uci/state.h91
1 files changed, 91 insertions, 0 deletions
diff --git a/src/uci/state.h b/src/uci/state.h
new file mode 100644
index 0000000..98b42dd
--- /dev/null
+++ b/src/uci/state.h
@@ -0,0 +1,91 @@
+#ifndef UCI_STATE_H
+#define UCI_STATE_H
+
+typedef struct {
+ char* data;
+ int length;
+} str_t;
+
+typedef bool check_t;
+typedef int spin_t;
+typedef struct {
+ str_t* combinations;
+ int chosen_option;
+} combo_t;
+// the button isn't actually a value thing
+// it's more like an event.
+// so we parse a button type, we set this to true, handle it
+// then set it to false again
+typedef bool button_t;
+
+typedef struct {
+ char** combination;
+ int count;
+ int default_index;
+} option_combo_setting_t;
+typedef struct {
+ int min;
+ int max;
+ int default_value;
+} option_spin_setting_t;
+enum { OPTION_SPIN, OPTION_COMBO, OPTION_CHECK, OPTION_STRING, OPTION_BUTTON };
+typedef struct {
+ char option_name[32];
+ int type;
+ union {
+ option_combo_setting_t combo;
+ option_spin_setting_t spin;
+ bool check_default;
+ const char* string_default;
+ } data;
+} option_setting_t;
+
+option_setting_t option_setting_combo(
+ char* option_name,
+ char** combinations,
+ int combinations_count,
+ int default_index
+);
+option_setting_t option_setting_spin(
+ const char* option_name,
+ int min,
+ int max,
+ int default_value
+);
+option_setting_t option_setting_check(
+ const char* option_name,
+ bool default_value
+);
+option_setting_t option_setting_string(
+ const char* option_name,
+ const char* default_value
+);
+option_setting_t option_setting_button(const char* option_name);
+
+typedef struct {
+ char name[32];
+ char author[32];
+
+ option_setting_t option_settings[10];
+
+ // options
+ spin_t threads;
+ spin_t hash;
+ button_t clear_hash;
+ // str_t nalimovpath;
+ // spin_t nalimovcache;
+ // check_t ponder;
+ // check_t ownbook;
+ // spin_t multipv;
+ check_t uci_showcurrline;
+ check_t uci_showrefutations;
+ check_t uci_limitstrength;
+ spin_t uci_elo;
+ check_t uci_analysemode;
+ str_t uci_opponent;
+ str_t uci_engineabout;
+ // str_t uci_shredderbasespath;
+ str_t uci_setpositionvalue;
+} uci_state;
+
+#endif // UCI_STATE_H