]>
git.proxmox.com Git - mirror_edk2.git/blob - ShellPkg/Application/ShellSortTestApp/ShellSortTestApp.c
21eacac5e341885325f8dfc446ff8a73b663f650
2 This is a test application that demonstrates how to use the sorting functions.
4 Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #include <Library/UefiLib.h>
11 #include <Library/DebugLib.h>
12 #include <Library/ShellCEntryLib.h>
13 #include <Library/SortLib.h>
18 @param[in] b1 The first INTN
19 @param[in] b2 The other INTN
21 @retval 0 They are the same.
22 @retval -1 b1 is less than b2
23 @retval 1 b1 is greater then b2
27 Test(CONST VOID
*b1
, CONST VOID
*b2
)
29 if (*(INTN
*)b1
== *(INTN
*)b2
) {
32 if (*(INTN
*)b1
< *(INTN
*)b2
) {
39 UEFI application entry point which has an interface similar to a
40 standard C main function.
42 The ShellCEntryLib library instance wrappers the actual UEFI application
43 entry point and calls this ShellAppMain function.
45 @param Argc Argument count
46 @param Argv The parsed arguments
48 @retval 0 The application exited normally.
49 @retval Other An error occurred.
72 Print(L
"Array = %d, %d, %d, %d, %d, %d, %d, %d, %d, %d\r\n", Array
[0],Array
[1],Array
[2],Array
[3],Array
[4],Array
[5],Array
[6],Array
[7],Array
[8],Array
[9]);
73 PerformQuickSort(Array
, 10, sizeof(INTN
), Test
);
74 Print(L
"POST-SORT\r\n");
75 Print(L
"Array = %d, %d, %d, %d, %d, %d, %d, %d, %d, %d\r\n", Array
[0],Array
[1],Array
[2],Array
[3],Array
[4],Array
[5],Array
[6],Array
[7],Array
[8],Array
[9]);