2 Library used for sorting routines.
4 Copyright (c) 2009, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #if !defined(__SORT_LIB_H__)
16 #define __SORT_LIB_H__
19 Prototype for comparison function for any 2 element types.
21 @param[in] Buffer1 pointer to first buffer
22 @param[in] Buffer2 pointer to second buffer
24 @retval 0 Buffer1 equal to Buffer2
25 @return < 0 Buffer1 is less than Buffer2
26 @return > 0 Buffer1 is greater than Buffer2
30 (EFIAPI
*SORT_COMPARE
)(
36 Function to perform a Quick Sort on a buffer of comparable elements.
38 Each element must be equally sized.
40 if BufferToSort is NULL, then ASSERT.
41 if CompareFunction is NULL, then ASSERT.
43 if Count is < 2 then perform no action.
44 if Size is < 1 then perform no action.
46 @param[in,out] BufferToSort on call a Buffer of (possibly sorted) elements
47 on return a buffer of sorted elements
48 @param[in] Count the number of elements in the buffer to sort
49 @param[in] ElementSize Size of an element in bytes
50 @param[in] CompareFunction The function to call to perform the comparison
56 IN OUT VOID
*BufferToSort
,
58 IN CONST UINTN ElementSize
,
59 IN SORT_COMPARE CompareFunction
62 #endif //__SORT_LIB_H__