summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorAargh Rai <aargh.rai+git@gmail.com>2026-05-27 17:13:14 +0530
committerAargh Rai <aargh.rai+git@gmail.com>2026-05-27 17:13:14 +0530
commit49cc88def2f9edea59e79ca37f41400ad870579e (patch)
tree55d84a76920dd4af7a7a2054d553ce29d11e726c /src/main.c
parent380d67bada7544f5f10cecc8c9dff7ed2f79e187 (diff)
went through all, but comms is working
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index a929a54..24d1d84 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,8 +1,28 @@
#include <stdio.h>
+#include <assert.h>
#include "bitboard.h"
#include "search.h"
-int main() {
+void comms_main();
+int direct_run();
+
+int main(int argc, char** argv) {
+ if (argc == 1) return direct_run();
+ assert(argc == 2);
+ comms_main();
+ return 0;
+}
+
+#include "ipc.h"
+void comms_main() {
+ mqd_t tx = mq_open("/engine_to_server", O_WRONLY);
+ mqd_t rx = mq_open("/server_to_engine", O_RDONLY);
+
+ char msg[] = "hello";
+ mq_send(tx, msg, sizeof(msg), 0);
+}
+
+int direct_run() {
moves_t moves = moves_init();
position_t position = position_starting();