Make xdi_diff_outf interface for running xdiff_outf diffs

To prepare for the need to initialize and release resources for an
xdi_diff with the xdiff_outf output function, make a new function to
wrap this usage.

Old:

	ecb.outf = xdiff_outf;
	ecb.priv = &state;
	...
	xdi_diff(file_p, file_o, &xpp, &xecfg, &ecb);

New:

	xdi_diff_outf(file_p, file_o, &state.xm, &xpp, &xecfg, &ecb);

Signed-off-by: Brian Downing <bdowning@lavos.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Brian Downing
2008-08-14 00:36:50 -05:00
committed by Junio C Hamano
parent a0653d5505
commit c99db9d292
5 changed files with 23 additions and 23 deletions

View File

@ -528,15 +528,13 @@ static struct patch *compare_buffer(mmfile_t *file_p, mmfile_t *file_o,
xpp.flags = xdl_opts;
memset(&xecfg, 0, sizeof(xecfg));
xecfg.ctxlen = context;
ecb.outf = xdiff_outf;
ecb.priv = &state;
memset(&state, 0, sizeof(state));
state.xm.consume = process_u_diff;
state.ret = xmalloc(sizeof(struct patch));
state.ret->chunks = NULL;
state.ret->num = 0;
xdi_diff(file_p, file_o, &xpp, &xecfg, &ecb);
xdi_diff_outf(file_p, file_o, &state.xm, &xpp, &xecfg, &ecb);
if (state.ret->num) {
struct chunk *chunk;