summaryrefslogtreecommitdiff
path: root/src/ipc.h
blob: 98ce6d35198f4ecb11c452ff6085e658919fe63a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef IPC_H
#define IPC_H

#include <stdlib.h>
#include <sys/mman.h>

#include "fen.h"
#include "uci/state.h"

void* create_shared_memory(size_t size);

typedef struct {
  struct uci_move *moves;
  int count;
  int capacity;
} comm_moves;

struct engine_message {
  int depth;
  int seldepth;
  int multipv;
  int score_cp;
  int nodes;
  int nps;
  int hashfull;
  int tbhits;
  int time;
  comm_moves pv;

  struct engine_message *next;
};

enum { MESSAGE_FILLED, MESSAGE_READ, MESSAGE_PROCESSED };
typedef struct {
  struct engine_message engine_message;

  int uci_message_ready;
  struct fen_load from_position;
  comm_moves moves;
} comms;

comm_moves comm_moves_init();
void add_comm_move(comm_moves *moves, struct uci_move move);

#endif // IPC_H