Lines Matching refs:root
87 /* insert_id inserts a NEW_ID rec into the tree whose ROOT is
89 ROOT down is increased otherwise it returns FALSE. This is a
92 int insert_id (id_rec **root, id_rec *new_id)
96 /* If root is NULL, this where it is to be inserted. */
97 if (*root == NULL)
99 *root = new_id;
107 if (strcmp (new_id->id, (*root)->id) < 0)
110 if (insert_id (&((*root)->left), new_id))
113 (*root)->balance--;
115 switch ((*root)->balance)
122 A = *root;
123 B = (*root)->left;
129 *root = B;
136 *root = B->right;
137 B->right = (*root)->left;
138 A->left = (*root)->right;
139 (*root)->left = B;
140 (*root)->right = A;
141 switch ((*root)->balance)
156 (*root)->balance = 0;
164 if (insert_id (&((*root)->right), new_id))
167 (*root)->balance++;
168 switch ((*root)->balance)
175 A = *root;
176 B = (*root)->right;
182 *root = B;
189 *root = B->left;
190 B->left = (*root)->right;
191 A->right = (*root)->left;
192 (*root)->left = A;
193 (*root)->right = B;
194 switch ((*root)->balance)
209 (*root)->balance = 0;