-
Notifications
You must be signed in to change notification settings - Fork 0
/
data_types.h
46 lines (40 loc) · 1.09 KB
/
data_types.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef DATA_TYPES_H
#define DATA_TYPES_H
/*==========================================================================
** INCLUDE FILES
**==========================================================================*/
#include <stdbool.h>
#include <pthread.h>
#include <semaphore.h>
/*==========================================================================
** MACRO DEFINITIONS
**==========================================================================*/
#define UINT8 uint8_t
#define PID pid_t
#define MUTEX pthread_mutex_t
#define SEM sem_t
/*==========================================================================
** CUSTOM DATA TYPES
**==========================================================================*/
typedef struct stdPacket
{
char firstChar;
char secondChar;
UINT8 firstNum;
UINT8 secondNum;
} DATA_stdPacket;
typedef struct Queue
{
int front, rear, size;
unsigned capacity;
DATA_stdPacket *array;
} packetQueue;
typedef struct threadData
{
pthread_t tid;
int threadnum;
int fd;
packetQueue *buffer;
struct sockaddr_in clientAddr;
} DATA_pthread;
#endif