diff --git a/simpleChatting/comn.h b/simpleChatting/comn.h new file mode 100644 index 0000000000000000000000000000000000000000..de89e9765b29c4b6526ae034b20fdad4e70e741f --- /dev/null +++ b/simpleChatting/comn.h @@ -0,0 +1,35 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +#define MAX_USER_CNT 2 +#define MAX_USER_NAME 10 +#define MAX_CHAT_LENGTH 255 + +int isServerConn = -1; +int shmid = 0; +void *shmaddr = NULL; +struct shmid_ds info; + +typedef struct UserData +{ + int pid; + char name[MAX_USER_NAME]; +}UserData; + +typedef struct SharedData +{ + int pid; + UserData user[MAX_USER_CNT]; +}SharedData; + +typedef struct MessageData +{ + int send_pid; + char content[MAX_CHAT_LENGTH]; +}MsgData;