Skip to content

Commit

Permalink
[IM]: 结构调整
Browse files Browse the repository at this point in the history
  • Loading branch information
liujj committed Aug 9, 2022
1 parent 03a1b77 commit 335829c
Show file tree
Hide file tree
Showing 11 changed files with 87 additions and 74 deletions.
36 changes: 36 additions & 0 deletions 03.code/20.高并发服务器开发/00.head.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#ifndef _HEAD_H
#define _HEAD_H


#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <string.h>
#include <pthread.h>
#include <errno.h>
#include <arpa/inet.h>
#include <sys/socket.h>
#include <fcntl.h>
#include <sys/epoll.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <sys/sem.h>
#include <sys/ioctl.h>

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <pwd.h>
#include <grp.h>
#include <ctype.h>
#include <dirent.h>

#include "01.color.h"
#ifdef _D
#define DBG(fmt, arg...) print(fmt, ##arg)
#else
#define DBG(fmt, arg...)
#endif

#endif
33 changes: 33 additions & 0 deletions 03.code/20.高并发服务器开发/01.color.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#ifndef _COLOR_H
#define _COLOR_H

#define NONE "\e[0m" //清空颜色,即之后的打印为正常输出,之前的不受影响
#define BLACK "\e[0;30m" // 深黑
#define L_BLACK "\e[1;30m" // 亮黑,偏灰褐
#define RED "\e[0;31m" // 深红, 暗红
#define L_RED "\e[1;31m" // 鲜红
#define GREEN "\e[0;32m" // 深绿,暗绿
#define L_GREEN "\e[1;32m" // 鲜绿
#define BROWN "\e[0;33m" // 深黄,暗黄
#define YELLOW "\e[1;33m" // 鲜黄
#define BLUE "\e[0;34m" // 深蓝 暗蓝
#define L_BLUE "\e[1;34m" // 亮蓝 偏白灰
#define PINK "\e[0;35m" // 深粉,暗粉,偏暗紫
#define L_PINK "\e[1;35m" // 亮粉 偏白灰
#define CYAN "\e[0;36m" // 暗青色
#define L_CYAN "\e[1;36m" // 鲜亮青色
#define GRAY "\e[1;37m" // 灰色
#define WHITE "\e[1;37m" // 白色,字体粗一点,比正常大,比bold小
#define BOLD "\e[1m" // 白色,粗体
#define UNDERLINE "\e[4m" // 下划线,白色,正常大小
#define BLINK "\e[5m" // 闪烁,白色,正常大小
#define REVEERSE "\e[7m" // 反转,及字体背景为白色,字体为黑色
#define HIDE "\e[8m" // 隐藏
#define CLEAR "\e[2]" // 清除
#define CLRLINE "\r\e[K" // 清除行

#endif




Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

17 changes: 17 additions & 0 deletions 03.code/20.高并发服务器开发/01.线程池/thread_pool.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

#ifndef _THREAD_POOL_H
#define _THREAD_POOL_H

struct task_queue
{
// 循环队列
int head, tail, size, total;
void **data;
pthread_mutex_t mutex;
pthread_cond_t cond;
};

void task_queue_init()


#endif
Binary file removed 03.code/end/笔试.numbers
Binary file not shown.
13 changes: 0 additions & 13 deletions 04.c++14/01.数字分隔符.cpp

This file was deleted.

14 changes: 0 additions & 14 deletions 04.c++14/02.函数返回值类型推导.cpp

This file was deleted.

10 changes: 0 additions & 10 deletions 04.c++14/03.auto.cpp

This file was deleted.

29 changes: 0 additions & 29 deletions 04.c++14/04.变量模版.cpp

This file was deleted.

8 changes: 0 additions & 8 deletions 04.c++14/05.constexpr.cpp

This file was deleted.

0 comments on commit 335829c

Please sign in to comment.