RT-Thread内核-rt_list_for_each

1、原型

/**
 * rt_list_for_each - iterate over a list
 * @pos:	the rt_list_t * to use as a loop cursor.
 * @head:	the head for your list.
 */
#define rt_list_for_each(pos, head) \
    for (pos = (head)->next; pos != (head); pos = pos->next)

2、作用

遍历一个双向链表

3、参数

参数 pos:遍历链表需要用到的临时变量

参数 head:需要遍历的链表的头指针

发布了124 篇原创文章 · 获赞 21 · 访问量 3万+

猜你喜欢

转载自blog.csdn.net/tyustli/article/details/103948778