码迷,mamicode.com
首页 > 其他好文 > 详细

宏UT_LIST_ADD_FIRST

时间:2015-12-02 00:35:35      阅读:185      评论:0      收藏:0      [点我收藏+]

标签:

 

/*******************************************************************//**
Adds the node as the first element in a two-way linked list.
@param NAME    list name
@param BASE    the base node (not a pointer to it)
@param N    pointer to the node to be added to the list.
*/
#define UT_LIST_ADD_FIRST(NAME, BASE, N)\
{    ut_ad(N);    ((BASE).count)++;    ((N)->NAME).next = (BASE).start;    ((N)->NAME).prev = NULL;    if (UNIV_LIKELY((BASE).start != NULL)) {        ut_ad((BASE).start != (N));        (((BASE).start)->NAME).prev = (N);    }    (BASE).start = (N);    if (UNIV_UNLIKELY((BASE).end == NULL)) {        (BASE).end = (N);    }}\

 

宏UT_LIST_ADD_FIRST

标签:

原文地址:http://www.cnblogs.com/taek/p/5011737.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!