Elaborato_SO/inc/structures.h

40 lines
550 B
C

#ifndef STRUCTURES_H
#define STRUCTURES_H
#define KEYFILE "../LICENSE"
// semaphore
union semun {
int val;
struct semid_ds * buf;
unsigned short * array;
};
// shared memory
typedef struct {
int collums;
int rows;
char player1Token;
char player2Token;
} input_server_t;
typedef enum {
EMPTY,
PLAYER1,
PLAYER2
} tile_t;
typedef struct {
tile_t *board;
input_server_t inS;
} shm_t;
static const size_t SHM_SIZE = sizeof(shm_t);
// signal
#define DEFAULT_SIGINT 2
#define TIME_TO_RESET 10
#endif