summaryrefslogtreecommitdiff
path: root/xdiff-interface.h
diff options
context:
space:
mode:
authorRené Scharfe <rene.scharfe@lsrfire.ath.cx>2008-10-25 15:31:15 +0200
committerJunio C Hamano <gitster@pobox.com>2008-10-25 12:09:31 -0700
commit86295bb6bac1482d29650d1f77f19d8e7a7cc2fe (patch)
tree8d64f0afe14423d04da9414a1dbaa809c1f15e3b /xdiff-interface.h
parentef2e62fe23173586f49a00c6ae953ebbdb0d13ab (diff)
downloadgit-86295bb6bac1482d29650d1f77f19d8e7a7cc2fe.tar.gz
add xdi_diff_hunks() for callers that only need hunk lengths
Based on a patch by Brian Downing, this uses the xdiff emit_func feature to implement xdi_diff_hunks(). It's a function that calls a callback for each hunk of a diff, passing its lengths. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'xdiff-interface.h')
-rw-r--r--xdiff-interface.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/xdiff-interface.h b/xdiff-interface.h
index eaf9cd3498..7352b9a9c2 100644
--- a/xdiff-interface.h
+++ b/xdiff-interface.h
@@ -4,12 +4,16 @@
#include "xdiff/xdiff.h"
typedef void (*xdiff_emit_consume_fn)(void *, char *, unsigned long);
+typedef void (*xdiff_emit_hunk_consume_fn)(void *, long, long, long);
int xdi_diff(mmfile_t *mf1, mmfile_t *mf2, xpparam_t const *xpp, xdemitconf_t const *xecfg, xdemitcb_t *ecb);
int xdi_diff_outf(mmfile_t *mf1, mmfile_t *mf2,
xdiff_emit_consume_fn fn, void *consume_callback_data,
xpparam_t const *xpp,
xdemitconf_t const *xecfg, xdemitcb_t *xecb);
+int xdi_diff_hunks(mmfile_t *mf1, mmfile_t *mf2,
+ xdiff_emit_hunk_consume_fn fn, void *consume_callback_data,
+ xpparam_t const *xpp, xdemitconf_t *xecfg);
int parse_hunk_header(char *line, int len,
int *ob, int *on,
int *nb, int *nn);