通用链表(Linux内核链表)
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
// Linux内核链表
// 遍历
#define list_for_each(n,head)\
for(n=head->next;n!=head;n=n->next)
// 计算结构体成员所处的结构中的地址编号
// type 结构类型 mem 结构成员名
#define offset(type,mem) ((int)(&
原创
2021-07-13 09:51:17 ·
171 阅读 ·
0 评论