summaryrefslogtreecommitdiff
path: root/include/git2/common.h
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2011-03-12 16:04:46 +0200
committerVicent Marti <tanoku@gmail.com>2011-03-14 23:52:32 +0200
commit005718280712634486a097427212e652b0e29f36 (patch)
tree00aba58f1f723bee77a251382cc3e407e2840fa5 /include/git2/common.h
parent58d06cf120eb9bb9247bb807bb105981bb3482a8 (diff)
downloadlibgit2-005718280712634486a097427212e652b0e29f36.tar.gz
Add new method `git_reference_listall`
Lists all the references in a repository. Listing may be filtered by reference type. This should applease Lord Clem.
Diffstat (limited to 'include/git2/common.h')
-rw-r--r--include/git2/common.h16
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