mercurial/bdiff.h
author Pierre-Yves David <pierre-yves.david@octobus.net>
Mon, 20 Nov 2023 04:44:40 +0100
changeset 51320 c82e03b102a6
parent 48274 d86908050375
permissions -rw-r--r--
delta-find: introduce a _DeltaSearch object That object represent the search of a good delta for one revision. It will replace the interleaved generator currently in use. It will make the logic more explicit and easier to split into different subclass for the algorithm variant. We will move content gradually before doing deeper rework. For now, we only move the `_candidategroups` function here. More will follow in the same series.

#ifndef HG_BDIFF_H
#define HG_BDIFF_H

#include "compat.h"

struct bdiff_line {
	int hash, n, e;
	ssize_t len;
	const char *l;
};

struct bdiff_hunk;
struct bdiff_hunk {
	int a1, a2, b1, b2;
	struct bdiff_hunk *next;
};

int bdiff_splitlines(const char *a, ssize_t len, struct bdiff_line **lr);
int bdiff_diff(struct bdiff_line *a, int an, struct bdiff_line *b, int bn,
               struct bdiff_hunk *base);
void bdiff_freehunks(struct bdiff_hunk *l);

#endif