source: lib/data-struct/vector.h @ d6a56b6

4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivelibtrace4ndag_formatpfringrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change on this file since d6a56b6 was d6a56b6, checked in by Richard Sanger <rsangerarj@…>, 8 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: 1016 bytes
Line 
1#include <pthread.h>
2/* Need libtrace.h for DLLEXPORT defines */
3#include "../libtrace.h"
4
5#ifndef LIBTRACE_VECTOR_H
6#define LIBTRACE_VECTOR_H
7
8typedef struct libtrace_vector {
9        int max_size;
10        int size;
11        int element_size;
12        char *elements; // Means we can use array indexing
13        pthread_mutex_t lock;
14} libtrace_vector_t;
15
16DLLEXPORT inline void libtrace_vector_init(libtrace_vector_t *v, int element_size);
17DLLEXPORT inline void libtrace_vector_push_back(libtrace_vector_t *v, void *d);
18DLLEXPORT inline int libtrace_vector_get_size(libtrace_vector_t *v);
19DLLEXPORT inline int libtrace_vector_get(libtrace_vector_t *v, int location, void *d);
20DLLEXPORT inline void libtrace_vector_append(libtrace_vector_t *dest, libtrace_vector_t *src);
21DLLEXPORT inline void libtrace_vector_destroy(libtrace_vector_t *v);
22DLLEXPORT inline void libtrace_zero_vector(libtrace_vector_t *v);
23DLLEXPORT inline int libtrace_vector_remove_front(libtrace_vector_t *v);
24DLLEXPORT inline void libtrace_vector_empty(libtrace_vector_t *v);
25#endif
Note: See TracBrowser for help on using the repository browser.