(P)->cb.current = NAME_LC ## _iterator__current; \
(P)->cb.advance = NAME_LC ## _iterator__advance; \
(P)->cb.advance_into = NAME_LC ## _iterator__advance_into; \
- (P)->cb.seek = NAME_LC ## _iterator__seek; \
(P)->cb.reset = NAME_LC ## _iterator__reset; \
(P)->cb.at_end = NAME_LC ## _iterator__at_end; \
(P)->cb.free = NAME_LC ## _iterator__free; \
return GIT_ITEROVER;
}
-static int empty_iterator__seek(git_iterator *i, const char *p)
-{
- GIT_UNUSED(i); GIT_UNUSED(p);
- return -1;
-}
-
static int empty_iterator__reset(git_iterator *i, const char *s, const char *e)
{
GIT_UNUSED(i); GIT_UNUSED(s); GIT_UNUSED(e);
return tree_iterator__current(entry, self);
}
-static int tree_iterator__seek(git_iterator *self, const char *prefix)
-{
- GIT_UNUSED(self); GIT_UNUSED(prefix);
- return -1;
-}
-
static int tree_iterator__reset(
git_iterator *self, const char *start, const char *end)
{
return index_iterator__current(entry, self);
}
-static int index_iterator__seek(git_iterator *self, const char *prefix)
-{
- GIT_UNUSED(self); GIT_UNUSED(prefix);
- return -1;
-}
-
static int index_iterator__reset(
git_iterator *self, const char *start, const char *end)
{
return fs_iterator__advance_over(entry, self);
}
-static int fs_iterator__seek(git_iterator *self, const char *prefix)
-{
- GIT_UNUSED(self);
- GIT_UNUSED(prefix);
- /* pop stack until matching prefix */
- /* find prefix item in current frame */
- /* push subdirectories as deep as possible while matching */
- return 0;
-}
-
static int fs_iterator__reset(
git_iterator *self, const char *start, const char *end)
{
int (*current)(const git_index_entry **, git_iterator *);
int (*advance)(const git_index_entry **, git_iterator *);
int (*advance_into)(const git_index_entry **, git_iterator *);
- int (*seek)(git_iterator *, const char *prefix);
int (*reset)(git_iterator *, const char *start, const char *end);
int (*at_end)(git_iterator *);
void (*free)(git_iterator *);
return error;
}
-/* Seek is currently unimplemented */
-GIT_INLINE(int) git_iterator_seek(
- git_iterator *iter, const char *prefix)
-{
- return iter->cb->seek(iter, prefix);
-}
-
/**
* Go back to the start of the iteration.
*