WAND Trace processing  4.0.5
linked_list.h
1 /*
2  *
3  * Copyright (c) 2007-2016 The University of Waikato, Hamilton, New Zealand.
4  * All rights reserved.
5  *
6  * This file is part of libtrace.
7  *
8  * This code has been developed by the University of Waikato WAND
9  * research group. For further information please see http://www.wand.net.nz/
10  *
11  * libtrace is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License as published by
13  * the Free Software Foundation; either version 3 of the License, or
14  * (at your option) any later version.
15  *
16  * libtrace is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Lesser General Public License for more details.
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * along with this program. If not, see <http://www.gnu.org/licenses/>.
23  *
24  *
25  */
26 #include "libtrace.h"
27 
28 #ifndef LIBTRACE_LIST_H
29 #define LIBTRACE_LIST_H
30 
31 typedef struct list_node libtrace_list_node_t;
32 struct list_node {
33  void *data;
34  libtrace_list_node_t *next;
35  libtrace_list_node_t *prev;
36 };
37 
38 typedef struct libtrace_list {
39  libtrace_list_node_t *head;
40  libtrace_list_node_t *tail;
41  size_t size;
42  size_t element_size;
44 
45 DLLEXPORT libtrace_list_t *libtrace_list_init(size_t element_size);
46 DLLEXPORT void libtrace_list_deinit(libtrace_list_t *l);
47 
48 DLLEXPORT void libtrace_list_push_front(libtrace_list_t *l, void *item);
49 DLLEXPORT void libtrace_list_push_back(libtrace_list_t *l, void *item);
50 DLLEXPORT int libtrace_list_pop_front(libtrace_list_t *l, void *item);
51 DLLEXPORT int libtrace_list_pop_back(libtrace_list_t *l, void *item);
52 
53 DLLEXPORT libtrace_list_node_t *libtrace_list_get_index(libtrace_list_t *list,
54  size_t index);
55 
56 DLLEXPORT size_t libtrace_list_get_size(libtrace_list_t *l);
57 
58 #endif /* LIBTRACE_LINKED_LIST_H */
Trace file processing library header.
Definition: linked_list.h:38