3 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 * Licensed under the Apache License, Version 2.0 (the License);
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
23 * @brief provide DataStructure - Linked List
26 /** @addtogroup utility
30 #define UTIL_PREFETCH(link)
32 #define UTIL_LIST_ITER(iter, head_ptr) \
33 for (iter = (head_ptr)->next; (UTIL_PREFETCH(iter->next) iter != (head_ptr)); \
37 * @brief Node structure of Double Linked List
39 typedef struct util_list_node util_list_node_s;
40 struct util_list_node {
41 util_list_node_s *next; /**< next */
42 util_list_node_s *prev; /**< prev */
47 * @param[in] new_node util_list_node_s
48 * @param[in] head_ptr util_list_node_s
50 void util_list_add_node(util_list_node_s * new_node, util_list_node_s * head_ptr);
54 * @param[in] target_node util_list_node_s
56 void util_list_delete_node(util_list_node_s * target_node);
60 * @param[in] list util_list_node_s
61 * @param[in] head_ptr util_list_node_s
63 void util_list_move_node(util_list_node_s * list, util_list_node_s * head_ptr);
66 * @brief get list node count
67 * @param[in] head_ptr util_list_node_s
69 int util_list_node_count(const util_list_node_s * head_ptr);
72 * @brief initialize list
73 * @param[in] node_ptr util_list_node_s
75 void util_list_init(util_list_node_s * node_ptr);
81 #endif /* FW_LIST_H_ */