summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
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();