API定义标准格式

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Xminyang/article/details/80714073

API定义标准格式

/**
 * list_entry - get the struct for this entry
 * @ptr:    the &struct list_head pointer.
 * @type:   the type of the struct this is embedded in.
 * @member: the name of the list_struct within the struct.
 */
#define list_entry(ptr, type, member) \
    container_of(ptr, type, member)

功能:将指针ptr指向结构体type中的成员member,并通过指针ptr返回结构体type的起始地址。
FROM “list.h”

猜你喜欢

转载自blog.csdn.net/Xminyang/article/details/80714073