]> git.somenet.org - pub/jan/sysprog.git/blob - ttt/globals.h
all the old sysprog files
[pub/jan/sysprog.git] / ttt / globals.h
1 /**************\r
2 * Name:         aufgb.h\r
3 * Author:       Jan Vales (e0726236@student.tuwien.ac.at)\r
4 * Date:         3.12.2009\r
5 **************/\r
6 \r
7 #define _SVID_SOURCE\r
8 #define _XOPEN_SOURCE 600\r
9  \r
10 #include <sys/types.h>\r
11 #include <sys/ipc.h>\r
12 #include <sys/shm.h>\r
13 #include <time.h>\r
14 #include <sem182.h>\r
15 #include <stdio.h>\r
16 #include <stdlib.h>\r
17 #include <string.h>\r
18 #include <errno.h>\r
19 #include <assert.h>\r
20 #include <ctype.h>\r
21 #include <signal.h>\r
22 #include <getopt.h>\r
23 \r
24 #define SHM_KEY 666\r
25 #define PERM 0666\r
26 #define MAX_CHAR 20\r
27 #define SEM_KEY_A 1337\r
28 #define SEM_KEY_B 31337\r
29 \r
30 \r
31 /*\r
32 Status:\r
33  4: Game draw\r
34  3: Server win\r
35  2: Client win\r
36  1: Client changed something, its server's turn\r
37  0: Server did its turn + no error\r
38 -1: Game was reset. If set by server: client cheated! if set by client: reset cheat detection!\r
39 */\r
40 \r
41 typedef struct {\r
42     int status;\r
43     char field[3][3];\r
44 }sharedmem_t;\r
45 \r