Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ulist: add ulist_is_first helper #14

Merged
merged 1 commit into from
Mar 14, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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