xref: /btstack/port/stm32-wb55xx-nucleo-freertos/Middlewares/STM32_WPAN/utilities/stm_list.h (revision 0561b2d8d5dba972c7daa57d5e677f7a1327edfd)
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   * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
10   * All rights reserved.</center></h2>
11   *
12   * This software component is licensed by ST under BSD 3-Clause license,
13   * the "License"; You may not use this file except in compliance with the
14   * License. You may obtain a copy of the License at:
15   *                        opensource.org/licenses/BSD-3-Clause
16   *
17   ******************************************************************************
18  */
19 
20 
21 #ifndef _STM_LIST_H_
22 #define _STM_LIST_H_
23 
24 /* Includes ------------------------------------------------------------------*/
25 
26 typedef  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