Subversion Repositories HelenOS-historic

Rev

Rev 1144 | Rev 1148 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1144 Rev 1147
Line 338... Line 338...
338
     * The key was not found in the *leaf_node and is smaller than any of its keys.
338
     * The key was not found in the *leaf_node and is smaller than any of its keys.
339
     */
339
     */
340
    return NULL;
340
    return NULL;
341
}
341
}
342
 
342
 
-
 
343
/** Return pointer to B-tree node's left sibling.
-
 
344
 *
-
 
345
 * @param t B-tree.
-
 
346
 * @param node Node whose left sibling will be returned.
-
 
347
 *
-
 
348
 * @return Left sibling of the node or NULL if the node does not have the left sibling.
-
 
349
 */
-
 
350
btree_node_t *btree_node_left_sibling(btree_t *t, btree_node_t *node)
-
 
351
{
-
 
352
    ASSERT(LEAF_NODE(node));
-
 
353
    if (node->leaf_link.prev != &t->leaf_head)
-
 
354
        return list_get_instance(node->leaf_link.prev, btree_node_t, leaf_link);
-
 
355
    else
-
 
356
        return NULL;
-
 
357
}
-
 
358
 
-
 
359
/** Return pointer to B-tree node's right sibling.
-
 
360
 *
-
 
361
 * @param t B-tree.
-
 
362
 * @param node Node whose right sibling will be returned.
-
 
363
 *
-
 
364
 * @return Right sibling of the node or NULL if the node does not have the right sibling.
-
 
365
 */
-
 
366
btree_node_t *btree_node_right_sibling(btree_t *t, btree_node_t *node)
-
 
367
{
-
 
368
    ASSERT(LEAF_NODE(node));
-
 
369
    if (node->leaf_link.next != &t->leaf_head)
-
 
370
        return list_get_instance(node->leaf_link.next, btree_node_t, leaf_link);
-
 
371
    else
-
 
372
        return NULL;
-
 
373
}
-
 
374
 
343
/** Initialize B-tree node.
375
/** Initialize B-tree node.
344
 *
376
 *
345
 * @param node B-tree node.
377
 * @param node B-tree node.
346
 */
378
 */
347
void node_initialize(btree_node_t *node)
379
void node_initialize(btree_node_t *node)