@@ -156,50 +156,6 @@ int xdi_diff_outf(mmfile_t *mf1, mmfile_t *mf2,
156156 return ret ;
157157}
158158
159- struct xdiff_emit_hunk_state {
160- xdiff_emit_hunk_consume_fn consume ;
161- void * consume_callback_data ;
162- };
163-
164- static int process_diff (xdfenv_t * xe , xdchange_t * xscr , xdemitcb_t * ecb ,
165- xdemitconf_t const * xecfg )
166- {
167- long s1 , s2 , same , p_next , t_next ;
168- xdchange_t * xch , * xche ;
169- struct xdiff_emit_hunk_state * state = ecb -> priv ;
170- xdiff_emit_hunk_consume_fn fn = state -> consume ;
171- void * consume_callback_data = state -> consume_callback_data ;
172-
173- for (xch = xscr ; xch ; xch = xche -> next ) {
174- xche = xdl_get_hunk (xch , xecfg );
175-
176- s1 = XDL_MAX (xch -> i1 - xecfg -> ctxlen , 0 );
177- s2 = XDL_MAX (xch -> i2 - xecfg -> ctxlen , 0 );
178- same = s2 + XDL_MAX (xch -> i1 - s1 , 0 );
179- p_next = xche -> i1 + xche -> chg1 ;
180- t_next = xche -> i2 + xche -> chg2 ;
181-
182- fn (consume_callback_data , same , p_next , t_next );
183- }
184- return 0 ;
185- }
186-
187- int xdi_diff_hunks (mmfile_t * mf1 , mmfile_t * mf2 ,
188- xdiff_emit_hunk_consume_fn fn , void * consume_callback_data ,
189- xpparam_t const * xpp , xdemitconf_t * xecfg )
190- {
191- struct xdiff_emit_hunk_state state ;
192- xdemitcb_t ecb ;
193-
194- memset (& state , 0 , sizeof (state ));
195- memset (& ecb , 0 , sizeof (ecb ));
196- state .consume = fn ;
197- state .consume_callback_data = consume_callback_data ;
198- xecfg -> emit_func = (void (* )())process_diff ;
199- ecb .priv = & state ;
200- return xdi_diff (mf1 , mf2 , xpp , xecfg , & ecb );
201- }
202-
203159int read_mmfile (mmfile_t * ptr , const char * filename )
204160{
205161 struct stat st ;
0 commit comments