diff options
| author | Aargh Rai <aargh.rai+git@gmail.com> | 2026-07-04 19:53:16 +0530 |
|---|---|---|
| committer | Aargh Rai <aargh.rai+git@gmail.com> | 2026-07-04 19:53:16 +0530 |
| commit | 8535106616ccdc9f52c29ce7f46555e613c38b6e (patch) | |
| tree | 73d50f1406e9dd2ce4f7ab71203942dbfbf0428c /src/uci.c | |
| parent | c21796b9d1eb85cc92ea37ac3101395cf9c2736f (diff) | |
uci state exists & options are printed on uci init
Diffstat (limited to 'src/uci.c')
| -rw-r--r-- | src/uci.c | 21 |
1 files changed, 20 insertions, 1 deletions
@@ -1,9 +1,12 @@ #include <stdio.h> +#include <string.h> #include <stdbool.h> #include <stdlib.h> #include <fcntl.h> #include <unistd.h> #include <errno.h> + +#include "uci/state.h" #include "uci/command.h" #include "uci/response.h" @@ -33,6 +36,21 @@ int main() { // https://stackoverflow.com/a/41559081 fcntl(STDIN_FILENO, F_SETFL, O_NONBLOCK); + uci_state state = {0}; + strncpy(state.name, "Gacrux", 32); + strncpy(state.author, "Aargh Rai <aarghrai.com>", 32); + int k = 0; + state.option_settings[k++] = option_setting_spin("Threads", 1, 5, 1); + state.option_settings[k++] = option_setting_spin("Hash", 0, 512, 256); + state.option_settings[k++] = option_setting_button("Clear Hash"); + state.option_settings[k++] = option_setting_check("UCI_ShowCurrLine", false); + state.option_settings[k++] = option_setting_check("UCI_ShowRefutations", false); + state.option_settings[k++] = option_setting_check("UCI_LimitStrength", false); + state.option_settings[k++] = option_setting_spin("UCI_Elo", 100, 3500, 800); + state.option_settings[k++] = option_setting_check("UCI_AnalyseMode", false); + state.option_settings[k++] = option_setting_string("UCI_Opponent", "<empty>"); + state.option_settings[k++] = option_setting_string("UCI_EngineAbout", "Gacrux by Aargh Rai, Checkout https://git.aarghrai.com/gacrux"); + state.option_settings[k++] = option_setting_string("UCI_SetPositionValue", "<empty>"); ucicmd cmd = ucicmd_init(); size_t n; char buf[1024]; @@ -43,9 +61,10 @@ int main() { if (n > 0) { load_from_message(&cmd, buf); } - handle_uci(cmd); + handle_uci(&state, cmd); } } #include "uci/command.c" #include "uci/response.c" +#include "uci/state.c" |
