#ifndef INCLUDE_pathspec_h__
#define INCLUDE_pathspec_h__
#include "common.h"
#include <git2/pathspec.h>
#include "buffer.h"
#include "vector.h"
#include "pool.h"
#include "array.h"
struct git_pathspec {
git_refcount rc;
char *prefix;
git_vector pathspec;
git_pool pool;
};
enum {
PATHSPEC_DATATYPE_STRINGS = 0,
PATHSPEC_DATATYPE_DIFF = 1,
};
typedef git_array_t(char *) git_pathspec_string_array_t;
struct git_pathspec_match_list {
git_pathspec *pathspec;
git_array_t(void *) matches;
git_pathspec_string_array_t failures;
git_pool pool;
int datatype;
};
extern char *git_pathspec_prefix(const git_strarray *pathspec);
extern bool git_pathspec_is_empty(const git_strarray *pathspec);
extern int git_pathspec__vinit(
git_vector *vspec, const git_strarray *strspec, git_pool *strpool);
extern void git_pathspec__vfree(git_vector *vspec);
#define GIT_PATHSPEC_NOMATCH ((size_t)-1)
extern bool git_pathspec__match(
const git_vector *vspec,
const char *path,
bool disable_fnmatch,
bool casefold,
const char **matched_pathspec,
size_t *matched_at);
extern int git_pathspec__init(git_pathspec *ps, const git_strarray *paths);
extern void git_pathspec__clear(git_pathspec *ps);
#endif