有点看不懂。

程序漫步 程序漫步 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
void elist_init_root(elist_t *root)
{
root->next = root->prev = root;
}


/* Add new element at the tail of the list. */
void elist_add_tail (elist_t *root,elist_t *newp)
{
root->prev->next = newp;
newp->next = root;
newp->prev = root->prev;
root->prev = newp;
}


/* Remove element from list. not use interface */
void elist_del_elem (elist_t *elem)
{
elem->next->prev = elem->prev;
elem->prev->next = elem->next;
}


/* get element at the head of the list and remove
the element from the list. if no element return NULL.
*/
elist_t* elist_remove_head(elist_t *root)
{
elist_t *next = 0;
if (root != root->next)
{
next = root->next;
elist_del_elem(root->next);
}
return next;
}
...全文
评论 10
收藏 已收藏
分享
返回顶部
程序漫步
C++ 语言 65,214 成员 250,514 内容