2 * wiggle - apply rejected patches
4 * Copyright (C) 2003 Neil Brown <neilb@cse.unsw.edu.au>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 * Email: <neilb@cse.unsw.edu.au>
24 * School of Computer Science and Engineering
25 * The University of New South Wales
46 static inline int match(struct elmnt
*a
, struct elmnt
*b
)
51 strncmp(a
->start
, b
->start
, a
->len
)==0;
54 static inline int ends_line(struct elmnt e
)
56 return e
.len
&& e
.start
[e
.len
-1] == '\n';
69 extern struct stream
load_file(char *name
);
70 extern int split_patch(struct stream
, struct stream
*, struct stream
*);
71 extern int split_merge(struct stream
, struct stream
*, struct stream
*, struct stream
*);
72 extern struct file
split_stream(struct stream s
, int type
, int reverse
);
73 extern struct csl
*pdiff(struct file a
, struct file b
, int chunks
);
74 extern struct csl
*diff(struct file a
, struct file b
);
75 extern struct csl
*diff_partial(struct file a
, struct file b
,
76 int alo
, int ahi
, int blo
, int bhi
);
77 extern struct csl
*worddiff(struct stream f1
, struct stream f2
,
78 struct file
*fl1p
, struct file
*fl2p
);
80 struct ci
{ int conflicts
; int ignored
; };
81 extern struct ci
print_merge(FILE *out
, struct file
*a
, struct file
*b
, struct file
*c
,
82 struct csl
*c1
, struct csl
*c2
,
84 extern void printword(FILE *f
, struct elmnt e
);
86 extern void die(void);
88 extern char Version
[];
89 extern char short_options
[];
90 extern struct option long_options
[];
93 extern char HelpExtract
[];
94 extern char HelpDiff
[];
95 extern char HelpMerge
[];