1 /** 2 ****************************************************************************** 3 * @file stm_list.h 4 * @author MCD Application Team 5 * @brief Header file for linked list library. 6 ****************************************************************************** 7 * @attention 8 * 9 * Copyright (c) 2018-2021 STMicroelectronics. 10 * All rights reserved. 11 * 12 * This software is licensed under terms that can be found in the LICENSE file 13 * in the root directory of this software component. 14 * If no LICENSE file comes with this software, it is provided AS-IS. 15 * 16 ****************************************************************************** 17 */ 18 19 20 #ifndef _STM_LIST_H_ 21 #define _STM_LIST_H_ 22 23 /* Includes ------------------------------------------------------------------*/ 24 #include "stm32_wpan_common.h" 25 26 typedef PACKED_STRUCT _tListNode { 27 struct _tListNode * next; 28 struct _tListNode * prev; 29 } tListNode; 30 31 void LST_init_head (tListNode * listHead); 32 33 uint8_t LST_is_empty (tListNode * listHead); 34 35 void LST_insert_head (tListNode * listHead, tListNode * node); 36 37 void LST_insert_tail (tListNode * listHead, tListNode * node); 38 39 void LST_remove_node (tListNode * node); 40 41 void LST_remove_head (tListNode * listHead, tListNode ** node ); 42 43 void LST_remove_tail (tListNode * listHead, tListNode ** node ); 44 45 void LST_insert_node_after (tListNode * node, tListNode * ref_node); 46 47 void LST_insert_node_before (tListNode * node, tListNode * ref_node); 48 49 int LST_get_size (tListNode * listHead); 50 51 void LST_get_next_node (tListNode * ref_node, tListNode ** node); 52 53 void LST_get_prev_node (tListNode * ref_node, tListNode ** node); 54 55 #endif /* _STM_LIST_H_ */ 56