docs/src/modules.md

changeset 314
5d28dc8f0765
parent 310
b09677d72413
child 321
9af21a50b516
equal deleted inserted replaced
313:b7753273f0fd 314:5d28dc8f0765
67 67
68 /* ----------- 68 /* -----------
69 * Source code 69 * Source code
70 */ 70 */
71 71
72 UcxAVLTree* tree = ucx_avl_new(ucx_longintcmp); 72 UcxAVLTree* tree = ucx_avl_new(ucx_cmp_longint);
73 /* ... populate tree with objects, use '& MyObject.ts' as key ... */ 73 /* ... populate tree with objects, use '& MyObject.ts' as key ... */
74 74
75 75
76 /* Now find every item, with 30 <= ts <= 70 */ 76 /* Now find every item, with 30 <= ts <= 70 */
77 time_t ts_start = 30; 77 time_t ts_start = 30;
79 79
80 printf("Values in range:\n"); 80 printf("Values in range:\n");
81 for ( 81 for (
82 UcxAVLNode* node = ucx_avl_find_node( 82 UcxAVLNode* node = ucx_avl_find_node(
83 tree, (intptr_t) &ts_start, 83 tree, (intptr_t) &ts_start,
84 ucx_longintdist, UCX_AVL_FIND_LOWER_BOUNDED); 84 ucx_dist_longint, UCX_AVL_FIND_LOWER_BOUNDED);
85 node && (*(time_t*)node->key) <= ts_end; 85 node && (*(time_t*)node->key) <= ts_end;
86 node = ucx_avl_succ(node) 86 node = ucx_avl_succ(node)
87 ) { 87 ) {
88 printf(" ts: %ld\n", ((MyObject*)node->value)->ts); 88 printf(" ts: %ld\n", ((MyObject*)node->value)->ts);
89 } 89 }

mercurial