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__
13 #include "diff_driver.h"
16 /* expanded information for one side of a delta */
20 git_diff_driver
*driver
;
23 git_object_size_t opts_max_size
;
27 } git_diff_file_content
;
29 extern int git_diff_file_content__init_from_diff(
30 git_diff_file_content
*fc
,
32 git_diff_delta
*delta
,
40 } git_diff_file_content_src
;
42 #define GIT_DIFF_FILE_CONTENT_SRC__BLOB(BLOB,PATH) { (BLOB),NULL,0,(PATH) }
43 #define GIT_DIFF_FILE_CONTENT_SRC__BUF(BUF,LEN,PATH) { NULL,(BUF),(LEN),(PATH) }
45 extern int git_diff_file_content__init_from_src(
46 git_diff_file_content
*fc
,
48 const git_diff_options
*opts
,
49 const git_diff_file_content_src
*src
,
50 git_diff_file
*as_file
);
52 /* this loads the blob/file-on-disk as needed */
53 extern int git_diff_file_content__load(
54 git_diff_file_content
*fc
,
55 git_diff_options
*diff_opts
);
57 /* this releases the blob/file-in-memory */
58 extern void git_diff_file_content__unload(git_diff_file_content
*fc
);
60 /* this unloads and also releases any other resources */
61 extern void git_diff_file_content__clear(git_diff_file_content
*fc
);