Elaborato_SO/inc/structures.h

38 lines
488 B
C

#ifndef STRUCTURES_H
#define STRUCTURES_H
#include <sys/types.h>
// semaphore
union semun {
int val;
struct semid_ds * buf;
unsigned short * array;
};
// shared memory
#define KEYFILE "../LICENSE"
#define SHMERR (void *)-1
typedef struct {
int collums;
int rows;
char player1Token;
char player2Token;
} input_server_t;
typedef enum {
EMPTY,
PLAYER1,
PLAYER2
} tile_t;
int semid;
int _MSGQID;
int shmid;
tile_t *board;
pid_t pids[2];
#endif