added Count to trees

git-svn-id: svn://svn.code.sf.net/p/processhacker/code@3182 21ef857c-d57f-4fe0-8362-d861dc6d29cd
This commit is contained in:
wj32
2010-06-05 02:46:24 +00:00
parent d6cfe8c5c2
commit db318aa92e
2 changed files with 15 additions and 0 deletions
+11
View File
@@ -30,6 +30,7 @@ VOID PhInitializeBinaryTree(
Tree->Root.Parent = NULL;
Tree->Root.Left = NULL;
Tree->Root.Right = NULL;
Tree->Count = 0;
Tree->CompareFunction = CompareFunction;
}
@@ -113,6 +114,8 @@ PPH_BINARY_LINKS PhBinaryTreeAdd(
Subject->Left = NULL;
Subject->Right = NULL;
Tree->Count++;
return NULL;
}
@@ -170,6 +173,8 @@ VOID PhBinaryTreeRemove(
if (child->Right)
child->Right->Parent = child;
}
Tree->Count--;
}
PPH_BINARY_LINKS PhBinaryTreeSearch(
@@ -197,6 +202,8 @@ VOID PhInitializeAvlTree(
Tree->Root.Left = NULL;
Tree->Root.Right = NULL;
Tree->Root.Balance = 0;
Tree->Count = 0;
Tree->CompareFunction = CompareFunction;
}
@@ -709,6 +716,8 @@ PPH_AVL_LINKS PhAvlTreeAdd(
}
}
Tree->Count++;
return NULL;
}
@@ -829,6 +838,8 @@ VOID PhAvlTreeRemove(
if (newSubject->Right)
newSubject->Right->Parent = newSubject;
}
Tree->Count--;
}
PPH_AVL_LINKS PhAvlTreeSearch(
+4
View File
@@ -1810,6 +1810,8 @@ typedef INT (NTAPI *PPH_BINARY_TREE_COMPARE_FUNCTION)(
typedef struct _PH_BINARY_TREE
{
PH_BINARY_LINKS Root; // Right contains real root
ULONG Count;
PPH_BINARY_TREE_COMPARE_FUNCTION CompareFunction;
} PH_BINARY_TREE, *PPH_BINARY_TREE;
@@ -1851,6 +1853,8 @@ typedef INT (NTAPI *PPH_AVL_TREE_COMPARE_FUNCTION)(
typedef struct _PH_AVL_TREE
{
PH_AVL_LINKS Root; // Right contains real root
ULONG Count;
PPH_AVL_TREE_COMPARE_FUNCTION CompareFunction;
} PH_AVL_TREE, *PPH_AVL_TREE;