2 Library used for sorting and comparison routines.
4 Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved. <BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
12 Prototype for comparison function for any two element types.
14 @param[in] Buffer1 The pointer to first buffer.
15 @param[in] Buffer2 The pointer to second buffer.
17 @retval 0 Buffer1 equal to Buffer2.
18 @return <0 Buffer1 is less than Buffer2.
19 @return >0 Buffer1 is greater than Buffer2.
23 (EFIAPI
*SORT_COMPARE
)(
24 IN CONST VOID
*Buffer1
,
25 IN CONST VOID
*Buffer2
29 Function to perform a Quick Sort on a buffer of comparable elements.
31 Each element must be equally sized.
33 If BufferToSort is NULL, then ASSERT.
34 If CompareFunction is NULL, then ASSERT.
36 If Count is < 2 , then perform no action.
37 If Size is < 1 , then perform no action.
39 @param[in, out] BufferToSort On call, a Buffer of (possibly sorted) elements;
40 on return, a buffer of sorted elements.
41 @param[in] Count The number of elements in the buffer to sort.
42 @param[in] ElementSize The size of an element in bytes.
43 @param[in] CompareFunction The function to call to perform the comparison
49 IN OUT VOID
*BufferToSort
,
51 IN CONST UINTN ElementSize
,
52 IN SORT_COMPARE CompareFunction
57 Function to compare 2 device paths for use as CompareFunction.
59 @param[in] Buffer1 The pointer to Device Path to compare.
60 @param[in] Buffer2 The pointer to second DevicePath to compare.
62 @retval 0 Buffer1 equal to Buffer2.
63 @return < 0 Buffer1 is less than Buffer2.
64 @return > 0 Buffer1 is greater than Buffer2.
69 IN CONST VOID
*Buffer1
,
70 IN CONST VOID
*Buffer2
74 Function to compare 2 strings without regard to case of the characters.
76 @param[in] Buffer1 The pointer to String to compare (CHAR16**).
77 @param[in] Buffer2 The pointer to second String to compare (CHAR16**).
79 @retval 0 Buffer1 equal to Buffer2.
80 @return < 0 Buffer1 is less than Buffer2.
81 @return > 0 Buffer1 is greater than Buffer2.
86 IN CONST VOID
*Buffer1
,
87 IN CONST VOID
*Buffer2
91 Function to compare 2 strings.
93 @param[in] Buffer1 The pointer to String to compare (CHAR16**).
94 @param[in] Buffer2 The pointer to second String to compare (CHAR16**).
96 @retval 0 Buffer1 equal to Buffer2.
97 @return < 0 Buffer1 is less than Buffer2.
98 @return > 0 Buffer1 is greater than Buffer2.
103 IN CONST VOID
*Buffer1
,
104 IN CONST VOID
*Buffer2
107 #endif //__SORT_LIB_H__