]>
git.proxmox.com Git - libgit2.git/blob - src/delta-apply.h
2 * Copyright (C) 2009-2012 the libgit2 contributors
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_delta_apply_h__
8 #define INCLUDE_delta_apply_h__
13 * Apply a git binary delta to recover the original content.
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.
23 * - 0 on a successful delta unpack.
24 * - GIT_ERROR if the delta is corrupt or doesn't match the base.
26 extern int git__delta_apply(
28 const unsigned char *base
,
30 const unsigned char *delta
,
34 * Read the header of a git binary delta.
36 * @param delta the delta to execute copy/insert instructions from.
37 * @param delta_len total number of bytes in the delta.
38 * @param base_sz pointer to store the base size field.
39 * @param res_sz pointer to store the result size field.
41 * - 0 on a successful decoding the header.
42 * - GIT_ERROR if the delta is corrupt.
44 extern int git__delta_read_header(
45 const unsigned char *delta
,