]>
git.proxmox.com Git - libgit2.git/blob - src/filter.h
2 * Copyright (C) 2009-2012 the libgit2 contributors
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.
7 #ifndef INCLUDE_filter_h__
8 #define INCLUDE_filter_h__
13 #include "git2/repository.h"
15 typedef int (*git_filter_cb
)(git_buf
*dest
, const git_buf
*source
, const char *filename
);
18 GIT_FILTER_TO_WORKTREE
,
30 GIT_SAFE_CRLF_FALSE
= 0,
31 GIT_SAFE_CRLF_FAIL
= 1,
32 GIT_SAFE_CRLF_WARN
= 2,
34 GIT_AUTO_CRLF_FALSE
= 0,
35 GIT_AUTO_CRLF_TRUE
= 1,
36 GIT_AUTO_CRLF_INPUT
= -1,
44 GIT_EOL_NATIVE
= GIT_EOL_CRLF
46 GIT_EOL_NATIVE
= GIT_EOL_LF
58 /* NUL, CR, LF and CRLF counts */
59 unsigned int nul
, cr
, lf
, crlf
;
61 /* These are just approximations! */
62 unsigned int printable
, nonprintable
;
65 extern int git_filter__load_for_file(git_vector
*filters
, git_repository
*repo
, const char *full_path
, int mode
);
66 extern int git_filter__load_attrs(git_conv_attrs
*ca
, git_repository
*repo
, const char *path
);
67 extern int git_filter__apply(git_buf
*dest
, git_buf
*source
, git_vector
*filters
, const char *filename
);
69 /* Gather stats for a piece of text */
70 extern void git_text__stat(git_text_stats
*stats
, git_buf
*text
);
72 /* Heuristics on a set of text stats to check whether it's binary
74 extern int git_text__is_binary(git_text_stats
*stats
);