]>
git.proxmox.com Git - mirror_edk2.git/blob - ShellPkg/Application/ShellSortTestApp/ShellSortTestApp.c
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
32 if (*(INTN
*)b1
== *(INTN
*)b2
) {
36 if (*(INTN
*)b1
< *(INTN
*)b2
) {
44 UEFI application entry point which has an interface similar to a
45 standard C main function.
47 The ShellCEntryLib library instance wrappers the actual UEFI application
48 entry point and calls this ShellAppMain function.
50 @param Argc Argument count
51 @param Argv The parsed arguments
53 @retval 0 The application exited normally.
54 @retval Other An error occurred.
77 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]);
78 PerformQuickSort (Array
, 10, sizeof (INTN
), Test
);
79 Print (L
"POST-SORT\r\n");
80 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]);