summaryrefslogtreecommitdiff
path: root/src/uci.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/uci.c')
-rw-r--r--src/uci.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/uci.c b/src/uci.c
index 351211d..027c1c7 100644
--- a/src/uci.c
+++ b/src/uci.c
@@ -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"