summaryrefslogtreecommitdiff
path: root/src/iterator.h
diff options
context:
space:
mode:
authorPhilip Kelley <phkelley@hotmail.com>2012-09-17 15:42:41 -0400
committerPhilip Kelley <phkelley@hotmail.com>2012-09-17 15:42:41 -0400
commitec40b7f99f7f7161b0a1b24f1d8a934ec0eaacb1 (patch)
tree59744c10038258c3993a4eb1b1dfc3896c35b97a /src/iterator.h
parente8776d30f7edb570f435cf746d712c696b862bdd (diff)
downloadlibgit2-ec40b7f99f7f7161b0a1b24f1d8a934ec0eaacb1.tar.gz
Support for core.ignorecase
Diffstat (limited to 'src/iterator.h')
-rw-r--r--src/iterator.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/iterator.h b/src/iterator.h
index b916a9080..552d5ca0e 100644
--- a/src/iterator.h
+++ b/src/iterator.h
@@ -9,6 +9,11 @@
#include "common.h"
#include "git2/index.h"
+#include "vector.h"
+
+#define ITERATOR_PREFIXCMP(ITER, STR, PREFIX) (((ITER) ## .ignore_case) ? \
+ git__prefixcmp_icase((STR), (PREFIX)) : \
+ git__prefixcmp((STR), (PREFIX)))
typedef struct git_iterator git_iterator;
@@ -16,7 +21,8 @@ typedef enum {
GIT_ITERATOR_EMPTY = 0,
GIT_ITERATOR_TREE = 1,
GIT_ITERATOR_INDEX = 2,
- GIT_ITERATOR_WORKDIR = 3
+ GIT_ITERATOR_WORKDIR = 3,
+ GIT_ITERATOR_SPOOLANDSORT = 4
} git_iterator_type_t;
struct git_iterator {
@@ -29,6 +35,7 @@ struct git_iterator {
int (*seek)(git_iterator *, const char *prefix);
int (*reset)(git_iterator *);
void (*free)(git_iterator *);
+ unsigned int ignore_case:1;
};
extern int git_iterator_for_nothing(git_iterator **iter);
@@ -63,6 +70,17 @@ GIT_INLINE(int) git_iterator_for_workdir(
return git_iterator_for_workdir_range(iter, repo, NULL, NULL);
}
+extern int git_iterator_spoolandsort_range(
+ git_iterator **iter, git_iterator *towrap,
+ git_vector_cmp comparer, bool ignore_case,
+ const char *start, const char *end);
+
+GIT_INLINE(int) git_iterator_spoolandsort(
+ git_iterator **iter, git_iterator *towrap,
+ git_vector_cmp comparer, bool ignore_case)
+{
+ return git_iterator_spoolandsort_range(iter, towrap, comparer, ignore_case, NULL, NULL);
+}
/* Entry is not guaranteed to be fully populated. For a tree iterator,
* we will only populate the mode, oid and path, for example. For a workdir