]>
git.proxmox.com Git - libgit2.git/blob - src/patch_parse.h
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_patch_parse_h__
8 #define INCLUDE_patch_parse_h__
18 git_patch_options opts
;
20 git_parse_ctx parse_ctx
;
21 } git_patch_parse_ctx
;
23 extern git_patch_parse_ctx
*git_patch_parse_ctx_init(
26 const git_patch_options
*opts
);
28 extern void git_patch_parse_ctx_free(git_patch_parse_ctx
*ctx
);
31 * Create a patch for a single file from the contents of a patch buffer.
33 * @param out The patch to be created
34 * @param contents The contents of a patch file
35 * @param contents_len The length of the patch file
36 * @param opts The git_patch_options
37 * @return 0 on success, <0 on failure.
39 extern int git_patch_from_buffer(
43 const git_patch_options
*opts
);
45 extern int git_patch_parse(
47 git_patch_parse_ctx
*ctx
);
49 extern int git_patch_parsed_from_diff(git_patch
**, git_diff
*, size_t);