1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>section-avltree: Raptor RDF Syntax Library Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="Raptor RDF Syntax Library Manual">
<link rel="up" href="reference-manual.html" title="Part II. Raptor Reference Manual">
<link rel="prev" href="raptor2-section-memory.html" title="section-memory">
<link rel="next" href="raptor2-section-constants.html" title="section-constants">
<meta name="generator" content="GTK-Doc V1.33.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span>
<a href="#raptor2-section-avltree.description" class="shortcut">Description</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="reference-manual.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="raptor2-section-memory.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="raptor2-section-constants.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="raptor2-section-avltree"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="raptor2-section-avltree.top_of_page"></a>section-avltree</span></h2>
<p>section-avltree</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="raptor2-section-avltree.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_proto_type">
<col class="functions_proto_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<a class="link" href="raptor2-section-avltree.html#raptor-avltree" title="raptor_avltree"><span class="returnvalue">raptor_avltree</span></a> *
</td>
<td class="function_name">
<a class="link" href="raptor2-section-avltree.html#raptor-new-avltree" title="raptor_new_avltree ()">raptor_new_avltree</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="raptor2-section-avltree.html#raptor-free-avltree" title="raptor_free_avltree ()">raptor_free_avltree</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="raptor2-section-avltree.html#raptor-avltree-add" title="raptor_avltree_add ()">raptor_avltree_add</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="raptor2-section-avltree.html#raptor-avltree-delete" title="raptor_avltree_delete ()">raptor_avltree_delete</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="raptor2-section-avltree.html#raptor-avltree-print" title="raptor_avltree_print ()">raptor_avltree_print</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span> *
</td>
<td class="function_name">
<a class="link" href="raptor2-section-avltree.html#raptor-avltree-remove" title="raptor_avltree_remove ()">raptor_avltree_remove</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span> *
</td>
<td class="function_name">
<a class="link" href="raptor2-section-avltree.html#raptor-avltree-search" title="raptor_avltree_search ()">raptor_avltree_search</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="raptor2-section-avltree.html#raptor-avltree-set-print-handler" title="raptor_avltree_set_print_handler ()">raptor_avltree_set_print_handler</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="raptor2-section-avltree.html#raptor-avltree-size" title="raptor_avltree_size ()">raptor_avltree_size</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="raptor2-section-avltree.html#raptor-avltree-trim" title="raptor_avltree_trim ()">raptor_avltree_trim</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="raptor2-section-avltree.html#raptor-avltree-visit" title="raptor_avltree_visit ()">raptor_avltree_visit</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="raptor2-section-avltree.html#raptor-avltree-iterator" title="raptor_avltree_iterator"><span class="returnvalue">raptor_avltree_iterator</span></a> *
</td>
<td class="function_name">
<a class="link" href="raptor2-section-avltree.html#raptor-new-avltree-iterator" title="raptor_new_avltree_iterator ()">raptor_new_avltree_iterator</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="raptor2-section-avltree.html#raptor-free-avltree-iterator" title="raptor_free_avltree_iterator ()">raptor_free_avltree_iterator</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span> *
</td>
<td class="function_name">
<a class="link" href="raptor2-section-avltree.html#raptor-avltree-iterator-get" title="raptor_avltree_iterator_get ()">raptor_avltree_iterator_get</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="raptor2-section-avltree.html#raptor-avltree-iterator-is-end" title="raptor_avltree_iterator_is_end ()">raptor_avltree_iterator_is_end</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="raptor2-section-avltree.html#raptor-avltree-iterator-next" title="raptor_avltree_iterator_next ()">raptor_avltree_iterator_next</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">int</span>
</td>
<td class="function_name">
<span class="c_punctuation">(</span><a class="link" href="raptor2-section-avltree.html#raptor-avltree-visit-handler" title="raptor_avltree_visit_handler ()">*raptor_avltree_visit_handler</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="raptor2-section-avltree.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="other_proto_type">
<col class="other_proto_name">
</colgroup>
<tbody>
<tr>
<td class="typedef_keyword">typedef</td>
<td class="function_name"><a class="link" href="raptor2-section-avltree.html#raptor-avltree" title="raptor_avltree">raptor_avltree</a></td>
</tr>
<tr>
<td class="datatype_keyword">enum</td>
<td class="function_name"><a class="link" href="raptor2-section-avltree.html#raptor-avltree-bitflags" title="enum raptor_avltree_bitflags">raptor_avltree_bitflags</a></td>
</tr>
<tr>
<td class="typedef_keyword">typedef</td>
<td class="function_name"><a class="link" href="raptor2-section-avltree.html#raptor-avltree-iterator" title="raptor_avltree_iterator">raptor_avltree_iterator</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="raptor2-section-avltree.description"></a><h2>Description</h2>
</div>
<div class="refsect1">
<a name="raptor2-section-avltree.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="raptor-new-avltree"></a><h3>raptor_new_avltree ()</h3>
<pre class="programlisting"><a class="link" href="raptor2-section-avltree.html#raptor-avltree" title="raptor_avltree"><span class="returnvalue">raptor_avltree</span></a> *
raptor_new_avltree (<em class="parameter"><code><a class="link" href="raptor2-section-general.html#raptor-data-compare-handler" title="raptor_data_compare_handler ()"><span class="type">raptor_data_compare_handler</span></a> compare_handler</code></em>,
<em class="parameter"><code><a class="link" href="raptor2-section-general.html#raptor-data-free-handler" title="raptor_data_free_handler ()"><span class="type">raptor_data_free_handler</span></a> free_handler</code></em>,
<em class="parameter"><code>unsigned <span class="type">int</span> flags</code></em>);</pre>
<p>AVL Tree Constructor</p>
<div class="refsect3">
<a name="raptor-new-avltree.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>compare_handler</p></td>
<td class="parameter_description"><p>item comparison handler for ordering</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>free_handler</p></td>
<td class="parameter_description"><p>item free handler (or NULL)</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>flags</p></td>
<td class="parameter_description"><p>AVLTree flags - bitmask of <a class="link" href="raptor2-section-avltree.html#raptor-avltree-bitflags" title="enum raptor_avltree_bitflags"><span class="type">raptor_avltree_bitflags</span></a> flags.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="raptor-new-avltree.returns"></a><h4>Returns</h4>
<p> new AVL Tree or NULL on failure</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="raptor-free-avltree"></a><h3>raptor_free_avltree ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
raptor_free_avltree (<em class="parameter"><code><a class="link" href="raptor2-section-avltree.html#raptor-avltree" title="raptor_avltree"><span class="type">raptor_avltree</span></a> *tree</code></em>);</pre>
<p>AVL Tree destructor</p>
<div class="refsect3">
<a name="raptor-free-avltree.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>tree</p></td>
<td class="parameter_description"><p>AVLTree object</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="raptor-avltree-add"></a><h3>raptor_avltree_add ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
raptor_avltree_add (<em class="parameter"><code><a class="link" href="raptor2-section-avltree.html#raptor-avltree" title="raptor_avltree"><span class="type">raptor_avltree</span></a> *tree</code></em>,
<em class="parameter"><code><span class="type">void</span> *p_data</code></em>);</pre>
<p>add an item to an AVL Tree</p>
<p>The item added becomes owned by the AVL Tree, and will be freed by
the free_handler argument given to <a class="link" href="raptor2-section-avltree.html#raptor-new-avltree" title="raptor_new_avltree ()"><code class="function">raptor_new_avltree()</code></a>.</p>
<div class="refsect3">
<a name="raptor-avltree-add.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>tree</p></td>
<td class="parameter_description"><p>AVL Tree object</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>p_data</p></td>
<td class="parameter_description"><p>pointer to data item</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="raptor-avltree-add.returns"></a><h4>Returns</h4>
<p> 0 on success, >0 if equivalent item exists (and the old element remains in the tree), <0 on failure</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="raptor-avltree-delete"></a><h3>raptor_avltree_delete ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
raptor_avltree_delete (<em class="parameter"><code><a class="link" href="raptor2-section-avltree.html#raptor-avltree" title="raptor_avltree"><span class="type">raptor_avltree</span></a> *tree</code></em>,
<em class="parameter"><code><span class="type">void</span> *p_data</code></em>);</pre>
<p>Remove an item from an AVL Tree and free it</p>
<div class="refsect3">
<a name="raptor-avltree-delete.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>tree</p></td>
<td class="parameter_description"><p>AVL Tree object</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>p_data</p></td>
<td class="parameter_description"><p>pointer to data item</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="raptor-avltree-delete.returns"></a><h4>Returns</h4>
<p> non-0 on failure</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="raptor-avltree-print"></a><h3>raptor_avltree_print ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
raptor_avltree_print (<em class="parameter"><code><a class="link" href="raptor2-section-avltree.html#raptor-avltree" title="raptor_avltree"><span class="type">raptor_avltree</span></a> *tree</code></em>,
<em class="parameter"><code><span class="type">FILE</span> *stream</code></em>);</pre>
<p>Print the items in the tree in order to a stream (for debugging)</p>
<div class="refsect3">
<a name="raptor-avltree-print.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>tree</p></td>
<td class="parameter_description"><p>AVL Tree</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>stream</p></td>
<td class="parameter_description"><p>stream to print to</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="raptor-avltree-print.returns"></a><h4>Returns</h4>
<p> non-0 on failure</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="raptor-avltree-remove"></a><h3>raptor_avltree_remove ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> *
raptor_avltree_remove (<em class="parameter"><code><a class="link" href="raptor2-section-avltree.html#raptor-avltree" title="raptor_avltree"><span class="type">raptor_avltree</span></a> *tree</code></em>,
<em class="parameter"><code><span class="type">void</span> *p_data</code></em>);</pre>
<p>Remove an item from an AVL Tree and return it</p>
<p>The item removed is no longer owned by the AVL Tree and is
owned by the caller.</p>
<div class="refsect3">
<a name="raptor-avltree-remove.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>tree</p></td>
<td class="parameter_description"><p>AVL Tree object</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>p_data</p></td>
<td class="parameter_description"><p>pointer to data item</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="raptor-avltree-remove.returns"></a><h4>Returns</h4>
<p> object or NULL on failure or if not found</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="raptor-avltree-search"></a><h3>raptor_avltree_search ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> *
raptor_avltree_search (<em class="parameter"><code><a class="link" href="raptor2-section-avltree.html#raptor-avltree" title="raptor_avltree"><span class="type">raptor_avltree</span></a> *tree</code></em>,
<em class="parameter"><code>const <span class="type">void</span> *p_data</code></em>);</pre>
<p>Find an item in an AVL Tree</p>
<div class="refsect3">
<a name="raptor-avltree-search.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>tree</p></td>
<td class="parameter_description"><p>AVL Tree object</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>p_data</p></td>
<td class="parameter_description"><p>pointer to data item</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="raptor-avltree-search.returns"></a><h4>Returns</h4>
<p> shared pointer to item (still owned by AVL Tree) or NULL on failure or if not found</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="raptor-avltree-set-print-handler"></a><h3>raptor_avltree_set_print_handler ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
raptor_avltree_set_print_handler (<em class="parameter"><code><a class="link" href="raptor2-section-avltree.html#raptor-avltree" title="raptor_avltree"><span class="type">raptor_avltree</span></a> *tree</code></em>,
<em class="parameter"><code><a class="link" href="raptor2-section-general.html#raptor-data-print-handler" title="raptor_data_print_handler ()"><span class="type">raptor_data_print_handler</span></a> print_handler</code></em>);</pre>
<p>Set the handler for printing an item in a tree</p>
<div class="refsect3">
<a name="raptor-avltree-set-print-handler.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>tree</p></td>
<td class="parameter_description"><p>AVL Tree object</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>print_handler</p></td>
<td class="parameter_description"><p>print function</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="raptor-avltree-size"></a><h3>raptor_avltree_size ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
raptor_avltree_size (<em class="parameter"><code><a class="link" href="raptor2-section-avltree.html#raptor-avltree" title="raptor_avltree"><span class="type">raptor_avltree</span></a> *tree</code></em>);</pre>
<p>Get the number of items in the AVL Tree</p>
<div class="refsect3">
<a name="raptor-avltree-size.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>tree</p></td>
<td class="parameter_description"><p>AVL Tree object</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="raptor-avltree-size.returns"></a><h4>Returns</h4>
<p> number of items in tree</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="raptor-avltree-trim"></a><h3>raptor_avltree_trim ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
raptor_avltree_trim (<em class="parameter"><code><a class="link" href="raptor2-section-avltree.html#raptor-avltree" title="raptor_avltree"><span class="type">raptor_avltree</span></a> *tree</code></em>);</pre>
<p>Delete all nodes from an AVL tree but keep the shell.</p>
<div class="refsect3">
<a name="raptor-avltree-trim.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>tree</p></td>
<td class="parameter_description"><p>AVLTree object</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="raptor-avltree-visit"></a><h3>raptor_avltree_visit ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
raptor_avltree_visit (<em class="parameter"><code><a class="link" href="raptor2-section-avltree.html#raptor-avltree" title="raptor_avltree"><span class="type">raptor_avltree</span></a> *tree</code></em>,
<em class="parameter"><code><a class="link" href="raptor2-section-avltree.html#raptor-avltree-visit-handler" title="raptor_avltree_visit_handler ()"><span class="type">raptor_avltree_visit_handler</span></a> visit_handler</code></em>,
<em class="parameter"><code><span class="type">void</span> *user_data</code></em>);</pre>
<p>Perform an in-order visit of the items in the AVL Tree</p>
<div class="refsect3">
<a name="raptor-avltree-visit.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>tree</p></td>
<td class="parameter_description"><p>AVL Tree object</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>visit_handler</p></td>
<td class="parameter_description"><p>visit function to call at each item</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>user_data</p></td>
<td class="parameter_description"><p>user data pointer fo visit function</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="raptor-avltree-visit.returns"></a><h4>Returns</h4>
<p> non-0 if traversal was terminated early by <em class="parameter"><code>visit_handler</code></em>
</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="raptor-new-avltree-iterator"></a><h3>raptor_new_avltree_iterator ()</h3>
<pre class="programlisting"><a class="link" href="raptor2-section-avltree.html#raptor-avltree-iterator" title="raptor_avltree_iterator"><span class="returnvalue">raptor_avltree_iterator</span></a> *
raptor_new_avltree_iterator (<em class="parameter"><code><a class="link" href="raptor2-section-avltree.html#raptor-avltree" title="raptor_avltree"><span class="type">raptor_avltree</span></a> *tree</code></em>,
<em class="parameter"><code><span class="type">void</span> *range</code></em>,
<em class="parameter"><code><a class="link" href="raptor2-section-general.html#raptor-data-free-handler" title="raptor_data_free_handler ()"><span class="type">raptor_data_free_handler</span></a> range_free_handler</code></em>,
<em class="parameter"><code><span class="type">int</span> direction</code></em>);</pre>
<p>Get an in-order iterator for the start of a range, or the entire contents</p>
<p>If range is NULL, the entire tree is walked in order. If range
specifies a range (i.e. the tree comparison function will 'match'
(return 0 for) range and /several/ nodes), the iterator will be
placed at the leftmost child matching range, and
raptor_avltree_iterator_next will iterate over all nodes (and only
nodes) that match range.</p>
<div class="refsect3">
<a name="raptor-new-avltree-iterator.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>tree</p></td>
<td class="parameter_description"><p><a class="link" href="raptor2-section-avltree.html#raptor-avltree" title="raptor_avltree"><span class="type">raptor_avltree</span></a> object</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>range</p></td>
<td class="parameter_description"><p>range</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>range_free_handler</p></td>
<td class="parameter_description"><p>function to free <em class="parameter"><code>range</code></em>
object</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>direction</p></td>
<td class="parameter_description"><p><0 to go 'backwards' otherwise 'forwards'</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="raptor-new-avltree-iterator.returns"></a><h4>Returns</h4>
<p> a new <a class="link" href="raptor2-section-avltree.html#raptor-avltree-iterator" title="raptor_avltree_iterator"><span class="type">raptor_avltree_iterator</span></a> object or NULL on failure</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="raptor-free-avltree-iterator"></a><h3>raptor_free_avltree_iterator ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
raptor_free_avltree_iterator (<em class="parameter"><code><a class="link" href="raptor2-section-avltree.html#raptor-avltree-iterator" title="raptor_avltree_iterator"><span class="type">raptor_avltree_iterator</span></a> *iterator</code></em>);</pre>
<p>AVL Tree Iterator destructor</p>
<div class="refsect3">
<a name="raptor-free-avltree-iterator.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>iterator</p></td>
<td class="parameter_description"><p>AVL Tree iterator object</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="raptor-avltree-iterator-get"></a><h3>raptor_avltree_iterator_get ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> *
raptor_avltree_iterator_get (<em class="parameter"><code><a class="link" href="raptor2-section-avltree.html#raptor-avltree-iterator" title="raptor_avltree_iterator"><span class="type">raptor_avltree_iterator</span></a> *iterator</code></em>);</pre>
<p>Get current iteration object</p>
<div class="refsect3">
<a name="raptor-avltree-iterator-get.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>iterator</p></td>
<td class="parameter_description"><p>AVL Tree iterator object</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="raptor-avltree-iterator-get.returns"></a><h4>Returns</h4>
<p> object or NULL if iteration is finished</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="raptor-avltree-iterator-is-end"></a><h3>raptor_avltree_iterator_is_end ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
raptor_avltree_iterator_is_end (<em class="parameter"><code><a class="link" href="raptor2-section-avltree.html#raptor-avltree-iterator" title="raptor_avltree_iterator"><span class="type">raptor_avltree_iterator</span></a> *iterator</code></em>);</pre>
<p>Test if an iteration is finished</p>
<div class="refsect3">
<a name="raptor-avltree-iterator-is-end.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>iterator</p></td>
<td class="parameter_description"><p>AVL Tree iterator object</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="raptor-avltree-iterator-is-end.returns"></a><h4>Returns</h4>
<p> non-0 if iteration is finished</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="raptor-avltree-iterator-next"></a><h3>raptor_avltree_iterator_next ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
raptor_avltree_iterator_next (<em class="parameter"><code><a class="link" href="raptor2-section-avltree.html#raptor-avltree-iterator" title="raptor_avltree_iterator"><span class="type">raptor_avltree_iterator</span></a> *iterator</code></em>);</pre>
<p>Move iteration to next/prev object</p>
<div class="refsect3">
<a name="raptor-avltree-iterator-next.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>iterator</p></td>
<td class="parameter_description"><p>AVL Tree iterator object</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="raptor-avltree-iterator-next.returns"></a><h4>Returns</h4>
<p> non-0 if iteration is finished</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="raptor-avltree-visit-handler"></a><h3>raptor_avltree_visit_handler ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
<span class="c_punctuation">(</span>*raptor_avltree_visit_handler<span class="c_punctuation">)</span> (<em class="parameter"><code><span class="type">int</span> depth</code></em>,
<em class="parameter"><code><span class="type">void</span> *data</code></em>,
<em class="parameter"><code><span class="type">void</span> *user_data</code></em>);</pre>
<p>AVL Tree visitor function as given to <a class="link" href="raptor2-section-avltree.html#raptor-avltree-visit" title="raptor_avltree_visit ()"><code class="function">raptor_avltree_visit()</code></a></p>
<div class="refsect3">
<a name="raptor-avltree-visit-handler.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>depth</p></td>
<td class="parameter_description"><p>depth of object in tree</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>data</p></td>
<td class="parameter_description"><p>data object being visited</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>user_data</p></td>
<td class="parameter_description"><p>user data arg to <a class="link" href="raptor2-section-avltree.html#raptor-avltree-visit" title="raptor_avltree_visit ()"><code class="function">raptor_avltree_visit()</code></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="raptor-avltree-visit-handler.returns"></a><h4>Returns</h4>
<p> non-0 to terminate visit early.</p>
</div>
</div>
</div>
<div class="refsect1">
<a name="raptor2-section-avltree.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="raptor-avltree"></a><h3>raptor_avltree</h3>
<pre class="programlisting">typedef struct raptor_avltree_s raptor_avltree;
</pre>
<p>AVL Tree</p>
</div>
<hr>
<div class="refsect2">
<a name="raptor-avltree-bitflags"></a><h3>enum raptor_avltree_bitflags</h3>
<p>Bit flags for AVL Tree class constructor <a class="link" href="raptor2-section-avltree.html#raptor-new-avltree" title="raptor_new_avltree ()"><code class="function">raptor_new_avltree()</code></a></p>
<div class="refsect3">
<a name="raptor-avltree-bitflags.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="enum_members_name">
<col class="enum_members_description">
<col width="200px" class="enum_members_annotations">
</colgroup>
<tbody><tr>
<td class="enum_member_name"><p><a name="RAPTOR-AVLTREE-FLAG-REPLACE-DUPLICATES:CAPS"></a>RAPTOR_AVLTREE_FLAG_REPLACE_DUPLICATES</p></td>
<td class="enum_member_description">
<p>If set <a class="link" href="raptor2-section-avltree.html#raptor-avltree-add" title="raptor_avltree_add ()"><code class="function">raptor_avltree_add()</code></a> will replace any duplicate items. If not set, <a class="link" href="raptor2-section-avltree.html#raptor-avltree-add" title="raptor_avltree_add ()"><code class="function">raptor_avltree_add()</code></a> will not replace them and will return status >0 when adding a duplicate. (Default is not set)</p>
</td>
<td class="enum_member_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="raptor-avltree-iterator"></a><h3>raptor_avltree_iterator</h3>
<pre class="programlisting">typedef struct raptor_avltree_iterator_s raptor_avltree_iterator;
</pre>
<p>AVL Tree Iterator as created by <a class="link" href="raptor2-section-avltree.html#raptor-new-avltree-iterator" title="raptor_new_avltree_iterator ()"><code class="function">raptor_new_avltree_iterator()</code></a></p>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.33.1</div>
</body>
</html>
|