source: lib/data-struct/linked_list.h @ 6a082f8

4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivelibtrace4ndag_formatpfringrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change on this file since 6a082f8 was cb39d35, checked in by Dan Collins <dan@…>, 6 years ago

Moved DAG format to better support parallel and non-parallel API

Format data per stream is now stored in a linked list. This allows us to
add multiple per stream blocks for each additional stream, while still supporting
the original API. This greatly reduces code duplication and, to a minor extent,
RAM usage.

  • Property mode set to 100644
File size: 974 bytes
Line 
1#include "../libtrace.h"
2
3#ifndef LIBTRACE_LIST_H
4#define LIBTRACE_LIST_H
5
6typedef struct list_node libtrace_list_node_t;
7struct list_node {
8        void *data;
9        libtrace_list_node_t *next;
10        libtrace_list_node_t *prev;
11};
12
13typedef struct libtrace_list {
14        libtrace_list_node_t *head;
15        libtrace_list_node_t *tail;
16        size_t size;
17        size_t element_size;
18} libtrace_list_t;
19
20DLLEXPORT libtrace_list_t *libtrace_list_init(size_t element_size);
21DLLEXPORT void libtrace_list_deinit(libtrace_list_t *l);
22
23DLLEXPORT void libtrace_list_push_front(libtrace_list_t *l, void *item);
24DLLEXPORT void libtrace_list_push_back(libtrace_list_t *l, void *item);
25DLLEXPORT int libtrace_list_pop_front(libtrace_list_t *l, void *item);
26DLLEXPORT int libtrace_list_pop_back(libtrace_list_t *l, void *item);
27
28DLLEXPORT libtrace_list_node_t *libtrace_list_get_index(libtrace_list_t *list,
29                                                        size_t index);
30
31DLLEXPORT size_t libtrace_list_get_size(libtrace_list_t *l);
32
33#endif /* LIBTRACE_LINKED_LIST_H */
Note: See TracBrowser for help on using the repository browser.