Mercurial > hg > xemacs-beta
comparison src/rangetab.c @ 5118:e0db3c197671 ben-lisp-object
merge up to latest default branch, doesn't compile yet
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Sat, 26 Dec 2009 21:18:49 -0600 |
parents | 3742ea8250b5 312503644bc3 |
children | b5df3737028a |
comparison
equal
deleted
inserted
replaced
5117:3742ea8250b5 | 5118:e0db3c197671 |
---|---|
90 Lisp_Range_Table *rt = XRANGE_TABLE (obj); | 90 Lisp_Range_Table *rt = XRANGE_TABLE (obj); |
91 int i; | 91 int i; |
92 | 92 |
93 for (i = 0; i < Dynarr_length (rt->entries); i++) | 93 for (i = 0; i < Dynarr_length (rt->entries); i++) |
94 mark_object (Dynarr_at (rt->entries, i).val); | 94 mark_object (Dynarr_at (rt->entries, i).val); |
95 | |
95 return Qnil; | 96 return Qnil; |
96 } | 97 } |
97 | 98 |
98 static void | 99 static void |
99 print_range_table (Lisp_Object obj, Lisp_Object printcharfun, | 100 print_range_table (Lisp_Object obj, Lisp_Object printcharfun, |
217 { XD_BLOCK_PTR, offsetof (Lisp_Range_Table, entries), 1, | 218 { XD_BLOCK_PTR, offsetof (Lisp_Range_Table, entries), 1, |
218 { &rted_description } }, | 219 { &rted_description } }, |
219 { XD_END } | 220 { XD_END } |
220 }; | 221 }; |
221 | 222 |
222 DEFINE_LISP_OBJECT ("range-table", range_table, | 223 DEFINE_DUMPABLE_LISP_OBJECT ("range-table", range_table, |
223 mark_range_table, print_range_table, 0, | 224 mark_range_table, print_range_table, 0, |
224 range_table_equal, range_table_hash, | 225 range_table_equal, range_table_hash, |
225 range_table_description, | 226 range_table_description, |
226 Lisp_Range_Table); | 227 Lisp_Range_Table); |
227 | 228 |
228 /************************************************************************/ | 229 /************************************************************************/ |
229 /* Range table operations */ | 230 /* Range table operations */ |
230 /************************************************************************/ | 231 /************************************************************************/ |
231 | 232 |
286 { | 287 { |
287 return RANGE_TABLEP (object) ? Qt : Qnil; | 288 return RANGE_TABLEP (object) ? Qt : Qnil; |
288 } | 289 } |
289 | 290 |
290 DEFUN ("range-table-type", Frange_table_type, 1, 1, 0, /* | 291 DEFUN ("range-table-type", Frange_table_type, 1, 1, 0, /* |
291 Return non-nil if OBJECT is a range table. | 292 Return the type of RANGE-TABLE. |
293 | |
294 This will be a symbol describing how ranges in RANGE-TABLE function at their | |
295 ends; see `make-range-table'. | |
292 */ | 296 */ |
293 (range_table)) | 297 (range_table)) |
294 { | 298 { |
295 CHECK_RANGE_TABLE (range_table); | 299 CHECK_RANGE_TABLE (range_table); |
296 return range_table_type_to_symbol (XRANGE_TABLE (range_table)->type); | 300 return range_table_type_to_symbol (XRANGE_TABLE (range_table)->type); |
570 the beginning and end of the range and the corresponding value. | 574 the beginning and end of the range and the corresponding value. |
571 | 575 |
572 Results are guaranteed to be correct (i.e. each entry processed | 576 Results are guaranteed to be correct (i.e. each entry processed |
573 exactly once) if FUNCTION modifies or deletes the current entry | 577 exactly once) if FUNCTION modifies or deletes the current entry |
574 \(i.e. passes the current range to `put-range-table' or | 578 \(i.e. passes the current range to `put-range-table' or |
575 `remove-range-table'), but not otherwise. | 579 `remove-range-table'). If FUNCTION modifies or deletes any other entry, |
580 this guarantee doesn't hold. | |
576 */ | 581 */ |
577 (function, range_table)) | 582 (function, range_table)) |
578 { | 583 { |
579 Lisp_Range_Table *rt; | 584 Lisp_Range_Table *rt; |
580 int i; | 585 int i; |