initial commit

This commit is contained in:
jazz
2026-03-23 17:01:32 -05:00
parent d3c52fd18a
commit 33f7d4bcc4
16 changed files with 767 additions and 9 deletions

30
public.h Normal file
View File

@@ -0,0 +1,30 @@
#ifndef PUBLIC_H
#define PUBLIC_H
#include <string>
using namespace std;
typedef enum { NO_MODE = 0, SERVER_MODE = 1, CLIENT_MODE = 2 } chatmode_t;
extern chatmode_t mode;
extern const int PORT_NUM;
extern string IP_ADDRESS;
extern const int DEFAULT_CUR_X;
extern const int DEFAULT_CUR_Y;
extern int serverSocketDescriptor;
extern int clientSocketDescriptor;
extern struct timeval start1, end1;
extern int bytesRead, bytesWritten;
extern const int LOG_LENGTH;
extern int linePos;
extern string logFileName;
extern pthread_t client_wait_thread;
struct waitClientArgs;
int writeToFile(string path, string line, bool incLineNum = true);
void *waitForClient(void *argss);
void *pollForClient();
void *pollForSever(void *args);
#endif