1 /* ################################################################### */
2 /* Copyright 2015, Pierre Gentile (p.gen.progs@gmail.com) */
4 /* This Source Code Form is subject to the terms of the Mozilla Public */
5 /* License, v. 2.0. If a copy of the MPL was not distributed with this */
6 /* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
7 /* ################################################################### */
12 typedef struct ll_node_s ll_node_t
;
13 typedef struct ll_s ll_t
;
15 /* ******************************* */
16 /* Linked list specific structures */
17 /* ******************************* */
19 /* Linked list node structure */
20 /* """""""""""""""""""""""""" */
24 struct ll_node_s
*next
;
25 struct ll_node_s
*prev
;
28 /* Linked List structure */
29 /* """"""""""""""""""""" */
47 ll_append(ll_t
* const list
, void * const data
);
51 int (*comp
)(void const *, void const *),
52 void (*swap
)(void **, void **));
55 ll_delete(ll_t
* const list
, ll_node_t
*node
);
58 ll_find(ll_t
* const, void * const, int (*)(void const *, void const *));
61 ll_free(ll_t
* const list
, void (*clean
)(void *));
64 ll_destroy(ll_t
*list
, void (*clean
)(void *));