native_btree 0.1.0.alpha2 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,456 @@
1
+ # CMAKE generated file: DO NOT EDIT!
2
+ # Generated by "Unix Makefiles" Generator, CMake Version 3.10
3
+
4
+ # Default target executed when no arguments are given to make.
5
+ default_target: all
6
+
7
+ .PHONY : default_target
8
+
9
+ # Allow only one "make -f Makefile2" at a time, but pass parallelism.
10
+ .NOTPARALLEL:
11
+
12
+
13
+ #=============================================================================
14
+ # Special targets provided by cmake.
15
+
16
+ # Disable implicit rules so canonical targets will work.
17
+ .SUFFIXES:
18
+
19
+
20
+ # Remove some rules from gmake that .SUFFIXES does not remove.
21
+ SUFFIXES =
22
+
23
+ .SUFFIXES: .hpux_make_needs_suffix_list
24
+
25
+
26
+ # Suppress display of executed commands.
27
+ $(VERBOSE).SILENT:
28
+
29
+
30
+ # A target that is always out of date.
31
+ cmake_force:
32
+
33
+ .PHONY : cmake_force
34
+
35
+ #=============================================================================
36
+ # Set environment variables for the build.
37
+
38
+ # The shell in which to execute make rules.
39
+ SHELL = /bin/sh
40
+
41
+ # The CMake executable.
42
+ CMAKE_COMMAND = /usr/bin/cmake
43
+
44
+ # The command to remove a file.
45
+ RM = /usr/bin/cmake -E remove -f
46
+
47
+ # Escaping for special characters.
48
+ EQUALS = =
49
+
50
+ # The top-level source directory on which CMake was run.
51
+ CMAKE_SOURCE_DIR = /root
52
+
53
+ # The top-level build directory on which CMake was run.
54
+ CMAKE_BINARY_DIR = /root
55
+
56
+ #=============================================================================
57
+ # Targets provided globally by CMake.
58
+
59
+ # Special rule for the target rebuild_cache
60
+ rebuild_cache:
61
+ @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
62
+ /usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
63
+ .PHONY : rebuild_cache
64
+
65
+ # Special rule for the target rebuild_cache
66
+ rebuild_cache/fast: rebuild_cache
67
+
68
+ .PHONY : rebuild_cache/fast
69
+
70
+ # Special rule for the target edit_cache
71
+ edit_cache:
72
+ @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "No interactive CMake dialog available..."
73
+ /usr/bin/cmake -E echo No\ interactive\ CMake\ dialog\ available.
74
+ .PHONY : edit_cache
75
+
76
+ # Special rule for the target edit_cache
77
+ edit_cache/fast: edit_cache
78
+
79
+ .PHONY : edit_cache/fast
80
+
81
+ # The main all target
82
+ all: cmake_check_build_system
83
+ cd /root && $(CMAKE_COMMAND) -E cmake_progress_start /root/CMakeFiles /root/ext/native_btree/CMakeFiles/progress.marks
84
+ cd /root && $(MAKE) -f CMakeFiles/Makefile2 ext/native_btree/all
85
+ $(CMAKE_COMMAND) -E cmake_progress_start /root/CMakeFiles 0
86
+ .PHONY : all
87
+
88
+ # The main clean target
89
+ clean:
90
+ cd /root && $(MAKE) -f CMakeFiles/Makefile2 ext/native_btree/clean
91
+ .PHONY : clean
92
+
93
+ # The main clean target
94
+ clean/fast: clean
95
+
96
+ .PHONY : clean/fast
97
+
98
+ # Prepare targets for installation.
99
+ preinstall: all
100
+ cd /root && $(MAKE) -f CMakeFiles/Makefile2 ext/native_btree/preinstall
101
+ .PHONY : preinstall
102
+
103
+ # Prepare targets for installation.
104
+ preinstall/fast:
105
+ cd /root && $(MAKE) -f CMakeFiles/Makefile2 ext/native_btree/preinstall
106
+ .PHONY : preinstall/fast
107
+
108
+ # clear depends
109
+ depend:
110
+ cd /root && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
111
+ .PHONY : depend
112
+
113
+ # Convenience name for target.
114
+ ext/native_btree/CMakeFiles/native_btree.dir/rule:
115
+ cd /root && $(MAKE) -f CMakeFiles/Makefile2 ext/native_btree/CMakeFiles/native_btree.dir/rule
116
+ .PHONY : ext/native_btree/CMakeFiles/native_btree.dir/rule
117
+
118
+ # Convenience name for target.
119
+ native_btree: ext/native_btree/CMakeFiles/native_btree.dir/rule
120
+
121
+ .PHONY : native_btree
122
+
123
+ # fast build rule for target.
124
+ native_btree/fast:
125
+ cd /root && $(MAKE) -f ext/native_btree/CMakeFiles/native_btree.dir/build.make ext/native_btree/CMakeFiles/native_btree.dir/build
126
+ .PHONY : native_btree/fast
127
+
128
+ # Convenience name for target.
129
+ ext/native_btree/CMakeFiles/constructor.dir/rule:
130
+ cd /root && $(MAKE) -f CMakeFiles/Makefile2 ext/native_btree/CMakeFiles/constructor.dir/rule
131
+ .PHONY : ext/native_btree/CMakeFiles/constructor.dir/rule
132
+
133
+ # Convenience name for target.
134
+ constructor: ext/native_btree/CMakeFiles/constructor.dir/rule
135
+
136
+ .PHONY : constructor
137
+
138
+ # fast build rule for target.
139
+ constructor/fast:
140
+ cd /root && $(MAKE) -f ext/native_btree/CMakeFiles/constructor.dir/build.make ext/native_btree/CMakeFiles/constructor.dir/build
141
+ .PHONY : constructor/fast
142
+
143
+ # Convenience name for target.
144
+ ext/native_btree/CMakeFiles/rbtree_type.dir/rule:
145
+ cd /root && $(MAKE) -f CMakeFiles/Makefile2 ext/native_btree/CMakeFiles/rbtree_type.dir/rule
146
+ .PHONY : ext/native_btree/CMakeFiles/rbtree_type.dir/rule
147
+
148
+ # Convenience name for target.
149
+ rbtree_type: ext/native_btree/CMakeFiles/rbtree_type.dir/rule
150
+
151
+ .PHONY : rbtree_type
152
+
153
+ # fast build rule for target.
154
+ rbtree_type/fast:
155
+ cd /root && $(MAKE) -f ext/native_btree/CMakeFiles/rbtree_type.dir/build.make ext/native_btree/CMakeFiles/rbtree_type.dir/build
156
+ .PHONY : rbtree_type/fast
157
+
158
+ # Convenience name for target.
159
+ ext/native_btree/CMakeFiles/comparator.dir/rule:
160
+ cd /root && $(MAKE) -f CMakeFiles/Makefile2 ext/native_btree/CMakeFiles/comparator.dir/rule
161
+ .PHONY : ext/native_btree/CMakeFiles/comparator.dir/rule
162
+
163
+ # Convenience name for target.
164
+ comparator: ext/native_btree/CMakeFiles/comparator.dir/rule
165
+
166
+ .PHONY : comparator
167
+
168
+ # fast build rule for target.
169
+ comparator/fast:
170
+ cd /root && $(MAKE) -f ext/native_btree/CMakeFiles/comparator.dir/build.make ext/native_btree/CMakeFiles/comparator.dir/build
171
+ .PHONY : comparator/fast
172
+
173
+ # Convenience name for target.
174
+ ext/native_btree/CMakeFiles/instance.dir/rule:
175
+ cd /root && $(MAKE) -f CMakeFiles/Makefile2 ext/native_btree/CMakeFiles/instance.dir/rule
176
+ .PHONY : ext/native_btree/CMakeFiles/instance.dir/rule
177
+
178
+ # Convenience name for target.
179
+ instance: ext/native_btree/CMakeFiles/instance.dir/rule
180
+
181
+ .PHONY : instance
182
+
183
+ # fast build rule for target.
184
+ instance/fast:
185
+ cd /root && $(MAKE) -f ext/native_btree/CMakeFiles/instance.dir/build.make ext/native_btree/CMakeFiles/instance.dir/build
186
+ .PHONY : instance/fast
187
+
188
+ # Convenience name for target.
189
+ ext/native_btree/CMakeFiles/iterators.dir/rule:
190
+ cd /root && $(MAKE) -f CMakeFiles/Makefile2 ext/native_btree/CMakeFiles/iterators.dir/rule
191
+ .PHONY : ext/native_btree/CMakeFiles/iterators.dir/rule
192
+
193
+ # Convenience name for target.
194
+ iterators: ext/native_btree/CMakeFiles/iterators.dir/rule
195
+
196
+ .PHONY : iterators
197
+
198
+ # fast build rule for target.
199
+ iterators/fast:
200
+ cd /root && $(MAKE) -f ext/native_btree/CMakeFiles/iterators.dir/build.make ext/native_btree/CMakeFiles/iterators.dir/build
201
+ .PHONY : iterators/fast
202
+
203
+ # Convenience name for target.
204
+ ext/native_btree/CMakeFiles/conversion.dir/rule:
205
+ cd /root && $(MAKE) -f CMakeFiles/Makefile2 ext/native_btree/CMakeFiles/conversion.dir/rule
206
+ .PHONY : ext/native_btree/CMakeFiles/conversion.dir/rule
207
+
208
+ # Convenience name for target.
209
+ conversion: ext/native_btree/CMakeFiles/conversion.dir/rule
210
+
211
+ .PHONY : conversion
212
+
213
+ # fast build rule for target.
214
+ conversion/fast:
215
+ cd /root && $(MAKE) -f ext/native_btree/CMakeFiles/conversion.dir/build.make ext/native_btree/CMakeFiles/conversion.dir/build
216
+ .PHONY : conversion/fast
217
+
218
+ comparator.o: comparator.c.o
219
+
220
+ .PHONY : comparator.o
221
+
222
+ # target to build an object file
223
+ comparator.c.o:
224
+ cd /root && $(MAKE) -f ext/native_btree/CMakeFiles/comparator.dir/build.make ext/native_btree/CMakeFiles/comparator.dir/comparator.c.o
225
+ .PHONY : comparator.c.o
226
+
227
+ comparator.i: comparator.c.i
228
+
229
+ .PHONY : comparator.i
230
+
231
+ # target to preprocess a source file
232
+ comparator.c.i:
233
+ cd /root && $(MAKE) -f ext/native_btree/CMakeFiles/comparator.dir/build.make ext/native_btree/CMakeFiles/comparator.dir/comparator.c.i
234
+ .PHONY : comparator.c.i
235
+
236
+ comparator.s: comparator.c.s
237
+
238
+ .PHONY : comparator.s
239
+
240
+ # target to generate assembly for a file
241
+ comparator.c.s:
242
+ cd /root && $(MAKE) -f ext/native_btree/CMakeFiles/comparator.dir/build.make ext/native_btree/CMakeFiles/comparator.dir/comparator.c.s
243
+ .PHONY : comparator.c.s
244
+
245
+ constructor.o: constructor.c.o
246
+
247
+ .PHONY : constructor.o
248
+
249
+ # target to build an object file
250
+ constructor.c.o:
251
+ cd /root && $(MAKE) -f ext/native_btree/CMakeFiles/constructor.dir/build.make ext/native_btree/CMakeFiles/constructor.dir/constructor.c.o
252
+ .PHONY : constructor.c.o
253
+
254
+ constructor.i: constructor.c.i
255
+
256
+ .PHONY : constructor.i
257
+
258
+ # target to preprocess a source file
259
+ constructor.c.i:
260
+ cd /root && $(MAKE) -f ext/native_btree/CMakeFiles/constructor.dir/build.make ext/native_btree/CMakeFiles/constructor.dir/constructor.c.i
261
+ .PHONY : constructor.c.i
262
+
263
+ constructor.s: constructor.c.s
264
+
265
+ .PHONY : constructor.s
266
+
267
+ # target to generate assembly for a file
268
+ constructor.c.s:
269
+ cd /root && $(MAKE) -f ext/native_btree/CMakeFiles/constructor.dir/build.make ext/native_btree/CMakeFiles/constructor.dir/constructor.c.s
270
+ .PHONY : constructor.c.s
271
+
272
+ conversion.o: conversion.c.o
273
+
274
+ .PHONY : conversion.o
275
+
276
+ # target to build an object file
277
+ conversion.c.o:
278
+ cd /root && $(MAKE) -f ext/native_btree/CMakeFiles/conversion.dir/build.make ext/native_btree/CMakeFiles/conversion.dir/conversion.c.o
279
+ .PHONY : conversion.c.o
280
+
281
+ conversion.i: conversion.c.i
282
+
283
+ .PHONY : conversion.i
284
+
285
+ # target to preprocess a source file
286
+ conversion.c.i:
287
+ cd /root && $(MAKE) -f ext/native_btree/CMakeFiles/conversion.dir/build.make ext/native_btree/CMakeFiles/conversion.dir/conversion.c.i
288
+ .PHONY : conversion.c.i
289
+
290
+ conversion.s: conversion.c.s
291
+
292
+ .PHONY : conversion.s
293
+
294
+ # target to generate assembly for a file
295
+ conversion.c.s:
296
+ cd /root && $(MAKE) -f ext/native_btree/CMakeFiles/conversion.dir/build.make ext/native_btree/CMakeFiles/conversion.dir/conversion.c.s
297
+ .PHONY : conversion.c.s
298
+
299
+ instance.o: instance.c.o
300
+
301
+ .PHONY : instance.o
302
+
303
+ # target to build an object file
304
+ instance.c.o:
305
+ cd /root && $(MAKE) -f ext/native_btree/CMakeFiles/instance.dir/build.make ext/native_btree/CMakeFiles/instance.dir/instance.c.o
306
+ .PHONY : instance.c.o
307
+
308
+ instance.i: instance.c.i
309
+
310
+ .PHONY : instance.i
311
+
312
+ # target to preprocess a source file
313
+ instance.c.i:
314
+ cd /root && $(MAKE) -f ext/native_btree/CMakeFiles/instance.dir/build.make ext/native_btree/CMakeFiles/instance.dir/instance.c.i
315
+ .PHONY : instance.c.i
316
+
317
+ instance.s: instance.c.s
318
+
319
+ .PHONY : instance.s
320
+
321
+ # target to generate assembly for a file
322
+ instance.c.s:
323
+ cd /root && $(MAKE) -f ext/native_btree/CMakeFiles/instance.dir/build.make ext/native_btree/CMakeFiles/instance.dir/instance.c.s
324
+ .PHONY : instance.c.s
325
+
326
+ iterators.o: iterators.c.o
327
+
328
+ .PHONY : iterators.o
329
+
330
+ # target to build an object file
331
+ iterators.c.o:
332
+ cd /root && $(MAKE) -f ext/native_btree/CMakeFiles/iterators.dir/build.make ext/native_btree/CMakeFiles/iterators.dir/iterators.c.o
333
+ .PHONY : iterators.c.o
334
+
335
+ iterators.i: iterators.c.i
336
+
337
+ .PHONY : iterators.i
338
+
339
+ # target to preprocess a source file
340
+ iterators.c.i:
341
+ cd /root && $(MAKE) -f ext/native_btree/CMakeFiles/iterators.dir/build.make ext/native_btree/CMakeFiles/iterators.dir/iterators.c.i
342
+ .PHONY : iterators.c.i
343
+
344
+ iterators.s: iterators.c.s
345
+
346
+ .PHONY : iterators.s
347
+
348
+ # target to generate assembly for a file
349
+ iterators.c.s:
350
+ cd /root && $(MAKE) -f ext/native_btree/CMakeFiles/iterators.dir/build.make ext/native_btree/CMakeFiles/iterators.dir/iterators.c.s
351
+ .PHONY : iterators.c.s
352
+
353
+ native_btree.o: native_btree.c.o
354
+
355
+ .PHONY : native_btree.o
356
+
357
+ # target to build an object file
358
+ native_btree.c.o:
359
+ cd /root && $(MAKE) -f ext/native_btree/CMakeFiles/native_btree.dir/build.make ext/native_btree/CMakeFiles/native_btree.dir/native_btree.c.o
360
+ .PHONY : native_btree.c.o
361
+
362
+ native_btree.i: native_btree.c.i
363
+
364
+ .PHONY : native_btree.i
365
+
366
+ # target to preprocess a source file
367
+ native_btree.c.i:
368
+ cd /root && $(MAKE) -f ext/native_btree/CMakeFiles/native_btree.dir/build.make ext/native_btree/CMakeFiles/native_btree.dir/native_btree.c.i
369
+ .PHONY : native_btree.c.i
370
+
371
+ native_btree.s: native_btree.c.s
372
+
373
+ .PHONY : native_btree.s
374
+
375
+ # target to generate assembly for a file
376
+ native_btree.c.s:
377
+ cd /root && $(MAKE) -f ext/native_btree/CMakeFiles/native_btree.dir/build.make ext/native_btree/CMakeFiles/native_btree.dir/native_btree.c.s
378
+ .PHONY : native_btree.c.s
379
+
380
+ rbtree_type.o: rbtree_type.c.o
381
+
382
+ .PHONY : rbtree_type.o
383
+
384
+ # target to build an object file
385
+ rbtree_type.c.o:
386
+ cd /root && $(MAKE) -f ext/native_btree/CMakeFiles/rbtree_type.dir/build.make ext/native_btree/CMakeFiles/rbtree_type.dir/rbtree_type.c.o
387
+ .PHONY : rbtree_type.c.o
388
+
389
+ rbtree_type.i: rbtree_type.c.i
390
+
391
+ .PHONY : rbtree_type.i
392
+
393
+ # target to preprocess a source file
394
+ rbtree_type.c.i:
395
+ cd /root && $(MAKE) -f ext/native_btree/CMakeFiles/rbtree_type.dir/build.make ext/native_btree/CMakeFiles/rbtree_type.dir/rbtree_type.c.i
396
+ .PHONY : rbtree_type.c.i
397
+
398
+ rbtree_type.s: rbtree_type.c.s
399
+
400
+ .PHONY : rbtree_type.s
401
+
402
+ # target to generate assembly for a file
403
+ rbtree_type.c.s:
404
+ cd /root && $(MAKE) -f ext/native_btree/CMakeFiles/rbtree_type.dir/build.make ext/native_btree/CMakeFiles/rbtree_type.dir/rbtree_type.c.s
405
+ .PHONY : rbtree_type.c.s
406
+
407
+ # Help Target
408
+ help:
409
+ @echo "The following are some of the valid targets for this Makefile:"
410
+ @echo "... all (the default if no target is provided)"
411
+ @echo "... clean"
412
+ @echo "... depend"
413
+ @echo "... rebuild_cache"
414
+ @echo "... edit_cache"
415
+ @echo "... native_btree"
416
+ @echo "... constructor"
417
+ @echo "... rbtree_type"
418
+ @echo "... comparator"
419
+ @echo "... instance"
420
+ @echo "... iterators"
421
+ @echo "... conversion"
422
+ @echo "... comparator.o"
423
+ @echo "... comparator.i"
424
+ @echo "... comparator.s"
425
+ @echo "... constructor.o"
426
+ @echo "... constructor.i"
427
+ @echo "... constructor.s"
428
+ @echo "... conversion.o"
429
+ @echo "... conversion.i"
430
+ @echo "... conversion.s"
431
+ @echo "... instance.o"
432
+ @echo "... instance.i"
433
+ @echo "... instance.s"
434
+ @echo "... iterators.o"
435
+ @echo "... iterators.i"
436
+ @echo "... iterators.s"
437
+ @echo "... native_btree.o"
438
+ @echo "... native_btree.i"
439
+ @echo "... native_btree.s"
440
+ @echo "... rbtree_type.o"
441
+ @echo "... rbtree_type.i"
442
+ @echo "... rbtree_type.s"
443
+ .PHONY : help
444
+
445
+
446
+
447
+ #=============================================================================
448
+ # Special targets to cleanup operation of make.
449
+
450
+ # Special rule to run CMake to check the build system integrity.
451
+ # No rule that depends on this can have commands that come from listfiles
452
+ # because they might be regenerated.
453
+ cmake_check_build_system:
454
+ cd /root && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
455
+ .PHONY : cmake_check_build_system
456
+
@@ -0,0 +1,13 @@
1
+ #include <comparator.h>
2
+
3
+ gint
4
+ rbtree_native_comparator(gconstpointer a, gconstpointer b, gpointer data)
5
+ {
6
+ RBTree *rbtree = (RBTree *) data;
7
+
8
+ VALUE result = rb_funcall(rbtree->comparator, rb_intern("call"), 2, (VALUE) a, (VALUE) b);
9
+
10
+ gint compare_result = NUM2INT(result);
11
+
12
+ return compare_result;
13
+ }
@@ -0,0 +1,19 @@
1
+ #include <constructor.h>
2
+ #include <comparator.h>
3
+ #include <rbtree_type.h>
4
+
5
+ VALUE
6
+ rbtree_initialize(VALUE self)
7
+ {
8
+ EXTRACT_RBTREE_SELF(rbtree);
9
+
10
+ rbtree->gtree = g_tree_new_with_data(
11
+ rbtree_native_comparator,
12
+ rbtree
13
+ );
14
+
15
+ rb_need_block();
16
+ rbtree->comparator = rb_block_proc();
17
+
18
+ return self;
19
+ }
@@ -0,0 +1,54 @@
1
+ #include <conversion.h>
2
+
3
+ static gboolean
4
+ rbtree_to_h_callback(gpointer key, gpointer value, gpointer data)
5
+ {
6
+ VALUE hash = (VALUE) data;
7
+
8
+ rb_hash_aset(hash, (VALUE) key, (VALUE) value);
9
+
10
+ return FALSE;
11
+ }
12
+
13
+
14
+ static gboolean
15
+ rbtree_to_a_callback(gpointer key, gpointer value, gpointer data)
16
+ {
17
+ VALUE array = (VALUE) data;
18
+ VALUE array2 = rb_ary_new2(2);
19
+
20
+ rb_ary_push(array2, (VALUE) key);
21
+ rb_ary_push(array2, (VALUE) value);
22
+
23
+ rb_ary_push(array, array2);
24
+
25
+ return FALSE;
26
+ }
27
+
28
+
29
+ VALUE
30
+ rbtree_to_h(VALUE self)
31
+ {
32
+ EXTRACT_RBTREE_SELF(rbtree);
33
+
34
+ VALUE hash = rb_hash_new();
35
+
36
+ g_tree_foreach(rbtree->gtree, rbtree_to_h_callback, (gpointer) hash);
37
+
38
+ return hash;
39
+ }
40
+
41
+
42
+ VALUE
43
+ rbtree_to_a(VALUE self)
44
+ {
45
+ EXTRACT_RBTREE_SELF(rbtree);
46
+
47
+ gint tree_size = g_tree_nnodes(rbtree->gtree);
48
+
49
+ VALUE array = rb_ary_new2(tree_size);
50
+
51
+ g_tree_foreach(rbtree->gtree, rbtree_to_a_callback, (gpointer) array);
52
+
53
+ return array;
54
+ }
@@ -0,0 +1,21 @@
1
+ #include <ruby.h>
2
+ #include <glib.h>
3
+
4
+ #ifndef _NATIVE_BTREE_COMMON_
5
+ #define _NATIVE_BTREE_COMMON_
6
+
7
+ #include <rbtree_type.h>
8
+
9
+ #define NATIVE_BTREE_MODULE "NativeBtree"
10
+ #define NATIVE_BTREE_CLASS "Btree"
11
+
12
+ #define EXTRACT_RBTREE(from, to) \
13
+ RBTree *to; \
14
+ TypedData_Get_Struct(from, RBTree, &rbtree_type, rbtree)
15
+
16
+ #define EXTRACT_RBTREE_SELF(to) EXTRACT_RBTREE(self, to)
17
+
18
+ extern VALUE rbtree_class;
19
+ extern VALUE rbtree_module;
20
+
21
+ #endif //_NATIVE_BTREE_COMMON_
@@ -0,0 +1,4 @@
1
+ #include <common.h>
2
+
3
+ gint
4
+ rbtree_native_comparator(gconstpointer a, gconstpointer b, gpointer data);
@@ -0,0 +1,11 @@
1
+ #include <common.h>
2
+
3
+ #ifndef _NATIVE_BTREE_CONSTRUCTOR_
4
+ #define _NATIVE_BTREE_CONSTRUCTOR_
5
+
6
+
7
+
8
+ VALUE rbtree_alloc(VALUE self);
9
+ VALUE rbtree_initialize(VALUE self);
10
+
11
+ #endif //_NATIVE_BTREE_COMMON_H_
@@ -0,0 +1,8 @@
1
+ #include <common.h>
2
+
3
+
4
+ VALUE
5
+ rbtree_to_h(VALUE self);
6
+
7
+ VALUE
8
+ rbtree_to_a(VALUE self);
@@ -0,0 +1,22 @@
1
+ #include <common.h>
2
+
3
+ VALUE
4
+ rbtree_set(VALUE self, VALUE key, VALUE value);
5
+
6
+ VALUE
7
+ rbtree_get(VALUE self, VALUE key);
8
+
9
+ VALUE
10
+ rbtree_delete(VALUE self, VALUE key);
11
+
12
+ VALUE
13
+ rbtree_size(VALUE self);
14
+
15
+ VALUE
16
+ rbtree_height(VALUE self);
17
+
18
+ VALUE
19
+ rbtree_clear(VALUE self);
20
+
21
+ VALUE
22
+ rbtree_is_include(VALUE self, VALUE key);
@@ -0,0 +1,5 @@
1
+ #include <common.h>
2
+
3
+
4
+ VALUE
5
+ rbtree_each(VALUE self);
@@ -1,55 +1,9 @@
1
1
  #ifndef _NATIVE_BTREE_
