4 #include "sha1-array.h"
7 #include "parse-options.h"
13 #define QUOTE_PYTHON 4
18 unsigned long ul
; /* used for sorting when not FIELD_STR */
22 struct ref_sorting
*next
;
23 int atom
; /* index into used_atom array (internal) */
27 struct ref_array_item
{
28 unsigned char objectname
[20];
31 struct atom_value
*value
;
37 struct ref_array_item
**items
;
41 const char **name_patterns
;
44 struct ref_filter_cbdata
{
45 struct ref_array array
;
46 struct ref_filter filter
;
49 /* Callback function for for_each_*ref(). This filters the refs based on the filters set */
50 int ref_filter_handler(const char *refname
, const struct object_id
*oid
, int flag
, void *cb_data
);
51 /* Clear all memory allocated to ref_array */
52 void ref_array_clear(struct ref_array
*array
);
53 /* Parse format string and sort specifiers */
54 int parse_ref_filter_atom(const char *atom
, const char *ep
);
55 /* Used to verify if the given format is correct and to parse out the used atoms */
56 int verify_ref_format(const char *format
);
57 /* Sort the given ref_array as per the ref_sorting provided */
58 void ref_array_sort(struct ref_sorting
*sort
, struct ref_array
*array
);
59 /* Print the ref using the given format and quote_style */
60 void show_ref_array_item(struct ref_array_item
*info
, const char *format
, int quote_style
);
61 /* Callback function for parsing the sort option */
62 int parse_opt_ref_sorting(const struct option
*opt
, const char *arg
, int unset
);
63 /* Default sort option based on refname */
64 struct ref_sorting
*ref_default_sorting(void);
66 #endif /* REF_FILTER_H */