mikroSDK Reference Manual
lv_ll.h
Go to the documentation of this file.
1
6#ifndef LV_LL_H
7#define LV_LL_H
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
13/*********************
14 * INCLUDES
15 *********************/
16#include <stdint.h>
17#include <stddef.h>
18#include <stdbool.h>
19
20/*********************
21 * DEFINES
22 *********************/
23
24/**********************
25 * TYPEDEFS
26 **********************/
27
29typedef uint8_t lv_ll_node_t;
30
32typedef struct {
33 uint32_t n_size;
34 lv_ll_node_t * head;
35 lv_ll_node_t * tail;
36} lv_ll_t;
37
38/**********************
39 * GLOBAL PROTOTYPES
40 **********************/
41
47void _lv_ll_init(lv_ll_t * ll_p, uint32_t node_size);
48
54void * _lv_ll_ins_head(lv_ll_t * ll_p);
55
62void * _lv_ll_ins_prev(lv_ll_t * ll_p, void * n_act);
63
69void * _lv_ll_ins_tail(lv_ll_t * ll_p);
70
77void _lv_ll_remove(lv_ll_t * ll_p, void * node_p);
78
83void _lv_ll_clear(lv_ll_t * ll_p);
84
93void _lv_ll_chg_list(lv_ll_t * ll_ori_p, lv_ll_t * ll_new_p, void * node, bool head);
94
100void * _lv_ll_get_head(const lv_ll_t * ll_p);
101
107void * _lv_ll_get_tail(const lv_ll_t * ll_p);
108
115void * _lv_ll_get_next(const lv_ll_t * ll_p, const void * n_act);
116
123void * _lv_ll_get_prev(const lv_ll_t * ll_p, const void * n_act);
124
130uint32_t _lv_ll_get_len(const lv_ll_t * ll_p);
131
146void _lv_ll_move_before(lv_ll_t * ll_p, void * n_act, void * n_after);
147
154
155/**********************
156 * MACROS
157 **********************/
158
159#define _LV_LL_READ(list, i) for(i = _lv_ll_get_head(list); i != NULL; i = _lv_ll_get_next(list, i))
160
161#define _LV_LL_READ_BACK(list, i) for(i = _lv_ll_get_tail(list); i != NULL; i = _lv_ll_get_prev(list, i))
162
163#ifdef __cplusplus
164} /*extern "C"*/
165#endif
166
167#endif
void _lv_ll_clear(lv_ll_t *ll_p)
void _lv_ll_move_before(lv_ll_t *ll_p, void *n_act, void *n_after)
void _lv_ll_remove(lv_ll_t *ll_p, void *node_p)
bool _lv_ll_is_empty(lv_ll_t *ll_p)
void * _lv_ll_ins_tail(lv_ll_t *ll_p)
uint32_t _lv_ll_get_len(const lv_ll_t *ll_p)
void * _lv_ll_get_next(const lv_ll_t *ll_p, const void *n_act)
void * _lv_ll_get_prev(const lv_ll_t *ll_p, const void *n_act)
void * _lv_ll_get_tail(const lv_ll_t *ll_p)
void _lv_ll_init(lv_ll_t *ll_p, uint32_t node_size)
uint8_t lv_ll_node_t
Definition lv_ll.h:29
void * _lv_ll_ins_prev(lv_ll_t *ll_p, void *n_act)
void * _lv_ll_ins_head(lv_ll_t *ll_p)
void _lv_ll_chg_list(lv_ll_t *ll_ori_p, lv_ll_t *ll_new_p, void *node, bool head)
void * _lv_ll_get_head(const lv_ll_t *ll_p)
Definition lv_ll.h:32