Go to the source code of this file.
Functions | |
void | tree_init (tree **ppr_tree) |
tree_t | tree_srch (tree **ppr_tree, int(*pfi_compare)(), tree_t p_user) |
void | tree_add (tree **ppr_tree, int(*pfi_compare)(), tree_t p_user, void(*pfv_uar)()) |
int | tree_delete (tree **ppr_p, int(*pfi_compare)(), tree_t p_user, void(*pfv_uar)()) |
int | tree_trav (tree **ppr_tree, int(*pfi_uar)()) |
void | tree_mung (tree **ppr_tree, void(*pfv_uar)()) |
Definition at line 91 of file tree.c.
Referenced by DeleteEntry().
00093 { 00094 int i_balance = FALSE, i_uar_called = FALSE; 00095 00096 ENTER("tree_delete"); 00097 EXIT(delete(ppr_p, pfi_compare, p_user, pfv_uar, &i_balance, 00098 &i_uar_called)); 00099 } int tree_trav(tree ** ppr_tree, int (*pfi_uar) ( /* ??? */ ))
void tree_init | ( | tree ** | ppr_tree | ) |
void tree_mung | ( | tree ** | ppr_tree, | |
void(*)() | pfv_uar | |||
) |
Definition at line 114 of file tree.c.
Referenced by ClearTree(), and tree_mung().
00115 { 00116 ENTER("tree_mung"); 00117 if (*ppr_tree) { 00118 tree_mung(&(**ppr_tree).tree_l, pfv_uar); 00119 tree_mung(&(**ppr_tree).tree_r, pfv_uar); 00120 if (pfv_uar) 00121 (*pfv_uar) ((**ppr_tree).tree_p); 00122 free(*ppr_tree); 00123 *ppr_tree = NULL; 00124 } 00125 EXITV; 00126 }
Definition at line 55 of file tree.c.
Referenced by FindNode(), and tree_srch().
00057 { 00058 register int i_comp; 00059 00060 ENTER("tree_srch"); 00061 00062 if (*ppr_tree) { 00063 i_comp = (*pfi_compare) (p_user, (**ppr_tree).tree_p); 00064 if (i_comp > 0) 00065 EXIT(tree_srch(&(**ppr_tree).tree_r, pfi_compare, p_user)); 00066 if (i_comp < 0) 00067 EXIT(tree_srch(&(**ppr_tree).tree_l, pfi_compare, p_user)); 00068 00069 /* not higher, not lower... this must be the one. 00070 */ 00071 EXIT((**ppr_tree).tree_p); 00072 } 00073 00074 /* grounded. NOT found. 00075 */ 00076 EXIT(NULL); 00077 }
int tree_trav | ( | tree ** | ppr_tree, | |
int(*)() | pfi_uar | |||
) |
Definition at line 99 of file tree.c.
Referenced by GoThruTree(), and SaveTree().
00100 { 00101 ENTER("tree_trav"); 00102 00103 if (!*ppr_tree) 00104 EXIT(TRUE); 00105 00106 if (!tree_trav(&(**ppr_tree).tree_l, pfi_uar)) 00107 EXIT(FALSE); 00108 if (!(*pfi_uar) ((**ppr_tree).tree_p)) 00109 EXIT(FALSE); 00110 if (!tree_trav(&(**ppr_tree).tree_r, pfi_uar)) 00111 EXIT(FALSE); 00112 EXIT(TRUE); 00113 }