global.c
来自「在linux系统下实现了一个多人聊天工具的服务器端和客户端。该工具支持显示在线用」· C语言 代码 · 共 26 行
C
26 行
#include "global.h"
bucket_list hash_table[SIZE];/*a hash table to record the information
*for the user and it used the user
name to index the information*/
addr_list addr_table[SIZE]; /*a hash table to record the information
for the user and it used the user
file descriptor to index the information*/
int on_line_num = 0; /*the number of user on line*/
int max_user = 500; /*the max number of user allow to
connect to the server at the same time*/
pthread_mutex_t num_mutex; /*make sure the correctness of the number
of user*/
pthread_mutex_t name_mutex; /*make sure the correctness of the hash
table hash_table[]*/
pthread_mutex_t addr_mutex; /*make sure the correctness of the hash
table addr_table[]*/
pthread_mutex_t host_mutex; /*make sure the correctness of the link
list of host*/
host_list * host_head = NULL; /*point to the head of the host link list*/
host_list * host_tail = NULL; /*point to the tail of the host link list*/
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?