src/util/patch-fast.h (view raw)
1/* Copyright (c) 2013-2016 Jeffrey Pfau
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6#ifndef PATCH_FAST_H
7#define PATCH_FAST_H
8
9#include "util/common.h"
10
11#include "util/patch.h"
12#include "util/vector.h"
13
14#define PATCH_FAST_EXTENT 256
15
16struct PatchFastExtent {
17 size_t length;
18 size_t offset;
19 uint32_t extent[PATCH_FAST_EXTENT];
20};
21
22DECLARE_VECTOR(PatchFastExtents, struct PatchFastExtent);
23
24struct PatchFast {
25 struct Patch d;
26
27 struct PatchFastExtents extents;
28};
29
30void initPatchFast(struct PatchFast*);
31void deinitPatchFast(struct PatchFast*);
32bool diffPatchFast(struct PatchFast* patch, const void* restrict in, const void* restrict out, size_t size);
33
34#endif