list.h
Go to the documentation of this file.
1 /*!**********************************************************************
2  *
3  * @copyright Copyright (C) 2016 Siemens Aktiengesellschaft.\n
4  * All rights reserved.
5  *
6  *************************************************************************
7  *
8  * @file list.h
9  * @date Jul 20, 2016
10  * @brief List module header file.
11  *
12  * This module is used for double linked list handling.
13  *
14  ************************************************************************/
15 
16 #ifndef LIST_H_
17 #define LIST_H_
18 
19 #include "mcl/mcl_list.h"
20 
25 
39 
55 E_MCL_ERROR_CODE list_add(list_t *list, void *data);
56 
72 
89 
100 
114 E_MCL_ERROR_CODE list_exist(list_t *list, const void *item_to_find, list_compare_callback compare_function, void **item);
115 
123 void list_reset(list_t *list);
124 
135 void list_destroy(list_t **list);
136 
147 
148 #endif //LIST_H_
E_MCL_ERROR_CODE list_remove(list_t *list, list_node_t *node)
Removes a node from the list.
Definition: list.c:214
E_MCL_ERROR_CODE list_initialize(list_t **list)
Initializes the list.
Definition: list.c:139
E_MCL_ERROR_CODE list_remove_with_content(list_t *list, list_node_t *node, list_item_destroy_callback callback)
Removes a node from the list and destroys the removed item with the provided callback function...
Definition: list.c:195
list_node_t * list_next(list_t *list)
Get the next node from the list.
Definition: list.c:309
void(* mcl_list_item_destroy_callback)(void **item)
Definition: mcl_list.h:66
mcl_list_compare_callback list_compare_callback
Definition: list.h:23
mcl_list_t list_t
Definition: list.h:22
E_MCL_ERROR_CODE
MCL Error code definitions. Every function returning an error code uses this enum values...
Definition: mcl_common.h:137
void list_destroy_with_content(list_t **list, list_item_destroy_callback callback)
To destroy the list and its items with a given callback function.
Definition: list.c:373
List module interface file.
E_MCL_ERROR_CODE list_add(list_t *list, void *data)
Adds a new list item.
Definition: list.c:159
E_MCL_ERROR_CODE list_exist(list_t *list, const void *item_to_find, list_compare_callback compare_function, void **item)
Searches item_to_find in the list.
Definition: list.c:346
void list_destroy(list_t **list)
To destroy the list.
Definition: list.c:409
E_MCL_ERROR_CODE(* mcl_list_compare_callback)(void *reference_item, const void *item_to_compare)
Definition: mcl_list.h:59
void list_reset(list_t *list)
Reset the current node to head node.
Definition: list.c:329
mcl_list_item_destroy_callback list_item_destroy_callback
Definition: list.h:24
mcl_list_node_t list_node_t
Definition: list.h:21