From 49cc88def2f9edea59e79ca37f41400ad870579e Mon Sep 17 00:00:00 2001 From: Aargh Rai Date: Wed, 27 May 2026 17:13:14 +0530 Subject: went through all, but comms is working --- src/main.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'src/main.c') 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 +#include #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(); -- cgit v1.2.3