708
* Note that loops that are testing for changed lines in xdf->rchg do not need
709
* index bounding since the array is prepared with a zero at position -1 and N.
710
*/
711
-struct group {
711
+struct xdlgroup {
712
/*
713
* The index of the first changed line in the group, or the index of
714
* the unchanged line above which the (empty) group is located.
725
/*
726
* Initialize g to point at the first group in xdf.
727
*/
728
-static void group_init(xdfile_t *xdf, struct group *g)
728
+static void group_init(xdfile_t *xdf, struct xdlgroup *g)
729
{
730
g->start = g->end = 0;
731
while (xdf->rchg[g->end])
736
* Move g to describe the next (possibly empty) group in xdf and return 0. If g
737
* is already at the end of the file, do nothing and return -1.
738
*/
739
-static inline int group_next(xdfile_t *xdf, struct group *g)
739
+static inline int group_next(xdfile_t *xdf, struct xdlgroup *g)
740
{
741
if (g->end == xdf->nrec)
742
return -1;
752
* Move g to describe the previous (possibly empty) group in xdf and return 0.
753
* If g is already at the beginning of the file, do nothing and return -1.
754
*/
755
-static inline int group_previous(xdfile_t *xdf, struct group *g)
755
+static inline int group_previous(xdfile_t *xdf, struct xdlgroup *g)
756
{
757
if (g->start == 0)
758
return -1;
769
* following group, expand this group to include it. Return 0 on success or -1
770
* if g cannot be slid down.
771
*/
772
-static int group_slide_down(xdfile_t *xdf, struct group *g, long flags)
772
+static int group_slide_down(xdfile_t *xdf, struct xdlgroup *g, long flags)
773
{
774
if (g->end < xdf->nrec &&
775
recs_match(xdf->recs[g->start], xdf->recs[g->end], flags)) {
790
* into a previous group, expand this group to include it. Return 0 on success
791
* or -1 if g cannot be slid up.
792
*/
793
-static int group_slide_up(xdfile_t *xdf, struct group *g, long flags)
793
+static int group_slide_up(xdfile_t *xdf, struct xdlgroup *g, long flags)
794
{
795
if (g->start > 0 &&
796
recs_match(xdf->recs[g->start - 1], xdf->recs[g->end - 1], flags)) {
818
* size.
819
*/
820
int xdl_change_compact(xdfile_t *xdf, xdfile_t *xdfo, long flags) {
821
- struct group g, go;
821
+ struct xdlgroup g, go;
822
long earliest_end, end_matching_other;
823
long groupsize;
824
unsigned int blank_lines;