diff options
Diffstat (limited to 'src/vector.h')
| -rw-r--r-- | src/vector.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/vector.h b/src/vector.h index 44635ae14..180edbf7c 100644 --- a/src/vector.h +++ b/src/vector.h @@ -24,6 +24,7 @@ typedef struct git_vector { int git_vector_init(git_vector *v, unsigned int initial_size, git_vector_cmp cmp); void git_vector_free(git_vector *v); void git_vector_clear(git_vector *v); +void git_vector_swap(git_vector *a, git_vector *b); int git_vector_search(git_vector *v, const void *entry); int git_vector_search2(git_vector *v, git_vector_cmp cmp, const void *key); @@ -38,6 +39,11 @@ GIT_INLINE(void *) git_vector_get(git_vector *v, unsigned int position) return (position < v->length) ? v->contents[position] : NULL; } +GIT_INLINE(const void *) git_vector_get_const(const git_vector *v, unsigned int position) +{ + return (position < v->length) ? v->contents[position] : NULL; +} + GIT_INLINE(void *) git_vector_last(git_vector *v) { return (v->length > 0) ? git_vector_get(v, v->length - 1) : NULL; |
