]> git.proxmox.com Git - libgit2.git/blob - src/filter.h
Merge pull request #2907 from jasonhaslam/git_packfile_unpack_race
[libgit2.git] / src / filter.h
1 /*
2 * Copyright (C) the libgit2 contributors. All rights reserved.
3 *
4 * This file is part of libgit2, distributed under the GNU GPL v2 with
5 * a Linking Exception. For full terms see the included COPYING file.
6 */
7 #ifndef INCLUDE_filter_h__
8 #define INCLUDE_filter_h__
9
10 #include "common.h"
11 #include "attr_file.h"
12 #include "git2/filter.h"
13
14 /* Amount of file to examine for NUL byte when checking binary-ness */
15 #define GIT_FILTER_BYTES_TO_CHECK_NUL 8000
16
17 /* Possible CRLF values */
18 typedef enum {
19 GIT_CRLF_GUESS = -1,
20 GIT_CRLF_BINARY = 0,
21 GIT_CRLF_TEXT,
22 GIT_CRLF_INPUT,
23 GIT_CRLF_CRLF,
24 GIT_CRLF_AUTO,
25 } git_crlf_t;
26
27 typedef struct {
28 git_attr_session *attr_session;
29 git_buf *temp_buf;
30 uint32_t flags;
31 } git_filter_options;
32
33 #define GIT_FILTER_OPTIONS_INIT {0}
34
35 extern void git_filter_free(git_filter *filter);
36
37 extern int git_filter_list__load_ext(
38 git_filter_list **filters,
39 git_repository *repo,
40 git_blob *blob, /* can be NULL */
41 const char *path,
42 git_filter_mode_t mode,
43 git_filter_options *filter_opts);
44
45 /*
46 * Available filters
47 */
48
49 extern git_filter *git_crlf_filter_new(void);
50 extern git_filter *git_ident_filter_new(void);
51
52 #endif