header complition

This commit is contained in:
Edi De Candido 2023-05-15 09:14:34 +02:00
parent 23e9392876
commit 5bf18bb3cf
3 changed files with 7 additions and 7 deletions

View File

@ -1,6 +1,10 @@
#ifndef SHM_H
#define SHM_H
int getShmid();
int getShmid(int row, int col);
tile_t * shmServerAt(int shmid);
tile_t * shmClientAt(int shmid);
void shmDt(void *shm_ptr);
void shmServerRm(int shmid);
#endif

View File

@ -2,8 +2,6 @@
#define STRUCTURES_H
// semaphore
union semun {
int val;
@ -28,8 +26,6 @@ typedef enum {
PLAYER2
} tile_t;
static const size_t SHM_SIZE = sizeof(shm_t);
// signal
#define DEFAULT_SIGINT 2
#define TIME_TO_RESET 10

View File

@ -33,8 +33,8 @@ tile_t * shmClientAt(int shmid) {
return result;
}
void shmDt(void *shm) {
if (shmdt(shm) == -1) {
void shmDt(void *shm_ptr) {
if (shmdt(shm_ptr) == -1) {
errExit("shmdt", "shmDt");
}
}