view mercurial/bdiff.h @ 32658:55ff67ffcead

scmutil: introduce binnode(ctx) as paired function with intrev(ctx) It seemed silly to convert ctx.hex() back to binary to use node.hex/short(), or to use [:12] instead of node.short() because ctx.node() could be None. Eventually I want to change wctx.rev() and wctx.node() to return wdirrev and wdirid respectively, but that's quite big API breakage and can't be achieved without some compatibility wrappers.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 03 Jun 2017 19:12:01 +0900
parents 9631ff5ebbeb
children 72985b390d7c
line wrap: on
line source

#ifndef _HG_BDIFF_H_
#define _HG_BDIFF_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