summaryrefslogtreecommitdiff
path: root/src/vector.h
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2014-02-07 11:20:36 -0800
committerRussell Belfer <rb@github.com>2014-04-17 14:43:45 -0700
commitc67fd4c9d5e1ff715df28b884d7f7f9f20fad1ec (patch)
tree831176f87c09d36816a83ef5617623fd372f5e50 /src/vector.h
parentc5cacc4ec2c13e93164b8e3013b0d18c8c6d820c (diff)
downloadlibgit2-c67fd4c9d5e1ff715df28b884d7f7f9f20fad1ec.tar.gz
Some vector utility tweaks
This is just laying some groundwork for internal index changes that I'm working on.
Diffstat (limited to 'src/vector.h')
-rw-r--r--src/vector.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/vector.h b/src/vector.h
index 682b6ad27..aac46c4b3 100644
--- a/src/vector.h
+++ b/src/vector.h
@@ -85,8 +85,11 @@ int git_vector_insert_sorted(git_vector *v, void *element,
int git_vector_remove(git_vector *v, size_t idx);
void git_vector_pop(git_vector *v);
void git_vector_uniq(git_vector *v, void (*git_free_cb)(void *));
+
void git_vector_remove_matching(
- git_vector *v, int (*match)(const git_vector *v, size_t idx));
+ git_vector *v,
+ int (*match)(const git_vector *v, size_t idx, void *payload),
+ void *payload);
int git_vector_resize_to(git_vector *v, size_t new_length);
int git_vector_set(void **old, git_vector *v, size_t position, void *value);
@@ -108,4 +111,7 @@ GIT_INLINE(void) git_vector_set_cmp(git_vector *v, git_vector_cmp cmp)
}
}
+/* Just use this in tests, not for realz. returns -1 if not sorted */
+int git_vector_verify_sorted(const git_vector *v);
+
#endif