]> git.proxmox.com Git - libgit2.git/blob - src/delta-apply.h
Merge pull request #392 from sschuberth/development
[libgit2.git] / src / delta-apply.h
1 /*
2 * Copyright (C) 2009-2011 the libgit2 contributors
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_delta_apply_h__
8 #define INCLUDE_delta_apply_h__
9
10 #include "odb.h"
11
12 /**
13 * Apply a git binary delta to recover the original content.
14 *
15 * @param out the output buffer to receive the original data.
16 * Only out->data and out->len are populated, as this is
17 * the only information available in the delta.
18 * @param base the base to copy from during copy instructions.
19 * @param base_len number of bytes available at base.
20 * @param delta the delta to execute copy/insert instructions from.
21 * @param delta_len total number of bytes in the delta.
22 * @return
23 * - GIT_SUCCESS on a successful delta unpack.
24 * - GIT_ERROR if the delta is corrupt or doesn't match the base.
25 */
26 extern int git__delta_apply(
27 git_rawobj *out,
28 const unsigned char *base,
29 size_t base_len,
30 const unsigned char *delta,
31 size_t delta_len);
32
33 #endif