Tiny protocol  0.9.3
Tiny communication protocol for microcontrollers
tiny_list.h
1 /*
2  Copyright 2016-2017 (C) Alexey Dynda
3 
4  This file is part of Tiny Protocol Library.
5 
6  Protocol Library is free software: you can redistribute it and/or modify
7  it under the terms of the GNU Lesser General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  Protocol Library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public License
17  along with Protocol Library. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #pragma once
21 
22 #include <stdint.h>
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 typedef struct list_element_
29 {
34 } list_element;
35 
36 
37 uint16_t tiny_list_add(list_element **head, list_element *element);
38 
39 void tiny_list_remove(list_element **head, list_element *element);
40 
41 void tiny_list_clear(list_element **head);
42 
43 void tiny_list_enumerate(list_element *head,
44  uint8_t (*enumerate_func)(list_element *element, uint16_t data),
45  uint16_t data);
46 
47 #ifdef __cplusplus
48 }
49 #endif
struct list_element_ * pnext
pointer to the next element in the list
Definition: tiny_list.h:31
struct list_element_ * pprev
pointer to the previous element in the list
Definition: tiny_list.h:33
structure defines base type for the lists
Definition: tiny_list.h:28