2018-06-09 13:41:22 +02:00

51 lines
881 B
C

/**
* @file common.h
* @date 2018-05-21
*
* @brief Header file for common includes and constants as well as data structures.
*/
// guard block
#ifndef COMMON_H
#define COMMON_H
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <assert.h>
#include <string.h>
#include <stdint.h>
#include <limits.h>
#include <errno.h>
#include <signal.h>
#include <semaphore.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <sys/mman.h>
#include <fcntl.h>
#define SHM_NAME "/01527193"
#define PERMISSION (0600)
#define SEM_FREE_SPACE "/free_space_01527193"
#define SEM_USED_SPACE "/used_space_01527193"
#define SEM_WRITE_END "/write_end_01527193"
#define MAX_ITEMS 32
/**
* @details Struct for circular buffer in shared memory.
*/
struct circ_buf {
int quit;
int head;
int tail;
int data[MAX_ITEMS];
};
#endif /* ifndef COMMON_H */