diff options
| author | Aargh Rai <aargh.rai+git@gmail.com> | 2026-07-13 21:58:18 +0530 |
|---|---|---|
| committer | Aargh Rai <aargh.rai+git@gmail.com> | 2026-07-13 21:58:18 +0530 |
| commit | f8c0dc54e36cc201c657aa12e5a22029b092e1bc (patch) | |
| tree | a0dd1a42c9681be98a7508c128db0dacacefc2e7 /src/ipc.c | |
| parent | 2e8b78ab0ef01eaacd8094ff839ac93b4451e9c3 (diff) | |
restructed all the files + uci done now
also broke the symbol analyser in the process, i didn't help much, i had
to pull out the pen & paper, but it made a cool graph never the less
multithreading was a pain! but it got it in the end
fixed the structs naming convention, if it's used outside by other
files, it's typedeffed, otherwise it's not
fixed the recursive imports issued i had in go_args*, where i was
casting it to void* in uci to make it work
now response.c doesn't deal with ipc, really happy with that change
now every single thing has its own responsibility
Diffstat (limited to 'src/ipc.c')
| -rw-r--r-- | src/ipc.c | 51 |
1 files changed, 5 insertions, 46 deletions
@@ -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" |
