mirror of https://github.com/acidanthera/audk.git
FileHandleLib - use standard unicode file tag.
ShellCEntryLib - add #define protection. ShellCommandLib - add optional sorting of command list. ShellLib - add string-to-number with EFI_STATUS return value for verification. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11429 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
7d271d7b01
commit
4bbdc0e1bd
|
@ -1,7 +1,7 @@
|
|||
/** @file
|
||||
Provides interface to EFI_FILE_HANDLE functionality.
|
||||
|
||||
Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
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
|
||||
|
@ -19,9 +19,7 @@
|
|||
|
||||
/// The tag for use in identifying UNICODE files.
|
||||
/// If the file is UNICODE, the first 16 bits of the file will equal this value.
|
||||
enum {
|
||||
UnicodeFileTag = 0xFEFF
|
||||
};
|
||||
extern CONST UINT16 gUnicodeFileTag;
|
||||
|
||||
/**
|
||||
This function retrieves information about the file for the handle
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/** @file
|
||||
Provides application point extension for "C" style main funciton.
|
||||
|
||||
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
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
|
||||
|
@ -12,6 +12,9 @@
|
|||
|
||||
**/
|
||||
|
||||
#if !defined (_SHELL_C_ENTRY_LIB_)
|
||||
#define _SHELL_C_ENTRY_LIB_
|
||||
|
||||
/**
|
||||
UEFI application entry point which has an interface similar to a
|
||||
standard C main function.
|
||||
|
@ -32,3 +35,6 @@ ShellAppMain (
|
|||
IN UINTN Argc,
|
||||
IN CHAR16 **Argv
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
This library is for use ONLY by shell commands linked into the shell application.
|
||||
This library will not funciton if it is used for UEFI Shell 2.0 Applications.
|
||||
|
||||
Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
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
|
||||
|
@ -211,12 +211,14 @@ typedef struct {
|
|||
via the LIST_ENTRY structure. Enumerate through it using the BaseLib linked
|
||||
list functions. Do not modify the values.
|
||||
|
||||
@param[in] Sort TRUE to alphabetically sort the values first. FALSE otherwise.
|
||||
|
||||
@return A linked list of all available shell commands.
|
||||
**/
|
||||
CONST COMMAND_LIST*
|
||||
EFIAPI
|
||||
ShellCommandGetCommandList (
|
||||
VOID
|
||||
IN CONST BOOLEAN Sort
|
||||
);
|
||||
|
||||
typedef struct {
|
||||
|
@ -501,7 +503,7 @@ ShellCommandConsistMappingUnInitialize (
|
|||
This must be called after ShellCommandConsistMappingInitialize() and
|
||||
before ShellCommandConsistMappingUnInitialize() is called.
|
||||
|
||||
@param[in] DeviecPath The pointer to the dev path for the device.
|
||||
@param[in] DevicePath The pointer to the dev path for the device.
|
||||
@param[in] Table The Table of mapping information.
|
||||
|
||||
@retval NULL A consistent mapped name could not be created.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/** @file
|
||||
Provides interface to shell functionality for shell commands and applications.
|
||||
|
||||
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
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
|
||||
|
@ -988,9 +988,13 @@ ShellIsFileInPath(
|
|||
Function to determine whether a string is decimal or hex representation of a number
|
||||
and return the number converted from the string.
|
||||
|
||||
@param[in] String String representation of a number
|
||||
Note: this function cannot be used when (UINTN)(-1), (0xFFFFFFFF) may be a valid
|
||||
result. Use ShellConvertStringToUint64 instead.
|
||||
|
||||
@param[in] String String representation of a number.
|
||||
|
||||
@return The unsigned integer result of the conversion.
|
||||
@retval (UINTN)(-1) An error occured.
|
||||
**/
|
||||
UINTN
|
||||
EFIAPI
|
||||
|
@ -1183,11 +1187,11 @@ ShellPromptForResponse (
|
|||
This function is the same as ShellPromptForResponse, except that the prompt is
|
||||
automatically pulled from HII.
|
||||
|
||||
@param Type What type of question is asked. This is used to filter the input
|
||||
@param[in] Type What type of question is asked. This is used to filter the input
|
||||
to prevent invalid answers to question.
|
||||
@param[in] HiiFormatStringId The format string Id for getting from Hii.
|
||||
@param[in] HiiFormatHandle The format string Handle for getting from Hii.
|
||||
@param Response The pointer to Response, which will be populated upon return.
|
||||
@param[out] Response The pointer to Response, which will be populated upon return.
|
||||
|
||||
@retval EFI_SUCCESS The operation was sucessful.
|
||||
@return other The operation failed.
|
||||
|
@ -1206,7 +1210,7 @@ ShellPromptForResponseHii (
|
|||
/**
|
||||
Function to determin if an entire string is a valid number.
|
||||
|
||||
If Hex it must be preceeded with a 0x or has ForceHex, set TRUE.
|
||||
If Hex it must be preceeded with a 0x, 0X, or has ForceHex set TRUE.
|
||||
|
||||
@param[in] String The string to evaluate.
|
||||
@param[in] ForceHex TRUE - always assume hex.
|
||||
|
@ -1223,6 +1227,30 @@ ShellIsHexOrDecimalNumber (
|
|||
IN CONST BOOLEAN StopAtSpace
|
||||
);
|
||||
|
||||
/**
|
||||
Function to verify and convert a string to its numerical 64 bit representation.
|
||||
|
||||
If Hex it must be preceeded with a 0x, 0X, or has ForceHex set TRUE.
|
||||
|
||||
@param[in] String The string to evaluate.
|
||||
@param[out] Value Upon a successful return the value of the conversion.
|
||||
@param[in] ForceHex TRUE - always assume hex.
|
||||
@param[in] StopAtSpace TRUE to halt upon finding a space, FALSE to
|
||||
process the entire String.
|
||||
|
||||
@retval EFI_SUCCESS The conversion was successful.
|
||||
@retval EFI_INVALID_PARAMETER String contained an invalid character.
|
||||
@retval EFI_NOT_FOUND String was a number, but Value was NULL.
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ShellConvertStringToUint64(
|
||||
IN CONST CHAR16 *String,
|
||||
OUT UINT64 *Value,
|
||||
IN CONST BOOLEAN ForceHex,
|
||||
IN CONST BOOLEAN StopAtSpace
|
||||
);
|
||||
|
||||
/**
|
||||
Function to determine if a given filename exists.
|
||||
|
||||
|
|
Loading…
Reference in New Issue