return TPL_ERROR_NONE;
}
+static TPL_INLINE tpl_list_node_t *
+__tpl_list_find_node(tpl_list_t *list, void *data, int occurrence,
+ tpl_free_func_t func)
+{
+ tpl_list_node_t *node = NULL;
+ tpl_list_node_t *res_node = NULL;
+
+ TPL_ASSERT(list);
+
+ if (occurrence == TPL_FIRST) {
+ node = list->head.next;
+
+ while (node != &list->tail) {
+ tpl_list_node_t *curr;
+
+ curr = node;
+ node = node->next;
+
+ TPL_ASSERT(curr);
+ TPL_ASSERT(node);
+
+ if (curr->data == data) {
+ res_node = curr;
+ }
+ }
+ } else if (occurrence == TPL_LAST) {
+ node = list->tail.prev;
+
+ while (node != &list->head) {
+ tpl_list_node_t *curr;
+
+ curr = node;
+ node = node->prev;
+
+ TPL_ASSERT(curr);
+ TPL_ASSERT(node);
+
+ if (curr->data == data) {
+ res_node = curr;
+ }
+ }
+ }
+
+ return res_node;
+}
+
static TPL_INLINE void
__tpl_list_remove_data(tpl_list_t *list, void *data, int occurrence,
tpl_free_func_t func)