X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ShellPkg%2FInclude%2FLibrary%2FSortLib.h;h=276199457234f5e4473b2921496be1d23753076f;hb=36a9d6726135a07601999f5394185f6333127109;hp=ecc538e4b379099b0722872629ee116813482ded;hpb=4983ca934c85ed80b15264d3a7ee10a4d3c0d51f;p=mirror_edk2.git diff --git a/ShellPkg/Include/Library/SortLib.h b/ShellPkg/Include/Library/SortLib.h index ecc538e4b3..2761994572 100644 --- a/ShellPkg/Include/Library/SortLib.h +++ b/ShellPkg/Include/Library/SortLib.h @@ -1,7 +1,7 @@ /** @file - Library used for sorting routines. + Library used for sorting and comparison routines. -Copyright (c) 2009, Intel Corporation +Copyright (c) 2009, Intel Corporation
All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -18,12 +18,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. /** Prototype for comparison function for any 2 element types. - @param[in] Buffer1 pointer to first buffer - @param[in] Buffer2 pointer to second buffer + @param[in] Buffer1 Pointer to first buffer. + @param[in] Buffer2 Pointer to second buffer. - @retval 0 Buffer1 equal to Buffer2 - @return < 0 Buffer1 is less than Buffer2 - @return > 0 Buffer1 is greater than Buffer2 + @retval 0 Buffer1 equal to Buffer2. + @return < 0 Buffer1 is less than Buffer2. + @return > 0 Buffer1 is greater than Buffer2. **/ typedef INTN @@ -37,18 +37,18 @@ INTN Each element must be equally sized. - if BufferToSort is NULL, then ASSERT. - if CompareFunction is NULL, then ASSERT. + If BufferToSort is NULL, then ASSERT. + If CompareFunction is NULL, then ASSERT. - if Count is < 2 then perform no action. - if Size is < 1 then perform no action. + If Count is < 2 then perform no action. + If Size is < 1 then perform no action. - @param[in,out] BufferToSort on call a Buffer of (possibly sorted) elements - on return a buffer of sorted elements - @param[in] Count the number of elements in the buffer to sort - @param[in] ElementSize Size of an element in bytes + @param[in,out] BufferToSort On call a Buffer of (possibly sorted) elements + on return a buffer of sorted elements. + @param[in] Count The number of elements in the buffer to sort + @param[in] ElementSize Size of an element in bytes. @param[in] CompareFunction The function to call to perform the comparison - of any 2 elements + of any 2 elements. **/ VOID EFIAPI @@ -59,4 +59,20 @@ PerformQuickSort ( IN SORT_COMPARE CompareFunction ); + +/** + Function to compare 2 device paths for use as CompareFunction. + + @param[in] Buffer1 pointer to Device Path to compare + @param[in] Buffer2 pointer to second DevicePath to compare + + @retval 0 Buffer1 equal to Buffer2 + @return < 0 Buffer1 is less than Buffer2 + @return > 0 Buffer1 is greater than Buffer2 +**/ +INTN +DevicePathCompare ( + IN VOID *Buffer1, + IN VOID *Buffer2 + ); #endif //__SORT_LIB_H__