combine-diff: refactor built-in xdiff interface.

This refactors the line-by-line callback mechanism used in
combine-diff so that other programs can reuse it more easily.

Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Junio C Hamano
2006-04-05 02:03:58 -07:00
parent f23fc773a2
commit d9ea73e056
4 changed files with 84 additions and 46 deletions

18
xdiff-interface.h Normal file
View File

@ -0,0 +1,18 @@
#ifndef XDIFF_INTERFACE_H
#define XDIFF_INTERFACE_H
#include "xdiff/xdiff.h"
struct xdiff_emit_state;
typedef void (*xdiff_emit_consume_fn)(void *, char *, unsigned long);
struct xdiff_emit_state {
xdiff_emit_consume_fn consume;
char *remainder;
unsigned long remainder_size;
};
int xdiff_outf(void *priv_, mmbuffer_t *mb, int nbuf);
#endif