Show More
@@ -48,6 +48,9 b' extern "C" {' | |||||
48 | /* xdemitconf_t.flags */ |
|
48 | /* xdemitconf_t.flags */ | |
49 | #define XDL_EMIT_FUNCNAMES (1 << 0) |
|
49 | #define XDL_EMIT_FUNCNAMES (1 << 0) | |
50 | #define XDL_EMIT_FUNCCONTEXT (1 << 2) |
|
50 | #define XDL_EMIT_FUNCCONTEXT (1 << 2) | |
|
51 | /* emit bdiff-style "matched" (a1, a2, b1, b2) hunks instead of "different" | |||
|
52 | * (a1, a2 - a1, b1, b2 - b1) hunks */ | |||
|
53 | #define XDL_EMIT_BDIFFHUNK (1 << 4) | |||
51 |
|
54 | |||
52 | #define XDL_MMB_READONLY (1 << 0) |
|
55 | #define XDL_MMB_READONLY (1 << 0) | |
53 |
|
56 |
@@ -975,15 +975,32 b' static int xdl_call_hunk_func(xdfenv_t *' | |||||
975 | xdemitconf_t const *xecfg) |
|
975 | xdemitconf_t const *xecfg) | |
976 | { |
|
976 | { | |
977 | xdchange_t *xch, *xche; |
|
977 | xdchange_t *xch, *xche; | |
978 |
|
978 | if ((xecfg->flags & XDL_EMIT_BDIFFHUNK) != 0) { | ||
979 | for (xch = xscr; xch; xch = xche->next) { |
|
979 | long i1 = 0, i2 = 0, n1 = xe->xdf1.nrec, n2 = xe->xdf2.nrec; | |
980 | xche = xdl_get_hunk(&xch, xecfg); |
|
980 | for (xch = xscr; xch; xch = xche->next) { | |
981 | if (!xch) |
|
981 | xche = xdl_get_hunk(&xch, xecfg); | |
982 | break; |
|
982 | if (!xch) | |
983 | if (xecfg->hunk_func(xch->i1, xche->i1 + xche->chg1 - xch->i1, |
|
983 | break; | |
984 | xch->i2, xche->i2 + xche->chg2 - xch->i2, |
|
984 | if (xch->i1 > i1 || xch->i2 > i2) { | |
985 | ecb->priv) < 0) |
|
985 | if (xecfg->hunk_func(i1, xch->i1, i2, xch->i2, ecb->priv) < 0) | |
|
986 | return -1; | |||
|
987 | } | |||
|
988 | i1 = xche->i1 + xche->chg1; | |||
|
989 | i2 = xche->i2 + xche->chg2; | |||
|
990 | } | |||
|
991 | if (xecfg->hunk_func(i1, n1, i2, n2, ecb->priv) < 0) | |||
986 | return -1; |
|
992 | return -1; | |
|
993 | } else { | |||
|
994 | for (xch = xscr; xch; xch = xche->next) { | |||
|
995 | xche = xdl_get_hunk(&xch, xecfg); | |||
|
996 | if (!xch) | |||
|
997 | break; | |||
|
998 | if (xecfg->hunk_func( | |||
|
999 | xch->i1, xche->i1 + xche->chg1 - xch->i1, | |||
|
1000 | xch->i2, xche->i2 + xche->chg2 - xch->i2, | |||
|
1001 | ecb->priv) < 0) | |||
|
1002 | return -1; | |||
|
1003 | } | |||
987 | } |
|
1004 | } | |
988 | return 0; |
|
1005 | return 0; | |
989 | } |
|
1006 | } | |
@@ -1026,18 +1043,15 b' int xdl_diff(mmfile_t *mf1, mmfile_t *mf' | |||||
1026 | xdl_free_env(&xe); |
|
1043 | xdl_free_env(&xe); | |
1027 | return -1; |
|
1044 | return -1; | |
1028 | } |
|
1045 | } | |
1029 | if (xscr) { |
|
|||
1030 | if (xpp->flags & XDF_IGNORE_BLANK_LINES) |
|
|||
1031 | xdl_mark_ignorable(xscr, &xe, xpp->flags); |
|
|||
1032 |
|
1046 | |||
1033 | if (ef(&xe, xscr, ecb, xecfg) < 0) { |
|
1047 | if (xpp->flags & XDF_IGNORE_BLANK_LINES) | |
1034 |
|
1048 | xdl_mark_ignorable(xscr, &xe, xpp->flags); | ||
1035 | xdl_free_script(xscr); |
|
1049 | if (ef(&xe, xscr, ecb, xecfg) < 0) { | |
1036 | xdl_free_env(&xe); |
|
|||
1037 | return -1; |
|
|||
1038 | } |
|
|||
1039 | xdl_free_script(xscr); |
|
1050 | xdl_free_script(xscr); | |
|
1051 | xdl_free_env(&xe); | |||
|
1052 | return -1; | |||
1040 | } |
|
1053 | } | |
|
1054 | xdl_free_script(xscr); | |||
1041 | xdl_free_env(&xe); |
|
1055 | xdl_free_env(&xe); | |
1042 |
|
1056 | |||
1043 | return 0; |
|
1057 | return 0; |
General Comments 0
You need to be logged in to leave comments.
Login now