source: lib/trace_vector.h @ f1015ad

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

My work from over summer, with a few things tidied up and updated to include recent commits/patches to bring this up to date. Still very much work in progress.

  • Property mode set to 100644
File size: 967 bytes
Line 
1#include <pthread.h>
2#include "libtrace_int.h"
3
4#ifndef TRACE_VECTOR_H
5#define TRACE_VECTOR_H
6
7typedef struct libtrace_vector {
8        int max_size;
9        int size;
10        int element_size;
11        char *elements; // Means we can use array indexing
12        pthread_mutex_t lock;
13} libtrace_vector_t;
14
15DLLEXPORT inline void libtrace_vector_init(libtrace_vector_t *v, int element_size);
16DLLEXPORT inline void libtrace_vector_push_back(libtrace_vector_t *v, void *d);
17DLLEXPORT inline int libtrace_vector_get_size(libtrace_vector_t *v);
18DLLEXPORT inline int libtrace_vector_get(libtrace_vector_t *v, int location, void *d);
19DLLEXPORT inline void libtrace_vector_append(libtrace_vector_t *dest, libtrace_vector_t *src);
20DLLEXPORT inline void libtrace_vector_destroy(libtrace_vector_t *v);
21DLLEXPORT inline void libtrace_zero_vector(libtrace_vector_t *v);
22DLLEXPORT inline int libtrace_vector_remove_front(libtrace_vector_t *v);
23DLLEXPORT inline void libtrace_vector_empty(libtrace_vector_t *v);
24#endif
Note: See TracBrowser for help on using the repository browser.