source: lib/data-struct/deque.h @ fb1fd42

4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivelibtrace4ndag_formatpfringrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change on this file since fb1fd42 was d6a56b6, checked in by Richard Sanger <rsangerarj@…>, 7 years ago

Move the data structures out of the way and into there own folder and tidy file naming.

  • Property mode set to 100644
File size: 850 bytes
Line 
1#include <pthread.h>
2
3#ifndef LIBTRACE_DEQUE_H
4#define LIBTRACE_DEQUE_H
5
6typedef struct list_node list_node_t;
7typedef struct libtrace_queue {
8        list_node_t * head;
9        list_node_t * tail;
10        pthread_mutex_t lock;
11        int size;
12        int element_size;
13} libtrace_queue_t;
14
15void libtrace_deque_init(libtrace_queue_t * q, int element_size);
16inline void libtrace_deque_push_back(libtrace_queue_t *q, void *d);
17inline void libtrace_deque_push_front(libtrace_queue_t *q, void *d);
18inline int libtrace_deque_get_size(libtrace_queue_t *q);
19
20inline int libtrace_deque_peek_front(libtrace_queue_t *q, void *d);
21inline int libtrace_deque_peek_tail(libtrace_queue_t *q, void *d);
22inline int libtrace_deque_pop_front(libtrace_queue_t *q, void *d);
23inline int libtrace_deque_pop_tail(libtrace_queue_t *q, void *d);
24inline void libtrace_zero_deque(libtrace_queue_t *q);
25
26#endif
Note: See TracBrowser for help on using the repository browser.