#ifndef REF_FILTER_H
#define REF_FILTER_H
#include "sha1-array.h"
#include "refs.h"
#include "commit.h"
#include "parse-options.h"
#define QUOTE_NONE 0
#define QUOTE_SHELL 1
#define QUOTE_PERL 2
#define QUOTE_PYTHON 4
#define QUOTE_TCL 8
#define FILTER_REFS_INCLUDE_BROKEN 0x1
#define FILTER_REFS_ALL 0x2
struct atom_value {
const char *s;
unsigned long ul;
};
struct ref_sorting {
struct ref_sorting *next;
int atom;
unsigned reverse : 1;
};
struct ref_array_item {
unsigned char objectname[20];
int flag;
const char *symref;
struct atom_value *value;
char refname[FLEX_ARRAY];
};
struct ref_array {
int nr, alloc;
struct ref_array_item **items;
};
struct ref_filter {
const char **name_patterns;
};
struct ref_filter_cbdata {
struct ref_array *array;
struct ref_filter *filter;
};
int filter_refs(struct ref_array *array, struct ref_filter *filter, unsigned int type);
void ref_array_clear(struct ref_array *array);
int parse_ref_filter_atom(const char *atom, const char *ep);
int verify_ref_format(const char *format);
void ref_array_sort(struct ref_sorting *sort, struct ref_array *array);
void show_ref_array_item(struct ref_array_item *info, const char *format, int quote_style);
int parse_opt_ref_sorting(const struct option *opt, const char *arg, int unset);
struct ref_sorting *ref_default_sorting(void);
#endif