⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 global.c

📁 在linux系统下实现了一个多人聊天工具的服务器端和客户端。该工具支持显示在线用户
💻 C
字号:
#include "global.h"


/*define some global variable*/
WINDOW * editwin;   /*the window used to edit*/

WINDOW * midwin;   /*the window above the edit window used
			to separate the other two windows*/

WINDOW * showwin; /*the window above the edit window used to show
		   the message received from the server*/

sem_t full;

sem_t empty;

sem_t mutex;

ernode * current_row;/*the current row editing*/

ernode * row_head;   /*the head of the row link*/

ecnode * current_col;/*the current colum editing*/

int showwinrows = 0; /*the number of rows in the show window*/

rnode * top;	/*the top row of the show window*/

rnode * bott;	/*the row that ready for the next input*/

int rowcount;	/*the number of lines that showed in the show window*/

int current_x;	/*the x value in the edit window*/

int current_y;	/*the y value in the edit window*/

int log_x;	/*the logical x*/

int line_num;	/*how many lines we have had*/

int show_line = 0;/*the number of lines showed in the show window*/

int enable_log; /*enable the log history*/

int mess_in = 0; /*point to the entry for the next input in the buffer*/

int mess_out = 0;/*point to the next out put of the buffer*/

int serfd;	/*the file descriptor of the server*/

int berror = 0;	/*when the client receive error 101 or 104, this variable
		will be set to one and the program will be ended after the
		error showed.*/

char mess_buffer[MAX_SHOW_BUFF][MAX_BUFF]; /*it is a buffer for the input message*/

char key_buffer[MAX_BUFF];  /*it is a buffer for the keyboard input*/

char filename[MAX_FILE_NAME];	/*the log file name*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -