core: list: added functions for list entry manipulation
#define MK_LIST_H_
#include <stddef.h>
+#include "mk_macros.h"
#ifdef _WIN32
/* Windows */
@@ -165,6 +166,23 @@ static inline int mk_list_size(struct mk_list *head)
return ret;
}
+static inline void mk_list_entry_init(struct mk_list *list)
+{
+ list->next = NULL;
+ list->prev = NULL;
+}
+
+static inline int mk_list_entry_is_orphan(struct mk_list *head)
+{
+ if (head->next != NULL &&
+ head->prev != NULL &&
+ head->next != head->prev) {
+ return MK_FALSE;
+ }
+
+ return MK_TRUE;
+}
+
static inline int mk_list_entry_orphan(struct mk_list *head)
{
if (head->next && head->prev) {
