]>
Commit | Line | Data |
---|---|---|
114f5a6c RB |
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_diff_driver_h__ | |
8 | #define INCLUDE_diff_driver_h__ | |
9 | ||
10 | #include "common.h" | |
eae0bfdc PP |
11 | |
12 | #include "attr_file.h" | |
e579e0f7 | 13 | #include "str.h" |
114f5a6c RB |
14 | |
15 | typedef struct git_diff_driver_registry git_diff_driver_registry; | |
16 | ||
596b121a | 17 | git_diff_driver_registry *git_diff_driver_registry_new(void); |
114f5a6c RB |
18 | void git_diff_driver_registry_free(git_diff_driver_registry *); |
19 | ||
20 | typedef struct git_diff_driver git_diff_driver; | |
21 | ||
eae0bfdc PP |
22 | int git_diff_driver_lookup(git_diff_driver **, git_repository *, |
23 | git_attr_session *attrsession, const char *); | |
114f5a6c RB |
24 | void git_diff_driver_free(git_diff_driver *); |
25 | ||
5dc98298 RB |
26 | /* diff option flags to force off and on for this driver */ |
27 | void git_diff_driver_update_options(uint32_t *option_flags, git_diff_driver *); | |
114f5a6c RB |
28 | |
29 | /* returns -1 meaning "unknown", 0 meaning not binary, 1 meaning binary */ | |
30 | int git_diff_driver_content_is_binary( | |
31 | git_diff_driver *, const char *content, size_t content_len); | |
32 | ||
33 | typedef long (*git_diff_find_context_fn)( | |
34 | const char *, long, char *, long, void *); | |
35 | ||
5dc98298 | 36 | typedef int (*git_diff_find_context_line)( |
e579e0f7 | 37 | git_diff_driver *, git_str *); |
5dc98298 RB |
38 | |
39 | typedef struct { | |
40 | git_diff_driver *driver; | |
41 | git_diff_find_context_line match_line; | |
e579e0f7 | 42 | git_str line; |
5dc98298 RB |
43 | } git_diff_find_context_payload; |
44 | ||
45 | void git_diff_find_context_init( | |
46 | git_diff_find_context_fn *findfn_out, | |
47 | git_diff_find_context_payload *payload_out, | |
48 | git_diff_driver *driver); | |
49 | ||
50 | void git_diff_find_context_clear(git_diff_find_context_payload *); | |
114f5a6c RB |
51 | |
52 | #endif |