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