diff options
Diffstat (limited to 'desktop/vector.h')
-rw-r--r-- | desktop/vector.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/desktop/vector.h b/desktop/vector.h new file mode 100644 index 0000000..c9e9c98 --- /dev/null +++ b/desktop/vector.h @@ -0,0 +1,23 @@ +/** + * Based on https://gist.github.com/EmilHernvall/953968 + */ + +#ifndef VECTOR_H__ +#define VECTOR_H__ + +typedef struct vector_ { + void **data; + int size; + int count; +} vector; + +vector * vector_create(); +int vector_count(vector *); +void vector_add(vector *, void *); +void vector_set(vector *, int, void *); +void *vector_get(vector *, int); +void vector_delete(vector*, int); +void vector_free_data(vector *); +void vector_free(vector *); + +#endif |