1 /* COPYRIGHT: See COPYING in the top level directory
2 * PROJECT: ReactOS system libraries
3 * PURPOSE: Generic Table Implementation
4 * FILE: lib/rtl/genertictbl.c
8 /* INCLUDES *****************************************************************/
15 /* FUNCTIONS *****************************************************************/
22 RtlDeleteElementGenericTable (
23 PRTL_GENERIC_TABLE Table
,
36 RtlDeleteElementGenericTableAvl (
50 RtlEnumerateGenericTable (
51 PRTL_GENERIC_TABLE Table
,
64 RtlEnumerateGenericTableAvl (
78 RtlEnumerateGenericTableLikeADirectory (
79 IN PRTL_AVL_TABLE Table
,
80 IN PRTL_AVL_MATCH_FUNCTION MatchFunction
,
83 IN OUT PVOID
*RestartKey
,
84 IN OUT PULONG DeleteCount
,
97 RtlEnumerateGenericTableWithoutSplaying (
98 PRTL_GENERIC_TABLE Table
,
111 RtlEnumerateGenericTableWithoutSplayingAvl (
112 PRTL_AVL_TABLE Table
,
125 RtlGetElementGenericTable(
126 PRTL_GENERIC_TABLE Table
,
139 RtlGetElementGenericTableAvl (
140 PRTL_AVL_TABLE Table
,
153 RtlInitializeGenericTable (
154 PRTL_GENERIC_TABLE Table
,
155 PRTL_GENERIC_COMPARE_ROUTINE CompareRoutine
,
156 PRTL_GENERIC_ALLOCATE_ROUTINE AllocateRoutine
,
157 PRTL_GENERIC_FREE_ROUTINE FreeRoutine
,
169 RtlInitializeGenericTableAvl(IN OUT PRTL_AVL_TABLE Table
,
170 IN PRTL_AVL_COMPARE_ROUTINE CompareRoutine
,
171 IN PRTL_AVL_ALLOCATE_ROUTINE AllocateRoutine
,
172 IN PRTL_AVL_FREE_ROUTINE FreeRoutine
,
173 IN PVOID TableContext
)
176 sizeof(RTL_AVL_TABLE
));
177 Table
->BalancedRoot
.Parent
= &Table
->BalancedRoot
;
179 Table
->CompareRoutine
= CompareRoutine
;
180 Table
->AllocateRoutine
= AllocateRoutine
;
181 Table
->FreeRoutine
= FreeRoutine
;
182 Table
->TableContext
= TableContext
;
191 RtlInsertElementGenericTable (
192 PRTL_GENERIC_TABLE Table
,
195 PBOOLEAN NewElement OPTIONAL
207 RtlInsertElementGenericTableAvl (
208 PRTL_AVL_TABLE Table
,
211 PBOOLEAN NewElement OPTIONAL
223 RtlInsertElementGenericTableFull (
224 PRTL_GENERIC_TABLE Table
,
227 PBOOLEAN NewElement OPTIONAL
,
229 TABLE_SEARCH_RESULT SearchResult
241 RtlInsertElementGenericTableFullAvl (
242 PRTL_AVL_TABLE Table
,
245 PBOOLEAN NewElement OPTIONAL
,
247 TABLE_SEARCH_RESULT SearchResult
260 RtlIsGenericTableEmpty (
261 PRTL_GENERIC_TABLE Table
273 RtlIsGenericTableEmptyAvl (
287 RtlLookupElementGenericTable (
288 PRTL_GENERIC_TABLE Table
,
301 RtlLookupElementGenericTableAvl (
302 PRTL_AVL_TABLE Table
,
315 RtlLookupElementGenericTableFull (
316 PRTL_GENERIC_TABLE Table
,
318 OUT PVOID
*NodeOrParent
,
319 OUT TABLE_SEARCH_RESULT
*SearchResult
331 RtlLookupElementGenericTableFullAvl (
332 PRTL_AVL_TABLE Table
,
334 OUT PVOID
*NodeOrParent
,
335 OUT TABLE_SEARCH_RESULT
*SearchResult
347 RtlNumberGenericTableElements(IN PRTL_GENERIC_TABLE Table
)
349 return Table
->NumberGenericTableElements
;
357 RtlNumberGenericTableElementsAvl(IN PRTL_AVL_TABLE Table
)
359 return Table
->NumberGenericTableElements
;