aboutsummaryrefslogtreecommitdiffstats
path: root/src/intervals.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/intervals.h')
-rw-r--r--src/intervals.h39
1 files changed, 4 insertions, 35 deletions
diff --git a/src/intervals.h b/src/intervals.h
index a5166c6376f..01e72d7c9db 100644
--- a/src/intervals.h
+++ b/src/intervals.h
@@ -137,47 +137,16 @@ struct interval
137 or pointer slots of struct interval. */ 137 or pointer slots of struct interval. */
138 138
139INTERVALS_INLINE void 139INTERVALS_INLINE void
140interval_set_parent (INTERVAL i, INTERVAL parent) 140set_interval_parent (INTERVAL i, INTERVAL parent)
141{ 141{
142 i->up_obj = 0; 142 i->up_obj = 0;
143 i->up.interval = parent; 143 i->up.interval = parent;
144} 144}
145 145
146INTERVALS_INLINE void 146INTERVALS_INLINE void
147interval_set_object (INTERVAL i, Lisp_Object obj) 147set_interval_plist (INTERVAL i, Lisp_Object plist)
148{
149 eassert (BUFFERP (obj) || STRINGP (obj));
150 i->up_obj = 1;
151 i->up.obj = obj;
152}
153
154INTERVALS_INLINE void
155interval_set_left (INTERVAL i, INTERVAL left)
156{
157 i->left = left;
158}
159
160INTERVALS_INLINE void
161interval_set_right (INTERVAL i, INTERVAL right)
162{
163 i->right = right;
164}
165
166INTERVALS_INLINE Lisp_Object
167interval_set_plist (INTERVAL i, Lisp_Object plist)
168{ 148{
169 i->plist = plist; 149 i->plist = plist;
170 return plist;
171}
172
173/* Make the parent of D be whatever the parent of S is, regardless
174 of the type. This is used when balancing an interval tree. */
175
176INTERVALS_INLINE void
177interval_copy_parent (INTERVAL d, INTERVAL s)
178{
179 d->up = s->up;
180 d->up_obj = s->up_obj;
181} 150}
182 151
183/* Get the parent interval, if any, otherwise a null pointer. Useful 152/* Get the parent interval, if any, otherwise a null pointer. Useful
@@ -191,11 +160,11 @@ interval_copy_parent (INTERVAL d, INTERVAL s)
191{ \ 160{ \
192 (i)->total_length = (i)->position = 0; \ 161 (i)->total_length = (i)->position = 0; \
193 (i)->left = (i)->right = NULL; \ 162 (i)->left = (i)->right = NULL; \
194 interval_set_parent (i, NULL); \ 163 set_interval_parent (i, NULL); \
195 (i)->write_protect = 0; \ 164 (i)->write_protect = 0; \
196 (i)->visible = 0; \ 165 (i)->visible = 0; \
197 (i)->front_sticky = (i)->rear_sticky = 0; \ 166 (i)->front_sticky = (i)->rear_sticky = 0; \
198 interval_set_plist (i, Qnil); \ 167 set_interval_plist (i, Qnil); \
199} 168}
200 169
201/* Copy the cached property values of interval FROM to interval TO. */ 170/* Copy the cached property values of interval FROM to interval TO. */