rbtree 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (11) hide show
  1. data/ChangeLog +425 -0
  2. data/LICENSE +22 -0
  3. data/MANIFEST +10 -0
  4. data/README +78 -0
  5. data/depend +2 -0
  6. data/dict.c +1216 -0
  7. data/dict.h +123 -0
  8. data/extconf.rb +34 -0
  9. data/rbtree.c +1691 -0
  10. data/test.rb +895 -0
  11. metadata +58 -0
@@ -0,0 +1,425 @@
1
+ 2007-09-21 OZAWA Takuma <burningdowntheopera@yahoo.co.jp>
2
+
3
+ * extconf.rb: no gcc options for mswin32.
4
+
5
+ 2007-02-01 OZAWA Takuma <burningdowntheopera@yahoo.co.jp>
6
+
7
+ * version 0.2.0 released.
8
+
9
+ 2007-01-25 OZAWA Takuma <burningdowntheopera@yahoo.co.jp>
10
+
11
+ * rbtree.c (rbtree_readjust): remove a warning.
12
+
13
+ * rbtree.c (rbtree_default): should not call default procedure if
14
+ no key is given.
15
+
16
+ * rbtree.c (rbtree_equal): returns true if two rbtrees have same
17
+ set of key-value set.
18
+
19
+ 2004-10-27 OZAWA Takuma <burningdowntheopera@yahoo.co.jp>
20
+
21
+ * version 0.1.3 released.
22
+
23
+ 2004-07-29 OZAWA Takuma <burningdowntheopera@yahoo.co.jp>
24
+
25
+ * rbtree.c (rbtree_bound): RBTree#bound(lower, upper = lower).
26
+
27
+ 2004-07-11 OZAWA Takuma <burningdowntheopera@yahoo.co.jp>
28
+
29
+ * rbtree.c (MultiRBTree): new class. MultiRBTree allows duplicates
30
+ of keys.
31
+
32
+ * rbtree.c (rbtree_dump, rbtree_s_load): use Array as a storage
33
+ for performance improvement.
34
+
35
+ * rbtree.c (rbtree_equal, rbtree_initialize_copy, rbtree_update):
36
+ should use rb_obj_is_kind_of.
37
+
38
+ * rbtree.c (iter_lev): added to count iterator level for nesting
39
+ and thread-safety.
40
+
41
+ 2004-06-29 OZAWA Takuma <burningdowntheopera@yahoo.co.jp>
42
+
43
+ * dict.c: remove codes Ruby/RBTree doesn't need. now not supposed
44
+ to use dict.c with other program.
45
+
46
+ * dict.h: ditto.
47
+
48
+ * dict.c (dict_equal): remove key_eql argument. use
49
+ dict->dict_compare to compare keys.
50
+
51
+ 2004-06-20 OZAWA Takuma <burningdowntheopera@yahoo.co.jp>
52
+
53
+ * rbtree.c (rbtree_cmp): use rb_str_cmp if the type of keys is
54
+ string.
55
+
56
+ * rbtree.c (rbtree_cmp): use rb_cmpint.
57
+
58
+ * rbtree.c (rbtree_user_cmp): ditto.
59
+
60
+ 2004-06-12 OZAWA Takuma <burningdowntheopera@yahoo.co.jp>
61
+
62
+ * version 0.1.2 release.
63
+
64
+ 2004-05-31 OZAWA Takuma <burningdowntheopera@yahoo.co.jp>
65
+
66
+ * rbtree.c (rbtree_initialize_copy): if an exception is raised in
67
+ the method rbtree is not modified.
68
+
69
+ * rbtree.c (rbtree_delete_if): if an exception is raised in the
70
+ block rbtree is not modified(no keys are deleted).
71
+
72
+ * rbtree.c (rbtree_readjust): use rb_gc_force_recycle.
73
+
74
+ 2004-05-24 OZAWA Takuma <burningdowntheopera@yahoo.co.jp>
75
+
76
+ * rbtree.c (rbtree_initialize_copy): use aset_i. duplicating a key
77
+ of string is fast because of copy-on-write.
78
+
79
+ * rbtree.c (rbtree_readjust): ditto.
80
+
81
+ * rbtree.c (rbtree_update): ditto.
82
+
83
+ * rbtree.c (rbtree_aset): no dict_lookup for better performance.
84
+
85
+ * rbtree.c (rbtree_update): was same whether a block is given or not.
86
+
87
+ 2004-05-23 OZAWA Takuma <burningdowntheopera@yahoo.co.jp>
88
+
89
+ * rbtree.c (inspect_rbtree): add OBJ_INFECTs.
90
+
91
+ * rbtree.c (inspect_rbtree): change ``compare'' to ``cmp_proc''.
92
+
93
+ * rbtree.c (pp_block): ditto.
94
+
95
+ 2004-04-26 OZAWA Takuma <burningdowntheopera@yahoo.co.jp>
96
+
97
+ * rbtree.c (rbtree_s_create): accept Hash argument.
98
+
99
+ * rbtree.c (rbtree_s_create): should just copy keys and values.
100
+
101
+ 2004-02-19 OZAWA Takuma <burningdowntheopera@yahoo.co.jp>
102
+
103
+ * rbtree.c (pp_object_group): use id_object_group.
104
+
105
+ 2004-02-16 OZAWA Takuma <burningdowntheopera@yahoo.co.jp>
106
+
107
+ * version 0.1.1 release.
108
+
109
+ 2004-02-13 OZAWA Takuma <burningdowntheopera@yahoo.co.jp>
110
+
111
+ * README: rewritten.
112
+
113
+ * rbtree.c (document): incomplete document for rdoc.
114
+
115
+ 2004-02-08 OZAWA Takuma <burningdowntheopera@yahoo.co.jp>
116
+
117
+ * test.rb (test_pp): add pretty printing test.
118
+
119
+ 2004-02-07 OZAWA Takuma <burningdowntheopera@yahoo.co.jp>
120
+
121
+ * rbtree.c (rbtree_mark): should check rbtree and dict is
122
+ initialized. Thanks to Neil Spring.
123
+
124
+ 2004-02-05 OZAWA Takuma <burningdowntheopera@yahoo.co.jp>
125
+
126
+ * rbtree.c (prettyprint): polish code.
127
+
128
+ * test.rb (assert_raise): alias of assert_raises for Ruby 1.6.x.
129
+
130
+ 2004-02-02 OZAWA Takuma <burningdowntheopera@yahoo.co.jp>
131
+
132
+ * test.rb: clean code. no more RUnit support. use Test::Unit.
133
+
134
+ 2004-01-29 OZAWA Takuma <burningdowntheopera@yahoo.co.jp>
135
+
136
+ * rbtree.c (rbtree_dump): optimization.
137
+
138
+ * rbtree.c (rbtree_s_load): ditto.
139
+
140
+ 2004-01-27 OZAWA Takuma <burningdowntheopera@yahoo.co.jp>
141
+
142
+ * rbtree.c (readjust): RBTree#readjust() just readjusts elements
143
+ using current comparison block. use RBTree#readjust(nil) to set
144
+ default comparison block.
145
+
146
+ * extconf.rb (assertion): removed.
147
+
148
+ 2004-01-14 OZAWA Takuma <burningdowntheopera@yahoo.co.jp>
149
+
150
+ * ctest/test.c: removed.
151
+
152
+ * ctest/testlib.c: ditto.
153
+
154
+ * ctest/testlib.h: ditto.
155
+
156
+ * ctest/Makefile: ditto.
157
+
158
+ 2004-01-04 OZAWA Takuma <burningdowntheopera@yahoo.co.jp>
159
+
160
+ * version 0.1.0 release.
161
+
162
+ 2004-01-03 OZAWA Takuma <burningdowntheopera@yahoo.co.jp>
163
+
164
+ * rbtree.c (rbtree_to_rbtree): new method.
165
+
166
+ * rbtree.c (each_pair_i, rbtree_bound_body, rbtree_delete_if_body,
167
+ select_i, update_block_i): use rb_yield_values.
168
+
169
+ * rbtree.c (rbtree_each): RBTree#each should yield single value.
170
+
171
+ * rbtree.c (rbtree_select): select(key..) is removed.
172
+
173
+ * rbtree.c (rbtree_fetch): always warn if default argument and a
174
+ block are supplied at the same time.
175
+
176
+ 2003-08-12 takuma ozawa <hermione@24i.net>
177
+
178
+ * version 0.0.7 release.
179
+
180
+ 2003-08-11 takuma ozawa <hermione@24i.net>
181
+
182
+ * rbtree.c (rbtree_to_hash): copy default value.
183
+
184
+ * rbtree.c (rbtree_readjust): takes a Proc argument.
185
+
186
+ * rbtree.c (to_hash_i): optimization.
187
+
188
+ 2003-08-09 takuma ozawa <hermione@24i.net>
189
+
190
+ * rbtree.c (rbtree_merge): new method.
191
+
192
+ * rbtree.c (rbtree_select): select(key..) is deprecated.
193
+
194
+ * rbtree.c (rbtree_values_at): new method.
195
+
196
+ * rbtree.c (rbtree_initialized_copy): rbtree_copy_object changed to.
197
+
198
+ 2003-07-27 takuma ozawa <hermione@24i.net>
199
+
200
+ * rbtree.c (rbtree_dump): new method based on Ara Howard's code.
201
+ Thanks.
202
+
203
+ * rbtree.c (rbtree_s_load): ditto.
204
+
205
+ 2003-03-25 takuma ozawa <hermione@24i.net>
206
+
207
+ * version 0.0.6 release.
208
+
209
+ 2003-02-26 takuma ozawa <hermione@24i.net>
210
+
211
+ * rbtree.c (rbtree_readjust): rbtree_modify.
212
+
213
+ 2003-02-23 takuma ozawa <hermione@24i.net>
214
+
215
+ * rbtree.c (rbtree_copy_object): use copy_i.
216
+
217
+ * rbtree.c (rbtree_readjust): ditto.
218
+
219
+ * rbtree.c (rbtree_aset): not freeze a key.
220
+
221
+ 2003-01-24 takuma ozawa <hermione@24i.net>
222
+
223
+ * rbtree.c (rbtree_aset): optimization.
224
+
225
+ 2003-01-18 takuma ozawa <hermione@24i.net>
226
+
227
+ * rbtree.c (rbtree_aset): not raise an exception if a dict is
228
+ full and the key has been contained.
229
+
230
+ 2003-01-16 takuma ozawa <hermione@24i.net>
231
+
232
+ * version 0.0.5 release.
233
+
234
+ 2002-12-26 takuma ozawa <hermione@24i.net>
235
+
236
+ * rbtree.c (rbtree_alloc): new allocation framework.
237
+
238
+ * rbtree.c (rbtree_copy_object): changed become to copy_object.
239
+
240
+ * rbtree.c (rbtree_cmp): use NUM2INT in case nil returned.
241
+
242
+ * extconf.rb (assertion): assertion is off by default.
243
+
244
+ * rbtree.c (rbtree_aset): fixed a memory leak occured if the
245
+ comparison block raises an exception.
246
+
247
+ 2002-11-24 takuma ozawa <hermione@24i.net>
248
+
249
+ * rbtree.c (rbtree_pretty_print): new method.
250
+
251
+ * rbtree.c (rbtree_pretty_print_cycle): new method.
252
+
253
+ 2002-11-22 takuma ozawa <hermione@24i.net>
254
+
255
+ * rbtree.c (rbtree_inspect): format changed.
256
+
257
+ * rbtree.c (rbtree_user_cmp): use NUM2INT.
258
+
259
+ 2002-10-29 takuma ozawa <hermione@24i.net>
260
+
261
+ * version 0.0.4 release.
262
+
263
+ 2002-10-18 takuma ozawa <hermione@24i.net>
264
+
265
+ * extconf.rb (assertion): change name to assertion.
266
+
267
+ 2002-10-12 takuma ozawa <hermione@24i.net>
268
+
269
+ * rbtree.c (rbtree_readjust): assign Qnil to other's dict_context
270
+ after swap.
271
+
272
+ * rbtree.c (rbtree_bound): use dict_compare for range check.
273
+
274
+ 2002-10-10 takuma ozawa <hermione@24i.net>
275
+
276
+ * rbtree.c (rbtree_readjust): empty dict check.
277
+
278
+ * rbtree.c (rbtree_readjust): not use dict_readjust for better
279
+ readability.
280
+
281
+ * rbtree.c (rbtree_become): must copy dict_compare and
282
+ dict_context before copying nodes.
283
+
284
+ * rbtree.c (rbtree_delete_if): rbtree_modify.
285
+
286
+ * rbtree.c (rbtree_shift_pop): ditto.
287
+
288
+ * rbtree.c (rbtree_update): ditto.
289
+
290
+ * test.rb: Test::Unit.
291
+
292
+ * rbtree.c (rbtree_readjust): clear other's nodes after swap.
293
+
294
+ * rbtree.c (rbtree_readjust): assign Qnil to other's ifnone after
295
+ swap.
296
+
297
+ 2002-10-07 takuma ozawa <hermione@24i.net>
298
+
299
+ * rbtree.c (rbtree_update): self assignment check.
300
+
301
+ * rbtree.c (rbtree_update): replace duplicate value by return
302
+ value of block if given.
303
+
304
+ 2002-10-03 takuma ozawa <hermione@24i.net>
305
+
306
+ * rbtree.c (rbtree_become): self assignment check.
307
+
308
+ 2002-09-24 takuma ozawa <hermione@24i.net>
309
+
310
+ * rbtree.c (rbtree_cmp_proc): new method.
311
+
312
+ * rbtree.c (rbtree_readjust): if no block given, must assign Qnil
313
+ to context.
314
+
315
+ * rbtree.c (rbtree_inspect): format changed.
316
+
317
+ 2002-09-23 takuma ozawa <hermione@24i.net>
318
+
319
+ * dict.c (dict_equal): empty test must be after similar test.
320
+
321
+ 2002-09-22 takuma ozawa <hermione@24i.net>
322
+
323
+ * rbtree.c (rbtree_update): convert argument to RBTree.
324
+
325
+ * rbtree.c (rbtree_become): ditto.
326
+
327
+ * rbtree.c (rbtree_eq): use rb_equal.
328
+
329
+ * rbtree.c (rbtree_eql): change name to rbtree_eq.
330
+
331
+ 2002-09-20 takuma ozawa <hermione@24i.net>
332
+
333
+ * rbtree.c (RBTREE_FL_COPY): removed.
334
+
335
+ * ctest/test.c: rewritten in C. CppUnit is not required.
336
+
337
+ 2002-09-18 takuma ozawa <hermione@24i.net>
338
+
339
+ * depend: new file.
340
+
341
+ * rbtree.c (rbtree_equal): no need to check RBTREE_PROC_DEFAULT.
342
+
343
+ * extconf.rb (inline) check for inline keyword.
344
+
345
+ 2002-09-17 takuma ozawa <hermione@24i.net>
346
+
347
+ * version 0.0.3 release.
348
+
349
+ 2002-09-16 takuma ozawa <hermione@24i.net>
350
+
351
+ * rbtree.c (rbtree_reverse_each): new method.
352
+
353
+ 2002-09-12 takuma ozawa <hermione@24i.net>
354
+
355
+ * rbtree.c (rbtree_s_create): unset RBTREE_PROC_DEFAULT if the
356
+ argument is RBTree.
357
+
358
+ * rbtree.c (rbtree_clone): use rbtree_become.
359
+
360
+ * rbtree.c (version.h): not included.
361
+
362
+ 2002-09-11 takuma ozawa <hermione@24i.net>
363
+
364
+ * rbtree.c (rbtree_to_a): use OBJ_INFECT.
365
+
366
+ * rbtree.c (rbtree_to_hash): ditto.
367
+
368
+ * rbtree.c (rbtree_become): replaced by rbtree_replace.
369
+
370
+ * rbtree.c (rbtree_replace): removed. replace is implemented
371
+ useing rbtree_become.
372
+
373
+ * rbtree.c (rbtree_first_last): first or pop from empty tree
374
+ should not return its default proc.
375
+
376
+ 2002-09-09 takuma ozawa <hermione@24i.net>
377
+
378
+ * rbtree.c (rbtree_become): new method.
379
+
380
+ * rbtree.c (rbtree_clone): unset RBTREE_IN_ITERATION.
381
+
382
+ * rbtree.c (rbtree_replace): should copy ifnone.
383
+
384
+ * rbtree.c (rbtree_shift_pop): shift or pop from empty tree should
385
+ not return its default proc.
386
+
387
+ * rbtree.c (rbtree_default_proc): new method.
388
+
389
+ * rbtree.c (rbtree_equal): should check default values and
390
+ RBTREE_PROC_DEFAULT.
391
+
392
+ 2002-07-19 takuma ozawa <metal@mine.ne.jp>
393
+
394
+ * dict.c (alloc_node): must return NULL if a memory allocation
395
+ fails.
396
+
397
+ 2002-07-13 takuma ozawa <metal@mine.ne.jp>
398
+
399
+ * version 0.0.2 release.
400
+
401
+ 2002-07-11 takuma ozawa <metal@mine.ne.jp>
402
+
403
+ * rbtree.c (rbtree_readjust): new method.
404
+
405
+ 2002-07-10 takuma ozawa <metal@mine.ne.jp>
406
+
407
+ * dict.c (dict_clone): clone object must copy must_unfreeze
408
+ variable.
409
+
410
+ 2002-06-25 takuma ozawa <metal@mine.ne.jp>
411
+
412
+ * dict.h (dnode_t): add must_freeze flag not to unfreeze already
413
+ freezed object.
414
+
415
+ 2002-06-22 takuma ozawa <metal@mine.ne.jp>
416
+
417
+ * rbtree.c (rbtree_first): new method.
418
+
419
+ * rbtree.c (rbtree_last): new method.
420
+
421
+ * rbtree.c (rbtree_pop): new method.
422
+
423
+ 2002-06-14 takuma ozawa <metal@mine.ne.jp>
424
+
425
+ * initial release.
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2002-2004, 2007 OZAWA Takuma
2
+
3
+ Permission is hereby granted, free of charge, to any person
4
+ obtaining a copy of this software and associated documentation
5
+ files (the "Software"), to deal in the Software without
6
+ restriction, including without limitation the rights to use,
7
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the
9
+ Software is furnished to do so, subject to the following
10
+ conditions:
11
+
12
+ The above copyright notice and this permission notice shall be
13
+ included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
+ OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,10 @@
1
+ ChangeLog
2
+ LICENSE
3
+ MANIFEST
4
+ README
5
+ depend
6
+ dict.c
7
+ dict.h
8
+ extconf.rb
9
+ rbtree.c
10
+ test.rb