Golem
v0.1.1
Generic Operating system Libraries for Embedded Multitasking
All
Data Structures
Files
Functions
Variables
Pages
glm_list.h
Go to the documentation of this file.
1
21
#ifndef _GLM_LIST_H_
22
#define _GLM_LIST_H_
23
24
#ifdef __cplusplus
25
extern
"C"
{
26
#endif
27
28
29
/* INCLUDES *******************************************************************/
30
#include <stdbool.h>
31
#include "../glm_intbase.h"
32
#include "../glm_heap.h"
33
34
35
/* TYPES **********************************************************************/
36
41
typedef
struct
42
{
43
void
*
prev
;
44
void
*
object
;
45
void
*
next
;
46
}
list_item_t
;
47
48
53
typedef
struct
54
{
55
list_item_t
*
first
;
56
list_item_t
*
last
;
57
uint_base_t
length
;
58
}
list_t
;
59
60
61
/* PUBLIC FUNCTIONS ***********************************************************/
62
63
71
extern
list_t
* list_create(heap_id_t a_heap_id);
72
73
80
extern
void
list_destroy(
list_t
*a_list);
81
82
87
extern
void
list_clear(
list_t
*a_list);
88
89
96
extern
uint_base_t list_length(
list_t
* a_list);
97
98
110
extern
list_item_t
* list_item_create(
list_t
* a_list,
void
* a_object);
111
112
122
extern
list_item_t
* list_item_delete(
list_t
* a_list,
list_item_t
* a_item);
123
124
135
extern
void
* list_item_remove(
list_t
* a_list,
list_item_t
* a_item );
136
137
146
extern
bool
list_append(
list_t
*a_list,
list_item_t
*a_item);
147
148
157
extern
bool
list_prepend(
list_t
*a_list,
list_item_t
*a_item);
158
159
167
extern
list_item_t
* list_first_item(
list_t
*a_list );
168
169
177
extern
list_item_t
* list_last_item(
list_t
*a_list );
178
179
191
extern
bool
list_insert_after_item(
list_t
* a_list,
list_item_t
*a_item,
192
list_item_t
*a_item_new );
193
194
206
extern
bool
list_insert_before_item(
list_t
* a_list,
list_item_t
*a_item,
207
list_item_t
*a_item_new );
208
209
218
extern
list_item_t
* list_item_get_previous(
list_item_t
* a_item);
219
220
229
extern
list_item_t
* list_item_get_next(
list_item_t
* a_item);
230
231
240
extern
void
*
list_item_get_object
(
list_item_t
*a_item);
241
242
243
#ifdef __cplusplus
244
}
245
#endif
246
247
#endif
/* _GLM_LIST_H_ */
248
ADT
glm_list.h
Generated on Fri Jan 17 2014 20:54:24 for Golem by
1.8.4