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/moves.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/moves.c')
| -rw-r--r-- | src/ipc/moves.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/ipc/moves.c b/src/ipc/moves.c new file mode 100644 index 0000000..acd7085 --- /dev/null +++ b/src/ipc/moves.c @@ -0,0 +1,23 @@ +#include "ipc/moves.h" +#include <stdlib.h> + +void ipc_moves_init(ipc_moves_t *moves) { + moves->data = malloc(sizeof(ipc_move_t) * 50); + moves->count = 0; + moves->capacity = 50; +} + +void ipc_moves_deinit(ipc_moves_t *moves) { + free(moves->data); +} + +void add_ipc_move(ipc_moves_t *moves, ipc_move_t move) { + if (moves->count + 1 > moves->capacity) { + moves->capacity += 50; + moves->data = realloc( + moves->data, + moves->capacity * sizeof(ipc_move_t) + ); + } + moves->data[moves->count++] = move; +} |
