static Lisp_Object merge_properties_sticky (Lisp_Object, Lisp_Object);
static INTERVAL merge_interval_right (INTERVAL);
static INTERVAL reproduce_tree (INTERVAL, INTERVAL);
-static INTERVAL reproduce_tree_obj (INTERVAL, Lisp_Object);
\f
/* Utility functions for intervals. */
abort ();
}
\f
+/* Create a copy of SOURCE but with the default value of UP. */
+
+static INTERVAL
+reproduce_interval (INTERVAL source)
+{
+ register INTERVAL target = make_interval ();
+
+ target->total_length = source->total_length;
+ target->position = source->position;
+
+ copy_properties (source, target);
+
+ if (! NULL_LEFT_CHILD (source))
+ interval_set_left (target, reproduce_tree (source->left, target));
+ if (! NULL_RIGHT_CHILD (source))
+ interval_set_right (target, reproduce_tree (source->right, target));
+
+ return target;
+}
+
/* Make an exact copy of interval tree SOURCE which descends from
PARENT. This is done by recursing through SOURCE, copying
the current interval and its properties, and then adjusting
static INTERVAL
reproduce_tree (INTERVAL source, INTERVAL parent)
{
- register INTERVAL t = make_interval ();
-
- memcpy (t, source, sizeof *t);
- copy_properties (source, t);
- interval_set_parent (t, parent);
- if (! NULL_LEFT_CHILD (source))
- interval_set_left (t, reproduce_tree (source->left, t));
- if (! NULL_RIGHT_CHILD (source))
- interval_set_right (t, reproduce_tree (source->right, t));
+ register INTERVAL target = reproduce_interval (source);
- return t;
+ interval_set_parent (target, parent);
+ return target;
}
static INTERVAL
reproduce_tree_obj (INTERVAL source, Lisp_Object parent)
{
- register INTERVAL t = make_interval ();
-
- memcpy (t, source, sizeof *t);
- copy_properties (source, t);
- interval_set_object (t, parent);
- if (! NULL_LEFT_CHILD (source))
- interval_set_left (t, reproduce_tree (source->left, t));
- if (! NULL_RIGHT_CHILD (source))
- interval_set_right (t, reproduce_tree (source->right, t));
+ register INTERVAL target = reproduce_interval (source);
- return t;
+ interval_set_object (target, parent);
+ return target;
}
\f
/* Insert the intervals of SOURCE into BUFFER at POSITION.