Subversion Repositories HelenOS

Rev

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

Rev 2416 Rev 2421
Line 1... Line 1...
1
/*
1
/*
2
 * Copyright (C) 2006 Vojtech Mencl
2
 * Copyright (C) 2007 Vojtech Mencl
3
 * All rights reserved.
3
 * All rights reserved.
4
 *
4
 *
5
 * Redistribution and use in source and binary forms, with or without
5
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions
6
 * modification, are permitted provided that the following conditions
7
 * are met:
7
 * are met:
Line 92... Line 92...
92
    /** Sum of all keys in the right subtree. */
92
    /** Sum of all keys in the right subtree. */
93
    uint64_t rgt_sum;
93
    uint64_t rgt_sum;
94
};
94
};
95
 
95
 
96
/** Relative key Extended AVL tree structure (ExtAvlrel). */
96
/** Relative key Extended AVL tree structure (ExtAvlrel). */
97
#ifdef AVLTREE_TEST
-
 
98
struct extavlreltree
97
struct extavlreltree
99
{
98
{
100
    /*
99
    /*
101
     * ExtAvlrel root node pointer.
100
     * ExtAvlrel root node pointer.
102
     *
101
     *
Line 112... Line 111...
112
 
111
 
113
/** Create empty Extended AVL tree.
112
/** Create empty Extended AVL tree.
114
 *
113
 *
115
 * @param t Extended AVL tree structure.
114
 * @param t Extended AVL tree structure.
116
 */
115
 */
117
void extavlreltree_create (extavlreltree_t *t)
116
static inline void extavlreltree_create (extavlreltree_t *t)
118
{
117
{
119
    t->root = NULL;
118
    t->root = NULL;
120
 
119
 
121
    t->head.next = &t->head;
120
    t->head.next = &t->head;
122
    t->head.prev = &t->head;
121
    t->head.prev = &t->head;
Line 124... Line 123...
124
 
123
 
125
/** Initialize node.
124
/** Initialize node.
126
 *
125
 *
127
 * @param node Node which is initialized.
126
 * @param node Node which is initialized.
128
 */
127
 */
129
void extavlreltree_node_initialize(extavlreltree_node_t *node)
128
static inline void extavlreltree_node_initialize(extavlreltree_node_t *node)
130
{
129
{
131
    node->lft = NULL;
130
    node->lft = NULL;
132
    node->rgt = NULL;
131
    node->rgt = NULL;
133
    node->lft_height = 0;
132
    node->lft_height = 0;
134
    node->rgt_height = 0;
133
    node->rgt_height = 0;