diff options
Diffstat (limited to 'pgm4/ttt.h')
-rw-r--r-- | pgm4/ttt.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/pgm4/ttt.h b/pgm4/ttt.h new file mode 100644 index 0000000..abc4c09 --- /dev/null +++ b/pgm4/ttt.h @@ -0,0 +1,33 @@ +/* ttt.h + * + * Adam Carpenter - 2017 + */ + +#ifndef TTT_H +#define TTT_H + + +// Constants. +#define MESSAGE_BUFF 64 +#define MAX_HOSTNAME 255 +#define MAX_CLIENTS 4 +#define FALSE 0 +#define TRUE 1 +#define X_WIN 'X' +#define O_WIN 'O' +#define TIE_GAME '-' + +// Messages that can be sent by the server and client. +#define HANDLE "h" +#define ABORT "a" +#define PLAYERID 'p' +#define BOARD 'b' +#define MOVE "m" +#define WAIT "w" +#define ENDGAME 'e' + +#endif + +// Function declarations. +int sendMessage(int connSock, char *message); +int getMessage(int connSock, char *message); |