forked from vieter-v/libvieter
20 lines
440 B
C
20 lines
440 B
C
#ifndef VIETER_DYNARRAY
|
|
#define VIETER_DYNARRAY
|
|
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
typedef struct dyn_array DynArray;
|
|
|
|
DynArray *dynarray_init(size_t initial_capacity);
|
|
void dynarray_add(DynArray *da, const char * s);
|
|
void dynarray_free(DynArray *da);
|
|
|
|
/**
|
|
* Convert a DynArray into an array by freeing all its surrounding components
|
|
* and returning the underlying array pointer.
|
|
*/
|
|
char **dynarray_convert(DynArray *da);
|
|
|
|
#endif
|