diff options
Diffstat (limited to 'include/git2/common.h')
-rw-r--r-- | include/git2/common.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/git2/common.h b/include/git2/common.h index 34efe808b..11a08f897 100644 --- a/include/git2/common.h +++ b/include/git2/common.h @@ -27,6 +27,7 @@ #include "thread-utils.h" #include <time.h> +#include <stdlib.h> #ifdef __cplusplus # define GIT_BEGIN_DECL extern "C" { @@ -158,6 +159,21 @@ #define GIT_EINVALIDREFSTATE (GIT_ERROR - 21) GIT_BEGIN_DECL + +typedef struct { + char **strings; + size_t count; +} git_strarray; + +GIT_INLINE(void) git_strarray_free(git_strarray *array) +{ + size_t i; + for (i = 0; i < array->count; ++i) + free(array->strings[i]); + + free(array->strings); +} + /** @} */ GIT_END_DECL #endif |