2 * Copyright (C) the libgit2 contributors. All rights reserved.
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_diff_file_h__
8 #define INCLUDE_diff_file_h__
12 #include "diff_driver.h"
15 /* expanded information for one side of a delta */
19 git_diff_driver
*driver
;
22 git_off_t opts_max_size
;
23 git_iterator_type_t src
;
26 } git_diff_file_content
;
28 extern int git_diff_file_content__init_from_diff(
29 git_diff_file_content
*fc
,
31 git_diff_delta
*delta
,
39 } git_diff_file_content_src
;
41 #define GIT_DIFF_FILE_CONTENT_SRC__BLOB(BLOB,PATH) { (BLOB),NULL,0,(PATH) }
42 #define GIT_DIFF_FILE_CONTENT_SRC__BUF(BUF,LEN,PATH) { NULL,(BUF),(LEN),(PATH) }
44 extern int git_diff_file_content__init_from_src(
45 git_diff_file_content
*fc
,
47 const git_diff_options
*opts
,
48 const git_diff_file_content_src
*src
,
49 git_diff_file
*as_file
);
51 /* this loads the blob/file-on-disk as needed */
52 extern int git_diff_file_content__load(
53 git_diff_file_content
*fc
,
54 git_diff_options
*diff_opts
);
56 /* this releases the blob/file-in-memory */
57 extern void git_diff_file_content__unload(git_diff_file_content
*fc
);
59 /* this unloads and also releases any other resources */
60 extern void git_diff_file_content__clear(git_diff_file_content
*fc
);