diff options
| author | Russell Belfer <arrbee@arrbee.com> | 2011-12-30 15:00:14 -0800 |
|---|---|---|
| committer | Russell Belfer <arrbee@arrbee.com> | 2011-12-30 15:00:14 -0800 |
| commit | bd370b14fefdba3844a9bf0bbf87171ca48f49be (patch) | |
| tree | b16a3e4ee778d33fb7782b26c7cffb3068b63087 /src/util.h | |
| parent | c6d2a2c0946ff32c16578b68b39824f4fea8f782 (diff) | |
| download | libgit2-bd370b14fefdba3844a9bf0bbf87171ca48f49be.tar.gz | |
Improved gitattributes macro implementation
This updates to implementation of gitattribute macros to be much more
similar to core git (albeit not 100%) and to handle expansion of
macros within macros, etc. It also cleans up the refcounting usage
with macros to be much cleaner.
Also, this adds a new vector function `git_vector_insert_sorted()`
which allows you to maintain a sorted list as you go. In order to
write that function, this changes the function `git__bsearch()` to
take a somewhat different set of parameters, although the core
functionality is still the same.
Diffstat (limited to 'src/util.h')
| -rw-r--r-- | src/util.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/util.h b/src/util.h index 4b1104b7b..2367bb5f3 100644 --- a/src/util.h +++ b/src/util.h @@ -105,8 +105,13 @@ extern void git__strtolower(char *str); extern int git__fnmatch(const char *pattern, const char *name, int flags); extern void git__tsort(void **dst, size_t size, int (*cmp)(const void *, const void *)); -extern void **git__bsearch(const void *key, void **base, size_t nmemb, - int (*compar)(const void *, const void *)); + +extern int git__bsearch( + void **array, + size_t array_len, + const void *key, + int (*compare)(const void *, const void *), + size_t *position); extern int git__strcmp_cb(const void *a, const void *b); |
