-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdataTypes.h
More file actions
48 lines (41 loc) · 866 Bytes
/
dataTypes.h
File metadata and controls
48 lines (41 loc) · 866 Bytes
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
47
48
#ifndef DATA_TYPES_H
#define DATA_TYPES_H
#include <stdio.h> // for fprintf and printf
#include <pthread.h> // for pthreads
#include <stdlib.h> // for malloc, free, EXIT_SUCCESS, EXIT_FAILURE
#include <stdbool.h> // for bool type
#include <unistd.h> // for sleep
#define START_THREADS 10
#define UNIVERSE_SIZE 100
typedef enum
{
DEVELOPING,
ALIVE,
FRIENDLY,
DEAD,
HIDDEN,
ASCENDED
} survivalState;
typedef enum
{
WARRIOR,
FRIEND,
COWARD,
UNDEVELOPED,
UNKNOWN
} diplomaticState;
//param list for threads
typedef struct threadDataStruct
{
int refNum;
pthread_mutex_t* running_mutex;
pthread_cond_t* cond;
void** Universe;
pthread_t* ownThread;
int position;
int development;
int visibility;
diplomaticState diploState;
survivalState state;
} threadData;
#endif // DATA_TYPES_H