Elaborato_SO/inc/structures.h

35 lines
488 B
C
Raw Normal View History

2023-05-14 18:51:32 +02:00
#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);
#endif