2
2
 
3
- #define NATIVE_BTREE "NativeBtree"
4
- #define NATIVE_BTREE_CLASS "Btree"
5
-
6
-
7
- #if defined(__cplusplus)
8
- extern "C" {
9
- #endif
10
-
11
- extern VALUE btree_class;
12
- extern VALUE btree_module;
13
- extern VALUE btree_class_from;
14
-
15
- VALUE
16
- btree_new(VALUE klass);
17
-
18
- VALUE
19
- btree_init(VALUE self);
20
-
21
- VALUE
22
- btree_size(VALUE self);
23
-
24
- VALUE
25
- btree_height(VALUE self);
26
-
27
- VALUE
28
- btree_set(VALUE self, VALUE key, VALUE value);
29
-
30
- VALUE
31
- btree_get(VALUE self, VALUE key);
32
-
33
- VALUE
34
- btree_delete(VALUE self, VALUE key);
35
-
36
- VALUE
37
- btree_clear(VALUE self);
38
-
39
- VALUE
40
- btree_has(VALUE self, VALUE key);
41
-
42
- VALUE
43
- btree_each(VALUE self);
44
-
45
- VALUE
46
- btree_cmp(VALUE self, VALUE tree2);
47
-
48
- VALUE
49
- btree_equal(VALUE self, VALUE tree2);
50
-
51
- #if defined(__cplusplus)
52
- }
53
- #endif
3
+ #include <common.h>
4
+ #include <constructor.h>
5
+ #include <instance.h>
6
+ #include <iterators.h>
7
+ #include <conversion.h>
54
8
 
55
9
  #endif // _NATIVE_BTREE_