From af6c6d03f40ada796069a59d903039ce63e02c0e Mon Sep 17 00:00:00 2001 From: Lorenzo Bianchi Date: Sun, 18 Jun 2023 16:13:05 +0200 Subject: [PATCH] tolti fixme e todo --- Makefile | 2 +- inc/client.h | 8 +++++++- inc/custom_msgq.h | 8 +++++++- inc/custom_sem.h | 8 +++++++- inc/custom_shm.h | 8 +++++++- inc/custom_sig.h | 8 +++++++- inc/errExit.h | 8 +++++++- inc/forza4.h | 8 +++++++- inc/server.h | 8 +++++++- inc/structures.h | 8 +++++++- src/custom_shm.c | 2 +- 11 files changed, 65 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 5a024b3..9a0e73d 100644 --- a/Makefile +++ b/Makefile @@ -53,7 +53,7 @@ test: comp comp: server_c client_c server_c: - @ mkdir bin + @ mkdir bin -p gcc src/F4Server.c src/custom_sem.c src/custom_shm.c src/custom_sig.c src/custom_msgq.c src/errExit.c src/forza4.c src/client.c src/server.c -o bin/F4Server -I inc/ client_c: gcc src/F4Client.c src/custom_sem.c src/custom_shm.c src/custom_sig.c src/custom_msgq.c src/errExit.c src/forza4.c src/client.c src/server.c -o bin/F4Client -I inc/ \ No newline at end of file diff --git a/inc/client.h b/inc/client.h index 796c7e8..75316a1 100644 --- a/inc/client.h +++ b/inc/client.h @@ -7,4 +7,10 @@ extern pid_t SERVER_PID; void setupClient(int argc, char *argv[]); -#endif \ No newline at end of file +#endif + +/************************************ +*VR471576 +*Lorenzo Bianchi +*16/06/2023 +*************************************/ \ No newline at end of file diff --git a/inc/custom_msgq.h b/inc/custom_msgq.h index d5d76fb..491823d 100644 --- a/inc/custom_msgq.h +++ b/inc/custom_msgq.h @@ -54,4 +54,10 @@ void sndMove(move_t *move); void sndPlayer(player_ds *player); void sndGame_end(game_end_t *game); -#endif \ No newline at end of file +#endif + +/************************************ +*VR471576 +*Lorenzo Bianchi +*16/06/2023 +*************************************/ \ No newline at end of file diff --git a/inc/custom_sem.h b/inc/custom_sem.h index 46449c5..7751e14 100644 --- a/inc/custom_sem.h +++ b/inc/custom_sem.h @@ -17,4 +17,10 @@ void setupClientSem(); int getSemid(key_t key, int size); void semOp(int semid, short sem_num, short sem_op); -#endif \ No newline at end of file +#endif + +/************************************ +*VR471576 +*Lorenzo Bianchi +*16/06/2023 +*************************************/ \ No newline at end of file diff --git a/inc/custom_shm.h b/inc/custom_shm.h index b85f81a..2022e02 100644 --- a/inc/custom_shm.h +++ b/inc/custom_shm.h @@ -17,4 +17,10 @@ tile_t * shmClientAt(); void shmDt(void *shm_ptr); void shmServerRm(int shmid); -#endif \ No newline at end of file +#endif + +/************************************ +*VR471576 +*Lorenzo Bianchi +*16/06/2023 +*************************************/ \ No newline at end of file diff --git a/inc/custom_sig.h b/inc/custom_sig.h index 138c0ce..db2327b 100644 --- a/inc/custom_sig.h +++ b/inc/custom_sig.h @@ -10,4 +10,10 @@ void sigHandlerServer(int sig); void setupServerSignalHandler(); void setupClientSignalHandler(); -#endif \ No newline at end of file +#endif + +/************************************ +*VR471576 +*Lorenzo Bianchi +*16/06/2023 +*************************************/ \ No newline at end of file diff --git a/inc/errExit.h b/inc/errExit.h index ba275f9..cb8deff 100644 --- a/inc/errExit.h +++ b/inc/errExit.h @@ -5,4 +5,10 @@ void errExit(char *func, char *where); void warningMsg(char *msg); void errExitMsg(char *msg); -#endif \ No newline at end of file +#endif + +/************************************ +*VR471576 +*Lorenzo Bianchi +*16/06/2023 +*************************************/ \ No newline at end of file diff --git a/inc/forza4.h b/inc/forza4.h index 00dad96..a5feada 100644 --- a/inc/forza4.h +++ b/inc/forza4.h @@ -32,4 +32,10 @@ void insertMove(int pos, int turn); int isValid(int pos); -#endif \ No newline at end of file +#endif + +/************************************ +*VR471576 +*Lorenzo Bianchi +*16/06/2023 +*************************************/ \ No newline at end of file diff --git a/inc/server.h b/inc/server.h index ede2347..9571739 100644 --- a/inc/server.h +++ b/inc/server.h @@ -20,4 +20,10 @@ typedef struct { void setupServer(int argc, char *argv[]); void end_game(int winner); -#endif \ No newline at end of file +#endif + +/************************************ +*VR471576 +*Lorenzo Bianchi +*16/06/2023 +*************************************/ \ No newline at end of file diff --git a/inc/structures.h b/inc/structures.h index 2b29fc5..a90227f 100644 --- a/inc/structures.h +++ b/inc/structures.h @@ -36,4 +36,10 @@ typedef enum { PLAYER2 } tile_t; -#endif \ No newline at end of file +#endif + +/************************************ +*VR471576 +*Lorenzo Bianchi +*16/06/2023 +*************************************/ \ No newline at end of file diff --git a/src/custom_shm.c b/src/custom_shm.c index ae2f805..60f50e9 100644 --- a/src/custom_shm.c +++ b/src/custom_shm.c @@ -30,7 +30,7 @@ void setupClientShm() { } int getShmidClient() { - return shmget(ftok(KEYFILE, SHMKEY), _ROWS * _COLLUMS * sizeof(tile_t), S_IRUSR | S_IWUSR); + return shmget(ftok(KEYFILE, SHMKEY), _ROWS * _COLLUMS * sizeof(tile_t), IPC_CREAT | S_IRUSR | S_IWUSR); } int getShmidServer() {