Skip to content

Commit

Permalink
Merge pull request #14 from kierank/merge
Browse files Browse the repository at this point in the history
ulist: add ulist_is_first helper
  • Loading branch information
Christophe Massiot committed Mar 14, 2015
2 parents c095474 + 1203d37 commit 11d24d8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions include/upipe/ulist.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,17 @@ static inline void ulist_init(struct uchain *ulist)
ulist->next = ulist->prev = ulist;
}

/** @This checks if the element is the first of the list.
*
* @param ulist pointer to a ulist
* @param element pointer to element
* @return true if the element is the first
*/
static inline bool ulist_is_first(struct uchain *ulist, struct uchain *element)
{
return element == ulist;
}

/** @This checks if the element is the last of the list.
*
* @param ulist pointer to a ulist
Expand Down

0 comments on commit 11d24d8

Please sign in to comment.