##// END OF EJS Templates
xdiff: remove unused structure, functions, and constants...
Jun Wu -
r36780:b5bb0f99 default
parent child Browse files
Show More
@@ -278,8 +278,6 b' static PyObject *xdiffblocks(PyObject *s'
278 278
279 279 xpparam_t xpp = {
280 280 XDF_INDENT_HEURISTIC, /* flags */
281 NULL, /* anchors */
282 0, /* anchors_nr */
283 281 };
284 282 xdemitconf_t xecfg = {
285 283 0, /* ctxlen */
@@ -41,14 +41,6 b' extern "C" {'
41 41 * (a1, a2 - a1, b1, b2 - b1) hunks */
42 42 #define XDL_EMIT_BDIFFHUNK (1 << 4)
43 43
44 #define XDL_MMB_READONLY (1 << 0)
45
46 #define XDL_MMF_ATOMIC (1 << 0)
47
48 #define XDL_BDOP_INS 1
49 #define XDL_BDOP_CPY 2
50 #define XDL_BDOP_INSB 3
51
52 44 /* merge simplification levels */
53 45 #define XDL_MERGE_MINIMAL 0
54 46 #define XDL_MERGE_EAGER 1
@@ -75,10 +67,6 b' typedef struct s_mmbuffer {'
75 67
76 68 typedef struct s_xpparam {
77 69 unsigned long flags;
78
79 /* See Documentation/diff-options.txt. */
80 char **anchors;
81 size_t anchors_nr;
82 70 } xpparam_t;
83 71
84 72 typedef struct s_xdemitcb {
@@ -101,10 +89,6 b' typedef struct s_xdemitconf {'
101 89 xdl_emit_hunk_consume_func_t hunk_func;
102 90 } xdemitconf_t;
103 91
104 typedef struct s_bdiffparam {
105 long bsize;
106 } bdiffparam_t;
107
108 92
109 93 #define xdl_malloc(x) malloc(x)
110 94 #define xdl_free(ptr) free(ptr)
@@ -56,9 +56,5 b' int xdl_build_script(xdfenv_t *xe, xdcha'
56 56 void xdl_free_script(xdchange_t *xscr);
57 57 int xdl_emit_diff(xdfenv_t *xe, xdchange_t *xscr, xdemitcb_t *ecb,
58 58 xdemitconf_t const *xecfg);
59 int xdl_do_patience_diff(mmfile_t *mf1, mmfile_t *mf2, xpparam_t const *xpp,
60 xdfenv_t *env);
61 int xdl_do_histogram_diff(mmfile_t *mf1, mmfile_t *mf2, xpparam_t const *xpp,
62 xdfenv_t *env);
63 59
64 60 #endif /* #if !defined(XDIFFI_H) */
@@ -241,34 +241,3 b' int xdl_emit_hunk_hdr(long s1, long c1, '
241 241
242 242 return 0;
243 243 }
244
245 int xdl_fall_back_diff(xdfenv_t *diff_env, xpparam_t const *xpp,
246 int line1, int count1, int line2, int count2)
247 {
248 /*
249 * This probably does not work outside Git, since
250 * we have a very simple mmfile structure.
251 *
252 * Note: ideally, we would reuse the prepared environment, but
253 * the libxdiff interface does not (yet) allow for diffing only
254 * ranges of lines instead of the whole files.
255 */
256 mmfile_t subfile1, subfile2;
257 xdfenv_t env;
258
259 subfile1.ptr = (char *)diff_env->xdf1.recs[line1 - 1]->ptr;
260 subfile1.size = diff_env->xdf1.recs[line1 + count1 - 2]->ptr +
261 diff_env->xdf1.recs[line1 + count1 - 2]->size - subfile1.ptr;
262 subfile2.ptr = (char *)diff_env->xdf2.recs[line2 - 1]->ptr;
263 subfile2.size = diff_env->xdf2.recs[line2 + count2 - 2]->ptr +
264 diff_env->xdf2.recs[line2 + count2 - 2]->size - subfile2.ptr;
265 if (xdl_do_diff(&subfile1, &subfile2, xpp, &env) < 0)
266 return -1;
267
268 memcpy(diff_env->xdf1.rchg + line1 - 1, env.xdf1.rchg, count1);
269 memcpy(diff_env->xdf2.rchg + line2 - 1, env.xdf2.rchg, count2);
270
271 xdl_free_env(&env);
272
273 return 0;
274 }
@@ -38,8 +38,6 b' unsigned int xdl_hashbits(unsigned int s'
38 38 int xdl_num_out(char *out, long val);
39 39 int xdl_emit_hunk_hdr(long s1, long c1, long s2, long c2,
40 40 const char *func, long funclen, xdemitcb_t *ecb);
41 int xdl_fall_back_diff(xdfenv_t *diff_env, xpparam_t const *xpp,
42 int line1, int count1, int line2, int count2);
43 41
44 42
45 43
General Comments 0
You need to be logged in to leave comments. Login now