From aa12d66b3087002d3266be0ca047058666e90216 Mon Sep 17 00:00:00 2001 From: armink Date: Wed, 27 Jun 2018 13:05:50 +0800 Subject: [PATCH] [rtservice] Add `rt_slist_first` and `rt_slist_next` API to slist. --- include/rtservice.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/rtservice.h b/include/rtservice.h index 3eec146960..f909f17f86 100644 --- a/include/rtservice.h +++ b/include/rtservice.h @@ -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;