C语言
//查无此人
这个作者很懒,什么都没留下…
展开
-
环形缓冲区
#define PRINT_BUF_SIZE (16*1024)static char *g_pcNetPrintBuf;//环形缓冲区的首地址static int g_iReadPos = 0; //环形缓冲区读的位置static int g_iWritePos = 0; //环形缓冲区写的位置int Init(){ g_pcNetPrintBuf = malloc(PRIN...原创 2019-07-11 10:03:43 · 130 阅读 · 0 评论 -
va_list/va_start/va_end/va_arg、printf的实现及其家族
1.va_list等先了解一下调用函数时,实参入栈的方式stdarg.h中的定义#inclde<stdarg.h>typedef char *va_list;#define va_start(list,param1) ( list = (va_list)¶m1+ sizeof(param1) )#define va_arg(list,mode) (...原创 2019-07-11 11:17:14 · 317 阅读 · 0 评论 -
目录项dirent详解及示例
dirent结构体struct dirent { ino_t d_ino; /* inode number*/ off_t d_off; /* offset to the next dirent */ unsigned short d_reclen; /* length of this record 本条记录的长度*/ unsig...原创 2019-07-24 13:58:00 · 2257 阅读 · 0 评论 -
Linux目录操作函数 scandir
int scandir(const char *dirp, //传入参数,目录的绝对路径传进去 struct dirent ***namelist, //传出参数,传出一个dirent结构体的二级指针 int (*filter)(const struct dirent *), //一个过滤函数 int (*compar)(co...原创 2019-07-24 14:33:02 · 778 阅读 · 0 评论