librnr/include/rnr/dlist.h
static inline void dlist_splice(dnode_t *list, dnode_t *head)
{
  if( !dlist_is_empty(list) )
  {
    dnode_t *first = list->next;
    dnode_t *last  = list->prev;
    dnode_t *at    = head->next;

    first->prev = head;
    head->next  = first;

    last->next = at;
    at->prev   = last;
  }
}
/*!
 * \brief prepend new list at head of given list
 *
 * \param list  the new list to add
 * \param head  list head holding newly spliced lists
 *
 * \note The list prev/next pointers are not altered so it is still a valid
 *       list.
 */
\brief prepend new list at head of given list
\param list  the new list to add
\param head  list head holding newly spliced lists

\note The list prev/next pointers are not altered so it is still a valid
list.
\ brief prepend new list at head of given list \ param list the new list to add \ param head list head holding newly spliced lists \ note The list prev / next pointers are not altered so it is still a valid list .
static inline void dlist_splice(dnode_t *list, dnode_t *head)
{
  if( !dlist_is_empty(list) )
  {
    dnode_t *first = list->next;
    dnode_t *last  = list->prev;
    dnode_t *at    = head->next;
    first->prev = head;
    head->next  = first;
    last->next = at;
    at->prev   = last;
  }
}
static inline void dlist_splice ( dnode_t * list , dnode_t * head ) { if ( ! dlist_is_empty ( list ) ) { dnode_t * first = list -> next ; dnode_t * last = list -> prev ; dnode_t * at = head -> next ; first -> prev = head ; head -> next = first ; last -> next = at ; at -> prev = last ; } }
\brief prepend new list at head of given list
 \param list  the new list to add
 \param head  list head holding newly spliced lists
\ brief prepend new list at head of given list \ param list the new list to add \ param head list head holding newly spliced lists