MdeModulePkg/Include/Library/SortLib.h File Reference


Typedefs

typedef INTN(EFIAPI * SORT_COMPARE )(IN CONST VOID *Buffer1, IN CONST VOID *Buffer2)

Functions

VOID EFIAPI PerformQuickSort (IN OUT VOID *BufferToSort, IN CONST UINTN Count, IN CONST UINTN ElementSize, IN SORT_COMPARE CompareFunction)
INTN EFIAPI DevicePathCompare (IN CONST VOID *Buffer1, IN CONST VOID *Buffer2)
INTN EFIAPI StringNoCaseCompare (IN CONST VOID *Buffer1, IN CONST VOID *Buffer2)
INTN EFIAPI StringCompare (IN CONST VOID *Buffer1, IN CONST VOID *Buffer2)

Detailed Description

Library used for sorting and comparison routines.

Copyright (c) 2009 - 2014, 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 http://opensource.org/licenses/bsd-license.php

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.


Typedef Documentation

typedef INTN(EFIAPI * SORT_COMPARE)(IN CONST VOID *Buffer1, IN CONST VOID *Buffer2)

Prototype for comparison function for any two element types.

Parameters:
[in] Buffer1 The pointer to first buffer.
[in] Buffer2 The pointer to second buffer.
Return values:
0 Buffer1 equal to Buffer2.
Returns:
<0 Buffer1 is less than Buffer2.

>0 Buffer1 is greater than Buffer2.


Function Documentation

INTN EFIAPI DevicePathCompare ( IN CONST VOID *  Buffer1,
IN CONST VOID *  Buffer2 
)

Function to compare 2 device paths for use as CompareFunction.

Parameters:
[in] Buffer1 The pointer to Device Path to compare.
[in] Buffer2 The pointer to second DevicePath to compare.
Return values:
0 Buffer1 equal to Buffer2.
Returns:
< 0 Buffer1 is less than Buffer2.

> 0 Buffer1 is greater than Buffer2.

VOID EFIAPI PerformQuickSort ( IN OUT VOID *  BufferToSort,
IN CONST UINTN  Count,
IN CONST UINTN  ElementSize,
IN SORT_COMPARE  CompareFunction 
)

Function to perform a Quick Sort on a buffer of comparable elements.

Each element must be equally sized.

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.

Parameters:
[in,out] BufferToSort On call, a Buffer of (possibly sorted) elements; on return, a buffer of sorted elements.
[in] Count The number of elements in the buffer to sort.
[in] ElementSize The size of an element in bytes.
[in] CompareFunction The function to call to perform the comparison of any two elements.

INTN EFIAPI StringCompare ( IN CONST VOID *  Buffer1,
IN CONST VOID *  Buffer2 
)

Function to compare 2 strings.

Parameters:
[in] Buffer1 The pointer to String to compare (CHAR16**).
[in] Buffer2 The pointer to second String to compare (CHAR16**).
Return values:
0 Buffer1 equal to Buffer2.
Returns:
< 0 Buffer1 is less than Buffer2.

> 0 Buffer1 is greater than Buffer2.

INTN EFIAPI StringNoCaseCompare ( IN CONST VOID *  Buffer1,
IN CONST VOID *  Buffer2 
)

Function to compare 2 strings without regard to case of the characters.

Parameters:
[in] Buffer1 The pointer to String to compare (CHAR16**).
[in] Buffer2 The pointer to second String to compare (CHAR16**).
Return values:
0 Buffer1 equal to Buffer2.
Returns:
< 0 Buffer1 is less than Buffer2.

> 0 Buffer1 is greater than Buffer2.


Generated on Thu Sep 24 23:30:15 2015 for MdeModulePkg[ALL] by  doxygen 1.5.7.1