EDK2 doxygen online documents - Firmware Encoding Index 1
EDK2 doxygen online documents - Firmware Encoding Index
Functions

ShellPkg/Library/BaseSortLib/BaseSortLib.c File Reference

#include <Uefi.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/SortLib.h>

Go to the source code of this file.

Functions

VOID EFIAPI QuickSortWorker (IN OUT VOID *BufferToSort, IN CONST UINTN Count, IN CONST UINTN ElementSize, IN SORT_COMPARE CompareFunction, IN VOID *Buffer)
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 routines.

Copyright (c) 2009 - 2011, 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.

Definition in file BaseSortLib.c.


Function Documentation

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

Not supported in Base version.

Parameters:
[in]Buffer1Ignored.
[in]Buffer2Ignored.

ASSERT and return 0.

Definition at line 187 of file BaseSortLib.c.

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 alogrithm on a buffer of comparable elements.

Each element must be equal 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]BufferToSorton call a Buffer of (possibly sorted) elements on return a buffer of sorted elements
[in]Countthe number of elements in the buffer to sort
[in]ElementSizeSize of an element in bytes
[in]CompareFunctionThe function to call to perform the comparison of any 2 elements

Definition at line 151 of file BaseSortLib.c.

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

Worker function for QuickSorting. This function is identical to PerformQuickSort, except that is uses the pre-allocated buffer so the in place sorting does not need to allocate and free buffers constantly.

Each element must be equal sized.

if BufferToSort is NULL, then ASSERT. if CompareFunction is NULL, then ASSERT. if Buffer is NULL, then ASSERT.

if Count is < 2 then perform no action. if Size is < 1 then perform no action.

Parameters:
[in,out]BufferToSorton call a Buffer of (possibly sorted) elements on return a buffer of sorted elements
[in]Countthe number of elements in the buffer to sort
[in]ElementSizeSize of an element in bytes
[in]CompareFunctionThe function to call to perform the comparison of any 2 elements
[in]BufferBuffer of size ElementSize for use in swapping

Definition at line 47 of file BaseSortLib.c.

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

Function to compare 2 strings.

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

Definition at line 230 of file BaseSortLib.c.

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]Buffer1Pointer to String to compare.
[in]Buffer2Pointer to second String to compare.
Return values:
0Buffer1 equal to Buffer2.
Returns:
< 0 Buffer1 is less than Buffer2.
> 0 Buffer1 is greater than Buffer2.

Definition at line 208 of file BaseSortLib.c.

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Defines