TianoCore EDK2 master
|
#include <Uefi.h>
#include <Protocol/Shell.h>
#include <Protocol/ShellParameters.h>
#include <Protocol/UnicodeCollation.h>
#include <Protocol/SimpleFileSystem.h>
#include <Library/UefiBootServicesTableLib.h>
Go to the source code of this file.
Data Structures | |
struct | SHELL_MAP_LIST |
struct | COMMAND_LIST |
struct | ALIAS_LIST |
struct | SCRIPT_COMMAND_LIST |
struct | SCRIPT_FILE |
struct | BUFFER_LIST |
Typedefs | |
typedef CONST CHAR16 *(EFIAPI * | SHELL_GET_MAN_FILENAME) (VOID) |
typedef SHELL_STATUS(EFIAPI * | SHELL_RUN_COMMAND) (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable) |
Variables | |
EFI_UNICODE_COLLATION_PROTOCOL * | gUnicodeCollation |
CONST CHAR16 * | SupportLevel [] |
SHELL_MAP_LIST | gShellMapList |
List of Mappings - DeviceName and Drive Letter(ism). | |
SHELL_MAP_LIST * | gShellCurMapping |
Pointer to node of current directory in the mMapList. | |
Provides interface to shell internal functions for shell commands.
This library is for use ONLY by shell commands linked into the shell application. This library will not function if it is used for UEFI Shell 2.0 Applications.
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
(C) Copyright 2016 Hewlett Packard Enterprise Development LP
(C) Copyright 2013-2014 Hewlett-Packard Development Company, L.P.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file ShellCommandLib.h.
typedef CONST CHAR16 *(EFIAPI * SHELL_GET_MAN_FILENAME) (VOID) |
Returns the help MAN fileName for a given shell command.
!NULL | The unicode string of the MAN filename. |
NULL | An error ocurred. |
Definition at line 55 of file ShellCommandLib.h.
typedef SHELL_STATUS(EFIAPI * SHELL_RUN_COMMAND) (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable) |
Runs a shell command on a given command line.
The specific operation of a given shell command is specified in the UEFI Shell Specification 2.0, or in the source of the given command.
Upon completion of the command run the shell protocol and environment variables may have been updated due to the operation.
[in] | ImageHandle | The ImageHandle to the app, or NULL if the command built into shell. |
[in] | SystemTable | The pointer to the system table. |
RETURN_SUCCESS | The shell command was successful. |
RETURN_UNSUPPORTED | The command is not supported. |
Definition at line 77 of file ShellCommandLib.h.
enum SHELL_MAPPING_TYPE |
Definition at line 450 of file ShellCommandLib.h.
enum SHELL_SORT_FILE_LIST |
Definition at line 717 of file ShellCommandLib.h.
CHAR16 *EFIAPI CatSDumpHex | ( | IN CHAR16 * | Buffer, |
IN UINTN | Indent, | ||
IN UINTN | Offset, | ||
IN UINTN | DataSize, | ||
IN VOID * | UserData | ||
) |
Dump HEX data into buffer.
[in] | Buffer | HEX data to be dumped in Buffer. |
[in] | Indent | How many spaces to indent the output. |
[in] | Offset | The offset of the printing. |
[in] | DataSize | The size in bytes of UserData. |
[in] | UserData | The data to print out. |
Definition at line 1982 of file UefiShellCommandLib.c.
EFI_STATUS EFIAPI CommandInit | ( | VOID | ) |
Function to make sure that the above pointers are valid.
Function to make sure that the global protocol pointers are valid. must be called after constructor before accessing the pointers.
Definition at line 65 of file UefiShellCommandLib.c.
SHELL_FILE_HANDLE EFIAPI ConvertEfiFileProtocolToShellHandle | ( | IN CONST EFI_FILE_PROTOCOL * | Handle, |
IN CONST CHAR16 * | Path | ||
) |
Converts a EFI_FILE_PROTOCOL* to an SHELL_FILE_HANDLE.
[in] | Handle | The pointer to EFI_FILE_PROTOCOL to convert. |
[in] | Path | The path to the file for verification. |
Converts a EFI_FILE_PROTOCOL* to an SHELL_FILE_HANDLE.
[in] | Handle | The pointer to EFI_FILE_PROTOCOL to convert. |
[in] | Path | The path to the file for verification. |
NULL | There was not enough memory. |
Definition at line 1742 of file UefiShellCommandLib.c.
EFI_FILE_PROTOCOL *EFIAPI ConvertShellHandleToEfiFileProtocol | ( | IN CONST SHELL_FILE_HANDLE | Handle | ) |
Converts a SHELL_FILE_HANDLE to an EFI_FILE_PROTOCOL*.
[in] | Handle | The SHELL_FILE_HANDLE to convert. |
Definition at line 1724 of file UefiShellCommandLib.c.
VOID EFIAPI DeleteScriptFileStruct | ( | IN SCRIPT_FILE * | Script | ) |
Function to cleanup all memory from a SCRIPT_FILE structure.
[in] | Script | The pointer to the structure to cleanup. |
Definition at line 1141 of file UefiShellCommandLib.c.
Function printing hex output to the console.
[in] | Indent | Number of spaces to indent. |
[in] | Offset | Offset to start with. |
[in] | DataSize | Length of data. |
[in] | UserData | Pointer to some data. |
Dump some hexadecimal data to the screen.
[in] | Indent | How many spaces to indent the output. |
[in] | Offset | The offset of the printing. |
[in] | DataSize | The size in bytes of UserData. |
[in] | UserData | The data to print out. |
Definition at line 1929 of file UefiShellCommandLib.c.
VOID EFIAPI FreeBufferList | ( | IN BUFFER_LIST * | List | ) |
Frees any BUFFER_LIST defined type.
[in] | List | The pointer to the list head. |
Frees any BUFFER_LIST defined type.
[in] | List | The BUFFER_LIST object to free. |
Definition at line 1892 of file UefiShellCommandLib.c.
EFI_STATUS EFIAPI ShellCommandAddMapItemAndUpdatePath | ( | IN CONST CHAR16 * | Name, |
IN CONST EFI_DEVICE_PATH_PROTOCOL * | DevicePath, | ||
IN CONST UINT64 | Flags, | ||
IN CONST BOOLEAN | Path | ||
) |
Function to add a map node to the list of map items and update the "path" environment variable (optionally).
If Path is TRUE (during initialization only), the path environment variable will also be updated to include default paths on the new map name...
Path should be FALSE when this function is called from the protocol SetMap function.
[in] | Name | The human readable mapped name. |
[in] | DevicePath | The Device Path for this map. |
[in] | Flags | The Flags attribute for this map item. |
[in] | Path | TRUE to update path, FALSE to skip this step (should only be TRUE during initialization). |
EFI_SUCCESS | The addition was successful. |
EFI_OUT_OF_RESOURCES | A memory allocation failed. |
EFI_INVALID_PARAMETER | A parameter was invalid. |
Definition at line 1299 of file UefiShellCommandLib.c.
CHAR16 *EFIAPI ShellCommandConsistMappingGenMappingName | ( | IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath, |
IN EFI_DEVICE_PATH_PROTOCOL ** | Table | ||
) |
Create a consistent mapped name for the device specified by DevicePath based on the Table.
This must be called after ShellCommandConsistMappingInitialize() and before ShellCommandConsistMappingUnInitialize() is called.
[in] | DevicePath | The pointer to the dev path for the device. |
[in] | Table | The Table of mapping information. |
NULL | A consistent mapped name could not be created. |
Definition at line 1632 of file ConsistMapping.c.
EFI_STATUS EFIAPI ShellCommandConsistMappingInitialize | ( | EFI_DEVICE_PATH_PROTOCOL *** | Table | ) |
Function to initialize the table for creating consistent map names.
[out] | Table | The pointer to pointer to pointer to DevicePathProtocol object. |
EFI_SUCCESS | The table was created successfully. |
EFI_STATUS EFIAPI ShellCommandConsistMappingUnInitialize | ( | EFI_DEVICE_PATH_PROTOCOL ** | Table | ) |
Function to uninitialize the table for creating consistent map names.
The parameter must have been received from ShellCommandConsistMappingInitialize.
[out] | Table | The pointer to pointer to DevicePathProtocol object. |
EFI_SUCCESS | The table was deleted successfully. |
Definition at line 1601 of file ConsistMapping.c.
EFI_STATUS EFIAPI ShellCommandCreateInitialMappingsAndPaths | ( | VOID | ) |
Creates the default map names for each device path in the system with a protocol depending on the Type.
Also sets up the default path environment variable if Type is FileSystem.
EFI_SUCCESS | All map names were created successfully. |
EFI_NOT_FOUND | No protocols were found in the system. |
Creates the default map names for each device path in the system with a protocol depending on the Type.
Creates the consistent map names for each device path in the system with a protocol depending on the Type.
Note: This will reset all mappings in the system("map -r").
Also sets up the default path environment variable if Type is FileSystem.
EFI_SUCCESS | All map names were created successfully. |
EFI_NOT_FOUND | No protocols were found in the system. |
Definition at line 1389 of file UefiShellCommandLib.c.
Function to generate the next default mapping name.
If the return value is not NULL then it must be callee freed.
Type | What kind of mapping name to make. |
NULL | a memory allocation failed. |
Definition at line 1255 of file UefiShellCommandLib.c.
SHELL_MAP_LIST *EFIAPI ShellCommandFindMapItem | ( | IN CONST CHAR16 * | MapKey | ) |
Function to search the list of mappings for the first matching node on the list based on the MapKey.
[in] | MapKey | The pointer to the string key to search for in the map. |
Function to search the list of mappings for the node on the list based on the key.
[in] | MapKey | String Key to search for on the map |
Definition at line 1712 of file ConsistMapping.c.
Get the help text for a command.
[in] | CommandString | The command name. |
NULL | No help text was found. |
Get the help text for a command.
[in] | CommandString | The command name. |
NULL | No help text was found. |
Definition at line 513 of file UefiShellCommandLib.c.
CONST COMMAND_LIST *EFIAPI ShellCommandGetCommandList | ( | IN CONST BOOLEAN | Sort | ) |
Get the list of all available shell internal commands. This is a linked list, via the LIST_ENTRY structure. Enumerate through it using the BaseLib linked list functions. Do not modify the values.
[in] | Sort | TRUE to alphabetically sort the values first. FALSE otherwise. |
Get the list of all available shell internal commands. This is a linked list (via LIST_ENTRY structure). enumerate through it using the BaseLib linked list functions. do not modify the values.
[in] | Sort | TRUE to alphabetically sort the values first. FALSE otherwise. |
Definition at line 860 of file UefiShellCommandLib.c.
SCRIPT_FILE *EFIAPI ShellCommandGetCurrentScriptFile | ( | VOID | ) |
Function to return a pointer to the currently running script file object.
NULL | A script file is not currently running. |
Definition at line 1188 of file UefiShellCommandLib.c.
BOOLEAN EFIAPI ShellCommandGetEchoState | ( | VOID | ) |
Function to determine current state of ECHO. Echo determines if lines from scripts and ECHO commands are enabled.
TRUE | Echo is currently enabled. |
FALSE | Echo is currently disabled. |
Function to determine current state of ECHO. Echo determines if lines from scripts and ECHO commands are enabled.
TRUE | Echo is currently enabled |
FALSE | Echo is currently disabled |
Definition at line 1038 of file UefiShellCommandLib.c.
BOOLEAN EFIAPI ShellCommandGetExit | ( | VOID | ) |
Retrieve the Exit indicator.
TRUE | Exit was indicated. |
FALSE | Exit was not indicated. |
Retrieve the Exit indicator.
TRUE | Exit was indicated. |
FALSE | Exis was not indicated. |
Definition at line 1094 of file UefiShellCommandLib.c.
UINT64 EFIAPI ShellCommandGetExitCode | ( | VOID | ) |
Retrieve the Exit code.
Retrieve the Exit code.
If ShellCommandGetExit returns FALSE than the return from this is undefined.
Definition at line 1110 of file UefiShellCommandLib.c.
CONST ALIAS_LIST *EFIAPI ShellCommandGetInitAliasList | ( | VOID | ) |
Get the list of all shell alias commands. This is a linked list, via LIST_ENTRY structure. Enumerate through it using the BaseLib linked list functions. Do not modify the values.
Get the list of all shell alias commands. This is a linked list (via LIST_ENTRY structure). enumerate through it using the BaseLib linked list functions. do not modify the values.
Definition at line 967 of file UefiShellCommandLib.c.
Checks if a command string has been registered for CommandString, and if so, it returns the MAN filename specified for that command.
If CommandString is NULL, then ASSERT().
[in] | CommandString | The pointer to the command name. This is the name found on the command line in the shell. |
NULL | The CommandString was not a registered command. |
other | The name of the MAN file. |
Checks if a command string has been registered for CommandString and if so it returns the MAN filename specified for that command.
If CommandString is NULL, then ASSERT().
[in] | CommandString | Pointer to the command name. This is the name found on the command line in the shell.\ |
NULL | the commandString was not a registered command. |
Definition at line 815 of file UefiShellCommandLib.c.
CONST CHAR16 *EFIAPI ShellCommandGetProfileList | ( | VOID | ) |
Function to get the current Profile string.
This is used to retrieve what profiles were installed.
NULL | There are no installed profiles. |
Function to get the current Profile string.
NULL | There are no installed profiles. |
Definition at line 706 of file UefiShellCommandLib.c.
BOOLEAN EFIAPI ShellCommandGetScriptExit | ( | VOID | ) |
Retrieve the Exit script indicator.
If ShellCommandGetExit returns FALSE, then the return from this is undefined.
TRUE | ScriptOnly was indicated. |
FALSE | ScriptOnly was not indicated. |
Retrieve the Exit script indicator.
If ShellCommandGetExit returns FALSE than the return from this is undefined.
TRUE | ScriptOnly was indicated. |
FALSE | ScriptOnly was not indicated. |
Definition at line 1127 of file UefiShellCommandLib.c.
Checks if a command is already on the list.
[in] | CommandString | The command string to check for on the list. |
TRUE | CommandString represents a registered command. |
FALSE | CommandString does not represent a registered command. |
Checks if a command exists, either internally or through the dynamic command protocol.
[in] | CommandString | The command string to check for on the list. |
Definition at line 423 of file UefiShellCommandLib.c.
Determine if a given alias is on the list of built in aliases.
[in] | Alias | The alias to test for. |
TRUE | The alias is a built in alias. |
FALSE | The alias is not a built in alias. |
Determine if a given alias is on the list of built in alias'.
[in] | Alias | The alias to test for |
TRUE | The alias is a built in alias |
FALSE | The alias is not a built in alias |
Definition at line 984 of file UefiShellCommandLib.c.
RETURN_STATUS EFIAPI ShellCommandRegisterAlias | ( | IN CONST CHAR16 * | Command, |
IN CONST CHAR16 * | Alias | ||
) |
Registers aliases to be set as part of the initialization of the shell application.
If Command is NULL, then ASSERT(). If Alias is NULL, then ASSERT().
[in] | Command | The pointer to the Command. |
[in] | Alias | The pointer to Alias. |
RETURN_SUCCESS | The handlers were registered. |
RETURN_OUT_OF_RESOURCES | There are not enough resources available to register the shell command. |
Registers aliases to be set as part of the initialization of the shell application.
If Command is NULL, then ASSERT(). If Alias is NULL, then ASSERT().
[in] | Command | Pointer to the Command |
[in] | Alias | Pointer to Alias |
RETURN_SUCCESS | The handlers were registered. |
RETURN_OUT_OF_RESOURCES | There are not enough resources available to register the shell command. |
Definition at line 885 of file UefiShellCommandLib.c.
RETURN_STATUS EFIAPI ShellCommandRegisterCommandName | ( | IN CONST CHAR16 * | CommandString, |
IN SHELL_RUN_COMMAND | CommandHandler, | ||
IN SHELL_GET_MAN_FILENAME | GetManFileName, | ||
IN UINT32 | ShellMinSupportLevel, | ||
IN CONST CHAR16 * | ProfileName, | ||
IN CONST BOOLEAN | CanAffectLE, | ||
IN CONST EFI_HII_HANDLE | HiiHandle, | ||
IN CONST EFI_STRING_ID | ManFormatHelp | ||
) |
Registers the handlers of type SHELL_RUN_COMMAND and SHELL_GET_MAN_FILENAME for each shell command.
If the ShellSupportLevel is greater than the value of PcdShellSupportLevel, then return RETURN_UNSUPPORTED.
Registers the the handlers specified by GetHelpInfoHandler and CommandHandler with the command specified by CommandString. If the command named by CommandString has already been registered, then return RETURN_ALREADY_STARTED.
If there are not enough resources available to register the handlers, then RETURN_OUT_OF_RESOURCES is returned.
If CommandString is NULL, then ASSERT(). If GetHelpInfoHandler is NULL, then ASSERT(). If CommandHandler is NULL, then ASSERT(). If ProfileName is NULL, then ASSERT().
[in] | CommandString | The pointer to the command name. This is the name to look for on the command line in the shell. |
[in] | CommandHandler | The pointer to a function that runs the specified command. |
[in] | GetManFileName | The pointer to a function that provides man filename. |
[in] | ShellMinSupportLevel | The minimum Shell Support Level which has this function. |
[in] | ProfileName | The profile name to require for support of this function. |
[in] | CanAffectLE | Indicates whether this command's return value can change the LASTERROR environment variable. |
[in] | HiiHandle | The handle of this command's HII entry. |
[in] | ManFormatHelp | The HII locator for the help text. |
RETURN_SUCCESS | The handlers were registered. |
RETURN_OUT_OF_RESOURCES | There are not enough resources available to register the shell command. |
RETURN_UNSUPPORTED | The ShellMinSupportLevel was higher than the currently allowed support level. |
RETURN_ALREADY_STARTED | The CommandString represents a command that is already registered. Only one handler set for a given command is allowed. |
Registers handlers of type SHELL_RUN_COMMAND and SHELL_GET_MAN_FILENAME for each shell command.
If the ShellSupportLevel is greater than the value of the PcdShellSupportLevel then return RETURN_UNSUPPORTED.
Registers the handlers specified by GetHelpInfoHandler and CommandHandler with the command specified by CommandString. If the command named by CommandString has already been registered, then return RETURN_ALREADY_STARTED.
If there are not enough resources available to register the handlers then RETURN_OUT_OF_RESOURCES is returned.
If CommandString is NULL, then ASSERT(). If GetHelpInfoHandler is NULL, then ASSERT(). If CommandHandler is NULL, then ASSERT(). If ProfileName is NULL, then ASSERT().
[in] | CommandString | Pointer to the command name. This is the name to look for on the command line in the shell. |
[in] | CommandHandler | Pointer to a function that runs the specified command. |
[in] | GetManFileName | Pointer to a function that provides man filename. |
[in] | ShellMinSupportLevel | minimum Shell Support Level which has this function. |
[in] | ProfileName | profile name to require for support of this function. |
[in] | CanAffectLE | indicates whether this command's return value can change the LASTERROR environment variable. |
[in] | HiiHandle | Handle of this command's HII entry. |
[in] | ManFormatHelp | HII locator for the help text. |
RETURN_SUCCESS | The handlers were registered. |
RETURN_OUT_OF_RESOURCES | There are not enough resources available to register the shell command. |
RETURN_UNSUPPORTED | the ShellMinSupportLevel was higher than the currently allowed support level. |
RETURN_ALREADY_STARTED | The CommandString represents a command that is already registered. Only 1 handler set for a given command is allowed. |
Definition at line 577 of file UefiShellCommandLib.c.
Indicate that the current shell or script should exit.
[in] | ScriptOnly | TRUE if exiting a script; FALSE otherwise. |
[in] | ErrorCode | The 64 bit error code to return. |
Definition at line 1071 of file UefiShellCommandLib.c.
RETURN_STATUS EFIAPI ShellCommandRunCommandHandler | ( | IN CONST CHAR16 * | CommandString, |
IN OUT SHELL_STATUS * | RetVal, | ||
IN OUT BOOLEAN *CanAffectLE | OPTIONAL | ||
) |
Checks if a command string has been registered for CommandString, and if so, it runs the previously registered handler for that command with the command line.
If CommandString is NULL, then ASSERT().
If Sections is specified, then each section name listed will be compared in a case sensitive manner to the section names described in Appendix B UEFI Shell 2.0 Specification. If the section exists, it is appended to the returned help text. If the section does not exist, no information is returned. If Sections is NULL, then all help text information available is returned.
[in] | CommandString | The pointer to the command name. This is the name found on the command line in the shell. |
[in,out] | RetVal | The pointer to the return value from the command handler. |
[in,out] | CanAffectLE | Indicates whether this command's return value needs to be placed into LASTERROR environment variable. |
RETURN_SUCCESS | The handler was run. |
RETURN_NOT_FOUND | The CommandString did not match a registered command name. |
Checks if a command string has been registered for CommandString and if so it runs the previously registered handler for that command with the command line.
If CommandString is NULL, then ASSERT().
If Sections is specified, then each section name listed will be compared in a casesensitive manner, to the section names described in Appendix B UEFI Shell 2.0 spec. If the section exists, it will be appended to the returned help text. If the section does not exist, no information will be returned. If Sections is NULL, then all help text information available will be returned.
[in] | CommandString | Pointer to the command name. This is the name found on the command line in the shell. |
[in,out] | RetVal | Pointer to the return vaule from the command handler. |
[in,out] | CanAffectLE | indicates whether this command's return value needs to be placed into LASTERROR environment variable. |
RETURN_SUCCESS | The handler was run. |
RETURN_NOT_FOUND | The CommandString did not match a registered command name. |
Definition at line 739 of file UefiShellCommandLib.c.
VOID EFIAPI ShellCommandSetEchoState | ( | IN BOOLEAN | State | ) |
Function to set current state of ECHO. Echo determines if lines from scripts and ECHO commands are enabled.
[in] | State | TRUE to enable Echo, FALSE otherwise. |
Function to set current state of ECHO. Echo determines if lines from scripts and ECHO commands are enabled.
If State is TRUE, Echo will be enabled. If State is FALSE, Echo will be disabled.
[in] | State | How to set echo. |
Definition at line 1056 of file UefiShellCommandLib.c.
SCRIPT_FILE *EFIAPI ShellCommandSetNewScript | ( | IN SCRIPT_FILE *Script | OPTIONAL | ) |
Function to set a new script as the currently running one.
This function will correctly stack and unstack nested scripts.
[in] | Script | The pointer to new script information structure. If NULL, it removes and de-allocates the topmost Script structure. |
Function to set a new script as the currently running one.
This function will correctly stack and unstack nested scripts.
[in] | Script | Pointer to new script information structure. if NULL will remove and de-allocate the top-most Script structure. |
Definition at line 1215 of file UefiShellCommandLib.c.
EFI_STATUS EFIAPI ShellCommandUpdateMapping | ( | VOID | ) |
Add mappings for any devices without one. Do not change any existing maps.
EFI_SUCCESS | The operation was successful. |
Definition at line 1606 of file UefiShellCommandLib.c.
BOOLEAN EFIAPI ShellFileHandleEof | ( | IN SHELL_FILE_HANDLE | Handle | ) |
Function to determine if a SHELL_FILE_HANDLE is at the end of the file.
This will NOT work on directories.
If Handle is NULL, then ASSERT.
[in] | Handle | the file handle |
TRUE | the position is at the end of the file |
FALSE | the position is not at the end of the file |
Definition at line 1853 of file UefiShellCommandLib.c.
Find the path that was logged with the specified SHELL_FILE_HANDLE.
[in] | Handle | The SHELL_FILE_HANDLE to query on. |
Definition at line 1787 of file UefiShellCommandLib.c.
Remove a SHELL_FILE_HANDLE frmo the list of SHELL_FILE_HANDLES.
[in] | Handle | The SHELL_FILE_HANDLE to remove. |
TRUE | The item was removed. |
FALSE | The item was not found. |
Remove a SHELL_FILE_HANDLE from the list of SHELL_FILE_HANDLES.
[in] | Handle | The SHELL_FILE_HANDLE to remove. |
TRUE | The item was removed. |
FALSE | The item was not found. |
Definition at line 1816 of file UefiShellCommandLib.c.
EFI_STATUS EFIAPI ShellSortFileList | ( | IN OUT EFI_SHELL_FILE_INFO ** | FileList, |
OUT EFI_SHELL_FILE_INFO **Duplicates | OPTIONAL, | ||
IN SHELL_SORT_FILE_LIST | Order | ||
) |
Sort an EFI_SHELL_FILE_INFO list, optionally moving duplicates to a separate list.
[in,out] | FileList | The list of EFI_SHELL_FILE_INFO objects to sort. If FileList is NULL on input, then FileList is considered an empty, hence already sorted, list. Otherwise, if (*FileList) is NULL on input, then EFI_INVALID_PARAMETER is returned. Otherwise, the caller is responsible for having initialized (*FileList)->Link with InitializeListHead(). No other fields in the (**FileList) head element are accessed by this function. On output, (*FileList) is sorted according to Order. If Duplicates is NULL on input, then duplicate elements are preserved, sorted stably, on (*FileList). If Duplicates is not NULL on input, then duplicates are moved (stably sorted) to the new, dynamically allocated (*Duplicates) list. |
[out] | Duplicates | If Duplicates is NULL on input, (*FileList) will be a monotonically ordered list on output, with duplicates stably sorted. |
If Duplicates is not NULL on input, (*FileList) will be a strictly monotonically oredered list on output, with duplicates separated (stably sorted) to (*Duplicates). All fields except Link will be zero-initialized in the (**Duplicates) head element. If no duplicates exist, then (*Duplicates) is set to NULL on output.
[in] | Order | Determines the comparison operation between EFI_SHELL_FILE_INFO objects. |
EFI_INVALID_PARAMETER | (UINTN)Order is greater than or equal to (UINTN)ShellSortFileListMax. Neither the (*FileList) nor the (*Duplicates) list has been modified. |
EFI_INVALID_PARAMETER | (*FileList) was NULL on input. Neither the (*FileList) nor the (*Duplicates) list has been modified. |
EFI_OUT_OF_RESOURCES | Memory allocation failed. Neither the (*FileList) nor the (*Duplicates) list has been modified. |
EFI_SUCCESS | Sorting successful, including the case when FileList is NULL on input. |
Definition at line 2165 of file UefiShellCommandLib.c.
|
extern |
Pointer to node of current directory in the mMapList.
Definition at line 50 of file UefiShellCommandLib.c.
|
extern |
List of Mappings - DeviceName and Drive Letter(ism).
Definition at line 49 of file UefiShellCommandLib.c.
|
extern |
Definition at line 48 of file UefiShellCommandLib.c.
|
extern |
Definition at line 52 of file UefiShellCommandLib.c.