summaryrefslogtreecommitdiff
path: root/src/ipc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ipc.c')
-rw-r--r--src/ipc.c51
1 files changed, 5 insertions, 46 deletions
diff --git a/src/ipc.c b/src/ipc.c
index 5caf71e..f8b9a00 100644
--- a/src/ipc.c
+++ b/src/ipc.c
@@ -1,46 +1,5 @@
-#ifndef IPC_C
-#define IPC_C
-
-#include "ipc.h"
-
-comm_moves comm_moves_init() {
- return (comm_moves) {
- malloc(sizeof(struct uci_move) * 50),
- 0,
- 50
- };
-}
-
-void add_comm_move(comm_moves *moves, struct uci_move move) {
- if (moves->count + 1 > moves->capacity) {
- moves->capacity += 50;
- moves->moves = realloc(
- moves->moves,
- moves->capacity * sizeof(struct uci_move)
- );
- }
- moves->moves[moves->count++] = move;
-}
-
-
-bool should_continue(struct engine_message *message, struct go_args* go) {
- int depth;
- int nodes;
- int mate;
- if (go->depth && (go->depth >= message->depth)) {
- return false;
- }
- if (go->nodes && (go->nodes >= message->nodes)) {
- message->node_limit = true;
- return false;
- }
- if (go->mate && message->mate && (go->mate <= message->mate)) {
- return false;
- }
- return true;
-}
-
-#include "fen.c"
-#include "bitboard.c"
-
-#endif // IPC_C
+#include "ipc/go_args.c"
+#include "ipc/moves.c"
+#include "ipc/engine_message.c"
+#include "ipc/state.c"
+#include "ipc/threads.c"