Merge pull request #1577 from armink/fix_slist

[rtservice] Add `rt_slist_first` and `rt_slist_next` API to slist.
This commit is contained in:
Bernard Xiong 2018-06-27 13:30:30 +08:00 committed by GitHub
commit 37ce32e840
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -230,6 +230,16 @@ rt_inline rt_slist_t *rt_slist_remove(rt_slist_t *l, rt_slist_t *n)
return l;
}
rt_inline rt_slist_t *rt_slist_first(rt_slist_t *l)
{
return l->next;
}
rt_inline rt_slist_t *rt_slist_next(rt_slist_t *n)
{
return n->next;
}
rt_inline int rt_slist_isempty(rt_slist_t *l)
{
return l->next == RT_NULL;