]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Include/Library/ShellLib.h
ShellPkg/UefiShellLib: drop DeviceHandle param of ShellOpenFileByDevicePath()
[mirror_edk2.git] / ShellPkg / Include / Library / ShellLib.h
index 2ee8ae5428d5634b68d51df8e38a6ec596151848..92fddc50f5dd525f07deeb4568d64e8748328825 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Provides interface to shell functionality for shell commands and applications.\r
 \r
-  Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
 #include <Protocol/LoadedImage.h>\r
 #include <Protocol/EfiShellInterface.h>\r
 #include <Protocol/EfiShellEnvironment2.h>\r
-#include <Protocol/EfiShell.h>\r
-#include <Protocol/EfiShellParameters.h>\r
+#include <Protocol/Shell.h>\r
+#include <Protocol/ShellParameters.h>\r
 \r
-// (20 * (6+5+2))+1) unicode characters from EFI FAT spec (doubled for bytes)\r
-#define MAX_FILE_NAME_LEN 512\r
+#define SHELL_FREE_NON_NULL(Pointer)  \\r
+  do {                                \\r
+    if ((Pointer) != NULL) {          \\r
+      FreePool((Pointer));            \\r
+      (Pointer) = NULL;               \\r
+    }                                 \\r
+  } while(FALSE)\r
 \r
 extern EFI_SHELL_PARAMETERS_PROTOCOL *gEfiShellParametersProtocol;\r
 extern EFI_SHELL_PROTOCOL            *gEfiShellProtocol;\r
@@ -59,20 +64,20 @@ ShellGetFileInfo (
 \r
   @param[in]  FileInfo          The information to set.\r
 \r
-  @retval EFI_SUCCESS                  The information was set.\r
+  @retval EFI_SUCCESS           The information was set.\r
   @retval EFI_INVALID_PARAMETER A parameter was out of range or invalid.\r
   @retval EFI_UNSUPPORTED       The FileHandle does not support FileInfo.\r
-  @retval EFI_NO_MEDIA               The device has no medium.\r
-  @retval EFI_DEVICE_ERROR         The device reported an error.\r
-  @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.\r
-  @retval EFI_WRITE_PROTECTED    The file or medium is write protected.\r
+  @retval EFI_NO_MEDIA          The device has no medium.\r
+  @retval EFI_DEVICE_ERROR      The device reported an error.\r
+  @retval EFI_VOLUME_CORRUPTED  The file system structures are corrupted.\r
+  @retval EFI_WRITE_PROTECTED   The file or medium is write protected.\r
   @retval EFI_ACCESS_DENIED     The file was opened read only.\r
   @retval EFI_VOLUME_FULL       The volume is full.\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 ShellSetFileInfo (\r
-  IN SHELL_FILE_HANDLE         FileHandle,\r
+  IN SHELL_FILE_HANDLE          FileHandle,\r
   IN EFI_FILE_INFO              *FileInfo\r
   );\r
 \r
@@ -82,38 +87,36 @@ ShellSetFileInfo (
   This function opens a file with the open mode according to the file path. The\r
   Attributes is valid only for EFI_FILE_MODE_CREATE.\r
 \r
-  @param[in,out]  FilePath      On input, the device path to the file.  On output,\r
-                                the remaining device path.\r
-  @param[out]  DeviceHandle     Pointer to the system device handle.\r
-  @param[out]  FileHandle       Pointer to the file handle.\r
-  @param[in]  OpenMode          The mode to open the file with.\r
-  @param[in]  Attributes        The file's file attributes.\r
+  @param[in, out]  FilePath      On input, the device path to the file.  On output,\r
+                                 the remaining device path.\r
+  @param[out]   FileHandle       Pointer to the file handle.\r
+  @param[in]    OpenMode         The mode to open the file with.\r
+  @param[in]    Attributes       The file's file attributes.\r
 \r
-  @retval EFI_SUCCESS          The information was set.\r
-  @retval EFI_INVALID_PARAMETER        One of the parameters has an invalid value.\r
+  @retval EFI_SUCCESS         The information was set.\r
+  @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r
   @retval EFI_UNSUPPORTED       Could not open the file path.\r
-  @retval EFI_NOT_FOUND                The specified file could not be found on the\r
+  @retval EFI_NOT_FOUND         The specified file could not be found on the\r
                                 device or the file system could not be found on\r
                                 the device.\r
   @retval EFI_NO_MEDIA          The device has no medium.\r
   @retval EFI_MEDIA_CHANGED     The device has a different medium in it or the\r
                                 medium is no longer supported.\r
   @retval EFI_DEVICE_ERROR      The device reported an error.\r
-  @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.\r
+  @retval EFI_VOLUME_CORRUPTED  The file system structures are corrupted.\r
   @retval EFI_WRITE_PROTECTED   The file or medium is write protected.\r
   @retval EFI_ACCESS_DENIED     The file was opened read only.\r
-  @retval EFI_OUT_OF_RESOURCES Not enough resources were available to open the\r
+  @retval EFI_OUT_OF_RESOURCES  Not enough resources were available to open the\r
                                 file.\r
   @retval EFI_VOLUME_FULL       The volume is full.\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 ShellOpenFileByDevicePath(\r
-  IN OUT EFI_DEVICE_PATH_PROTOCOL        **FilePath,\r
-  OUT EFI_HANDLE                       *DeviceHandle,\r
-  OUT SHELL_FILE_HANDLE                *FileHandle,\r
-  IN UINT64                            OpenMode,\r
-  IN UINT64                            Attributes\r
+  IN OUT EFI_DEVICE_PATH_PROTOCOL     **FilePath,\r
+  OUT SHELL_FILE_HANDLE               *FileHandle,\r
+  IN UINT64                           OpenMode,\r
+  IN UINT64                           Attributes\r
   );\r
 \r
 /**\r
@@ -128,30 +131,30 @@ ShellOpenFileByDevicePath(
   @param[in] OpenMode           The mode to open the file with.\r
   @param[in] Attributes         The file's file attributes.\r
 \r
-  @retval EFI_SUCCESS          The information was set.\r
-  @retval EFI_INVALID_PARAMETER        One of the parameters has an invalid value.\r
+  @retval EFI_SUCCESS         The information was set.\r
+  @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r
   @retval EFI_UNSUPPORTED       Could not open the file path.\r
-  @retval EFI_NOT_FOUND                The specified file could not be found on the\r
+  @retval EFI_NOT_FOUND         The specified file could not be found on the\r
                                 device or the file system could not be found\r
                                 on the device.\r
   @retval EFI_NO_MEDIA          The device has no medium.\r
   @retval EFI_MEDIA_CHANGED     The device has a different medium in it or the\r
                                 medium is no longer supported.\r
   @retval EFI_DEVICE_ERROR      The device reported an error.\r
-  @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.\r
+  @retval EFI_VOLUME_CORRUPTED  The file system structures are corrupted.\r
   @retval EFI_WRITE_PROTECTED   The file or medium is write protected.\r
   @retval EFI_ACCESS_DENIED     The file was opened read only.\r
-  @retval EFI_OUT_OF_RESOURCES Not enough resources were available to open the\r
+  @retval EFI_OUT_OF_RESOURCES  Not enough resources were available to open the\r
                                 file.\r
   @retval EFI_VOLUME_FULL       The volume is full.\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 ShellOpenFileByName(\r
-  IN CONST CHAR16                          *FilePath,\r
+  IN CONST CHAR16               *FilePath,\r
   OUT SHELL_FILE_HANDLE         *FileHandle,\r
   IN UINT64                     OpenMode,\r
-  IN UINT64                            Attributes\r
+  IN UINT64                     Attributes\r
   );\r
 \r
 /**\r
@@ -164,20 +167,20 @@ ShellOpenFileByName(
   @param[in]  DirectoryName     The pointer to Directory name.\r
   @param[out] FileHandle        The pointer to the file handle.\r
 \r
-  @retval EFI_SUCCESS          The information was set.\r
-  @retval EFI_INVALID_PARAMETER        One of the parameters has an invalid value.\r
+  @retval EFI_SUCCESS         The information was set.\r
+  @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r
   @retval EFI_UNSUPPORTED       Could not open the file path.\r
-  @retval EFI_NOT_FOUND                The specified file could not be found on the\r
+  @retval EFI_NOT_FOUND         The specified file could not be found on the\r
                                 device, or the file system could not be found\r
                                 on the device.\r
   @retval EFI_NO_MEDIA          The device has no medium.\r
   @retval EFI_MEDIA_CHANGED     The device has a different medium in it or the\r
                                 medium is no longer supported.\r
   @retval EFI_DEVICE_ERROR      The device reported an error.\r
-  @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.\r
+  @retval EFI_VOLUME_CORRUPTED  The file system structures are corrupted.\r
   @retval EFI_WRITE_PROTECTED   The file or medium is write protected.\r
   @retval EFI_ACCESS_DENIED     The file was opened read only.\r
-  @retval EFI_OUT_OF_RESOURCES Not enough resources were available to open the\r
+  @retval EFI_OUT_OF_RESOURCES  Not enough resources were available to open the\r
                                 file.\r
   @retval EFI_VOLUME_FULL       The volume is full.\r
 **/\r
@@ -204,15 +207,15 @@ ShellCreateDirectory(
   are no more directory entries, the read returns a zero-length buffer.\r
   EFI_FILE_INFO is the structure returned as the directory entry.\r
 \r
-  @param[in] FileHandle         The opened file handle.\r
-  @param[in,out] ReadSize       On input the size of buffer in bytes.  On return\r
-                                the number of bytes written.\r
-  @param[out] Buffer            The buffer to put read data into.\r
+  @param[in] FileHandle          The opened file handle.\r
+  @param[in, out] ReadSize       On input the size of buffer in bytes.  On return\r
+                                 the number of bytes written.\r
+  @param[out] Buffer             The buffer to put read data into.\r
 \r
   @retval EFI_SUCCESS           Data was read.\r
-  @retval EFI_NO_MEDIA         The device has no media.\r
+  @retval EFI_NO_MEDIA          The device has no media.\r
   @retval EFI_DEVICE_ERROR      The device reported an error.\r
-  @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.\r
+  @retval EFI_VOLUME_CORRUPTED  The file system structures are corrupted.\r
   @retval EFI_BUFFER_TO_SMALL   Buffer is too small. ReadSize contains required\r
                                 size.\r
 \r
@@ -235,16 +238,16 @@ ShellReadFile(
   The file is automatically grown to hold the data if required. Direct writes to\r
   opened directories are not supported.\r
 \r
-  @param[in] FileHandle         The opened file for writing.\r
+  @param[in] FileHandle          The opened file for writing.\r
 \r
-  @param[in,out] BufferSize     On input the number of bytes in Buffer.  On output\r
-                                the number of bytes written.\r
+  @param[in, out] BufferSize     On input the number of bytes in Buffer.  On output\r
+                                 the number of bytes written.\r
 \r
-  @param[in] Buffer             The buffer containing data to write is stored.\r
+  @param[in] Buffer              The buffer containing data to write is stored.\r
 \r
   @retval EFI_SUCCESS           Data was written.\r
   @retval EFI_UNSUPPORTED       Writes to an open directory are not supported.\r
-  @retval EFI_NO_MEDIA         The device has no media.\r
+  @retval EFI_NO_MEDIA          The device has no media.\r
   @retval EFI_DEVICE_ERROR      The device reported an error.\r
   @retval EFI_VOLUME_CORRUPTED  The file system structures are corrupted.\r
   @retval EFI_WRITE_PROTECTED   The device is write-protected.\r
@@ -289,7 +292,7 @@ ShellCloseFile (
   @retval EFI_SUCCESS               The file was closed sucessfully.\r
   @retval EFI_WARN_DELETE_FAILURE   The handle was closed, but the file was not\r
                                     deleted.\r
-  @retval INVALID_PARAMETER                One of the parameters has an invalid value.\r
+  @retval INVALID_PARAMETER         One of the parameters has an invalid value.\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -320,8 +323,8 @@ ShellDeleteFile (
 EFI_STATUS\r
 EFIAPI\r
 ShellSetFilePosition (\r
-  IN SHELL_FILE_HANDLE         FileHandle,\r
-  IN UINT64            Position\r
+  IN SHELL_FILE_HANDLE  FileHandle,\r
+  IN UINT64             Position\r
   );\r
 \r
 /**\r
@@ -366,16 +369,18 @@ ShellFlushFile (
   IN SHELL_FILE_HANDLE          FileHandle\r
   );\r
 \r
-/**\r
-  Retrieves the first file from a directory\r
+/** Retrieve first entry from a directory.\r
 \r
-  This function takes an open directory handle and gets the first file\r
-  in the directory's info. Caller can use ShellFindNextFile() to get\r
-  subsequent files.\r
+  This function takes an open directory handle and gets information from the\r
+  first entry in the directory.  A buffer is allocated to contain\r
+  the information and a pointer to the buffer is returned in *Buffer.  The\r
+  caller can use ShellFindNextFile() to get subsequent directory entries.\r
 \r
-  Caller must use FreePool on *Buffer opon completion of all file searching.\r
+  The buffer will be freed by ShellFindNextFile() when the last directory\r
+  entry is read.  Otherwise, the caller must free the buffer, using FreePool,\r
+  when finished with it.\r
 \r
-  @param[in] DirHandle          The file handle of the directory to search.\r
+  @param[in]  DirHandle         The file handle of the directory to search.\r
   @param[out] Buffer            The pointer to the buffer for the file's information.\r
 \r
   @retval EFI_SUCCESS           Found the first file.\r
@@ -383,41 +388,44 @@ ShellFlushFile (
   @retval EFI_NO_MEDIA          The device has no media.\r
   @retval EFI_DEVICE_ERROR      The device reported an error.\r
   @retval EFI_VOLUME_CORRUPTED  The file system structures are corrupted.\r
+  @return Others                Status of ShellGetFileInfo, ShellSetFilePosition,\r
+                                or ShellReadFile.\r
+\r
   @sa ShellReadFile\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 ShellFindFirstFile (\r
-  IN SHELL_FILE_HANDLE          DirHandle,\r
-  OUT EFI_FILE_INFO             **Buffer\r
+  IN      SHELL_FILE_HANDLE       DirHandle,\r
+     OUT  EFI_FILE_INFO         **Buffer\r
   );\r
 \r
-/**\r
-  Retrieves the next file in a directory.\r
+/** Retrieve next entries from a directory.\r
 \r
-  To use this function, caller must call the ShellFindFirstFile() to get the\r
-  first file, and then use this function get other files. This function can be\r
-  called for several times to get each file's information in the directory. If\r
-  the call of ShellFindNextFile() got the last file in the directory, the next\r
-  call of this function has no file to get. *NoFile will be set to TRUE, and the\r
-  data in Buffer is meaningless.\r
+  To use this function, the caller must first call the ShellFindFirstFile()\r
+  function to get the first directory entry.  Subsequent directory entries are\r
+  retrieved by using the ShellFindNextFile() function.  This function can\r
+  be called several times to get each entry from the directory.  If the call of\r
+  ShellFindNextFile() retrieved the last directory entry, the next call of\r
+  this function will set *NoFile to TRUE and free the buffer.\r
 \r
-  @param[in] DirHandle          The file handle of the directory.\r
-  @param[in,out] Buffer         The pointer to buffer for file's information.\r
-  @param[in,out] NoFile         The pointer to boolean when last file is found.\r
+  @param[in]  DirHandle         The file handle of the directory.\r
+  @param[in, out] Buffer        The pointer to buffer for file's information.\r
+  @param[in, out] NoFile        The pointer to boolean when last file is found.\r
 \r
   @retval EFI_SUCCESS           Found the next file.\r
   @retval EFI_NO_MEDIA          The device has no media.\r
   @retval EFI_DEVICE_ERROR      The device reported an error.\r
   @retval EFI_VOLUME_CORRUPTED  The file system structures are corrupted.\r
+\r
   @sa ShellReadFile\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 ShellFindNextFile(\r
-  IN SHELL_FILE_HANDLE           DirHandle,\r
-  IN OUT EFI_FILE_INFO           *Buffer,\r
-  IN OUT BOOLEAN                 *NoFile\r
+  IN      SHELL_FILE_HANDLE       DirHandle,\r
+  IN OUT  EFI_FILE_INFO          *Buffer,\r
+  IN OUT  BOOLEAN                *NoFile\r
   );\r
 \r
 /**\r
@@ -545,6 +553,8 @@ ShellExecute (
   name. If the DeviceName is not NULL, it returns the current directory name\r
   on specified drive.\r
 \r
+  Note that the current directory string should exclude the tailing backslash character.\r
+\r
   @param[in] DeviceName         The name of the file system to get directory on.\r
 \r
   @retval NULL                  The directory does not exist.\r
@@ -583,9 +593,9 @@ ShellSetPageBreakMode (
   If you are NOT appending to an existing list *ListHead must be NULL.  If\r
   *ListHead is NULL then it must be callee freed.\r
 \r
-  @param[in] Arg                The pointer to path string.\r
-  @param[in] OpenMode           Mode to open files with.\r
-  @param[in,out] ListHead       Head of linked list of results.\r
+  @param[in] Arg                 The pointer to path string.\r
+  @param[in] OpenMode            Mode to open files with.\r
+  @param[in, out] ListHead       Head of linked list of results.\r
 \r
   @retval EFI_SUCCESS           The operation was sucessful and the list head\r
                                 contains the list of opened files.\r
@@ -604,7 +614,7 @@ ShellOpenFileMetaArg (
 /**\r
   Free the linked list returned from ShellOpenFileMetaArg.\r
 \r
-  @param[in,out] ListHead       The pointer to free.\r
+  @param[in, out] ListHead       The pointer to free.\r
 \r
   @retval EFI_SUCCESS           The operation was sucessful.\r
   @retval EFI_INVALID_PARAMETER A parameter was invalid.\r
@@ -663,6 +673,7 @@ typedef enum {
   TypeStart,        ///< A flag that has variable value appended to the end (IE "-ad", "-afd", "-adf", etc...).\r
   TypeDoubleValue,  ///< A flag that has 2 space seperated value data following it (IE "-a 1 2").\r
   TypeMaxValue,     ///< A flag followed by all the command line data before the next flag.\r
+  TypeTimeValue,    ///< A flag that has a time value following it (IE "-a -5:00").\r
   TypeMax,\r
 } SHELL_PARAM_TYPE;\r
 \r
@@ -988,7 +999,7 @@ ShellIsFileInPath(
   Function to determine whether a string is decimal or hex representation of a number\r
   and return the number converted from the string.\r
 \r
-  Note: this function cannot be used when (UINTN)(-1), (0xFFFFFFFF) may be a valid \r
+  Note: this function cannot be used when (UINTN)(-1), (0xFFFFFFFF) may be a valid\r
   result.  Use ShellConvertStringToUint64 instead.\r
 \r
   @param[in] String   String representation of a number.\r
@@ -1002,6 +1013,23 @@ ShellStrToUintn(
   IN CONST CHAR16 *String\r
   );\r
 \r
+/**\r
+  Function return the number converted from a hex representation of a number.\r
+\r
+  Note: this function cannot be used when (UINTN)(-1), (0xFFFFFFFF) may be a valid\r
+  result.  Use ShellConvertStringToUint64 instead.\r
+\r
+  @param[in] String   String representation of a number.\r
+\r
+  @return             The unsigned integer result of the conversion.\r
+  @retval (UINTN)(-1) An error occured.\r
+**/\r
+UINTN\r
+EFIAPI\r
+ShellHexStrToUintn(\r
+  IN CONST CHAR16 *String\r
+  );\r
+\r
 /**\r
   Safely append with automatic string resizing given length of Destination and\r
   desired length of copy from Source.\r
@@ -1024,13 +1052,13 @@ ShellStrToUintn(
   If Destination's current length (including NULL terminator) is already more than\r
   CurrentSize, then ASSERT().\r
 \r
-  @param[in,out] Destination    The String to append onto.\r
-  @param[in,out] CurrentSize    On call, the number of bytes in Destination.  On\r
-                                return, possibly the new size (still in bytes).  If NULL,\r
-                                then allocate whatever is needed.\r
-  @param[in]     Source         The String to append from.\r
-  @param[in]     Count          The maximum number of characters to append.  If 0, then\r
-                                all are appended.\r
+  @param[in, out] Destination    The String to append onto.\r
+  @param[in, out] CurrentSize    On call, the number of bytes in Destination.  On\r
+                                 return, possibly the new size (still in bytes).  If NULL,\r
+                                 then allocate whatever is needed.\r
+  @param[in]      Source         The String to append from.\r
+  @param[in]      Count          The maximum number of characters to append.  If 0, then\r
+                                 all are appended.\r
 \r
   @return                       The Destination after appending the Source.\r
 **/\r
@@ -1051,14 +1079,14 @@ StrnCatGrow (
 \r
   If the string would grow bigger than NewSize it will halt and return error.\r
 \r
-  @param[in] SourceString             The string with source buffer.\r
-  @param[in,out] NewString            The string with resultant buffer.\r
-  @param[in] NewSize                  The size in bytes of NewString.\r
-  @param[in] FindTarget               The string to look for.\r
-  @param[in] ReplaceWith              The string to replace FindTarget with.\r
-  @param[in] SkipPreCarrot            If TRUE will skip a FindTarget that has a '^'\r
-                                      immediately before it.\r
-  @param[in] ParameterReplacing       If TRUE will add "" around items with spaces.\r
+  @param[in] SourceString              The string with source buffer.\r
+  @param[in, out] NewString            The string with resultant buffer.\r
+  @param[in] NewSize                   The size in bytes of NewString.\r
+  @param[in] FindTarget                The string to look for.\r
+  @param[in] ReplaceWith               The string to replace FindTarget with.\r
+  @param[in] SkipPreCarrot             If TRUE will skip a FindTarget that has a '^'\r
+                                       immediately before it.\r
+  @param[in] ParameterReplacing        If TRUE will add "" around items with spaces.\r
 \r
   @retval EFI_INVALID_PARAMETER       SourceString was NULL.\r
   @retval EFI_INVALID_PARAMETER       NewString was NULL.\r
@@ -1153,7 +1181,7 @@ typedef enum {
   Prompt the user and return the resultant answer to the requestor.\r
 \r
   This function will display the requested question on the shell prompt and then\r
-  wait for an apropriate answer to be input from the console.\r
+  wait for an appropriate answer to be input from the console.\r
 \r
   If the SHELL_PROMPT_REQUEST_TYPE is SHELL_PROMPT_REQUEST_TYPE_YESNO, ShellPromptResponseTypeQuitContinue\r
   or SHELL_PROMPT_REQUEST_TYPE_YESNOCANCEL then *Response is of type SHELL_PROMPT_RESPONSE.\r
@@ -1189,9 +1217,9 @@ ShellPromptForResponse (
 \r
   @param[in] Type What type of question is asked.  This is used to filter the input\r
                   to prevent invalid answers to question.\r
-  @param[in] HiiFormatStringId  The format string Id for getting from Hii.\r
-  @param[in] HiiFormatHandle    The format string Handle for getting from Hii.\r
-  @param[in,out] Response       The pointer to Response, which will be populated upon return.\r
+  @param[in] HiiFormatStringId   The format string Id for getting from Hii.\r
+  @param[in] HiiFormatHandle     The format string Handle for getting from Hii.\r
+  @param[in, out] Response       The pointer to Response, which will be populated upon return.\r
 \r
   @retval EFI_SUCCESS The operation was sucessful.\r
   @return other       The operation failed.\r
@@ -1235,9 +1263,9 @@ ShellIsHexOrDecimalNumber (
   @param[in] String       The string to evaluate.\r
   @param[out] Value       Upon a successful return the value of the conversion.\r
   @param[in] ForceHex     TRUE - always assume hex.\r
-  @param[in] StopAtSpace  TRUE to halt upon finding a space, FALSE to \r
+  @param[in] StopAtSpace  TRUE to halt upon finding a space, FALSE to\r
                           process the entire String.\r
-  \r
+\r
   @retval EFI_SUCCESS             The conversion was successful.\r
   @retval EFI_INVALID_PARAMETER   String contained an invalid character.\r
   @retval EFI_NOT_FOUND           String was a number, but Value was NULL.\r
@@ -1273,11 +1301,11 @@ ShellFileExists(
   If the position upon start is 0, then the Ascii Boolean will be set.  This should be\r
   maintained and not changed for all operations with the same file.\r
 \r
-  @param[in]      Handle        SHELL_FILE_HANDLE to read from.\r
-  @param[in,out]  Ascii         Boolean value for indicating whether the file is\r
-                                Ascii (TRUE) or UCS2 (FALSE).\r
+  @param[in]       Handle        SHELL_FILE_HANDLE to read from.\r
+  @param[in, out]  Ascii         Boolean value for indicating whether the file is\r
+                                 Ascii (TRUE) or UCS2 (FALSE).\r
 \r
-  @return                       The line of text from the file.\r
+  @return                        The line of text from the file.\r
 \r
   @sa ShellFileHandleReadLine\r
 **/\r
@@ -1294,20 +1322,21 @@ ShellFileHandleReturnLine(
   If the position upon start is 0, then the Ascii Boolean will be set.  This should be\r
   maintained and not changed for all operations with the same file.\r
 \r
-  @param[in]      Handle        SHELL_FILE_HANDLE to read from.\r
-  @param[in,out]  Buffer        The pointer to buffer to read into.\r
-  @param[in,out]  Size          The pointer to number of bytes in Buffer.\r
-  @param[in]      Truncate      If the buffer is large enough, this has no effect.\r
-                                If the buffer is is too small and Truncate is TRUE,\r
-                                the line will be truncated.\r
-                                If the buffer is is too small and Truncate is FALSE,\r
-                                then no read will occur.\r
+  @param[in]       Handle        SHELL_FILE_HANDLE to read from.\r
+  @param[in, out]  Buffer        The pointer to buffer to read into.\r
+  @param[in, out]  Size          The pointer to number of bytes in Buffer.\r
+  @param[in]       Truncate      If the buffer is large enough, this has no effect.\r
+                                 If the buffer is is too small and Truncate is TRUE,\r
+                                 the line will be truncated.\r
+                                 If the buffer is is too small and Truncate is FALSE,\r
+                                 then no read will occur.\r
 \r
-  @param[in,out]  Ascii         Boolean value for indicating whether the file is\r
-                                Ascii (TRUE) or UCS2 (FALSE).\r
+  @param[in, out]  Ascii         Boolean value for indicating whether the file is\r
+                                 Ascii (TRUE) or UCS2 (FALSE).\r
 \r
   @retval EFI_SUCCESS           The operation was successful.  The line is stored in\r
                                 Buffer.\r
+  @retval EFI_END_OF_FILE       There are no more lines in the file.\r
   @retval EFI_INVALID_PARAMETER Handle was NULL.\r
   @retval EFI_INVALID_PARAMETER Size was NULL.\r
   @retval EFI_BUFFER_TOO_SMALL  Size was not large enough to store the line.\r
@@ -1323,4 +1352,52 @@ ShellFileHandleReadLine(
   IN OUT BOOLEAN                *Ascii\r
   );\r
 \r
+/**\r
+  Function to delete a file by name\r
+\r
+  @param[in]       FileName       Pointer to file name to delete.\r
+\r
+  @retval EFI_SUCCESS             the file was deleted sucessfully\r
+  @retval EFI_WARN_DELETE_FAILURE the handle was closed, but the file was not\r
+                                  deleted\r
+  @retval EFI_INVALID_PARAMETER   One of the parameters has an invalid value.\r
+  @retval EFI_NOT_FOUND           The specified file could not be found on the\r
+                                  device or the file system could not be found\r
+                                  on the device.\r
+  @retval EFI_NO_MEDIA            The device has no medium.\r
+  @retval EFI_MEDIA_CHANGED       The device has a different medium in it or the\r
+                                  medium is no longer supported.\r
+  @retval EFI_DEVICE_ERROR        The device reported an error.\r
+  @retval EFI_VOLUME_CORRUPTED    The file system structures are corrupted.\r
+  @retval EFI_WRITE_PROTECTED     The file or medium is write protected.\r
+  @retval EFI_ACCESS_DENIED       The file was opened read only.\r
+  @retval EFI_OUT_OF_RESOURCES    Not enough resources were available to open the\r
+                                  file.\r
+  @retval other                   The file failed to open\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+ShellDeleteFileByName(\r
+  IN CONST CHAR16               *FileName\r
+  );\r
+\r
+/**\r
+  Function to print help file / man page content in the spec from the UEFI Shell protocol GetHelpText function.\r
+\r
+  @param[in] CommandToGetHelpOn  Pointer to a string containing the command name of help file to be printed.\r
+  @param[in] SectionToGetHelpOn  Pointer to the section specifier(s).\r
+  @param[in] PrintCommandText    If TRUE, prints the command followed by the help content, otherwise prints\r
+                                 the help content only.\r
+  @retval EFI_DEVICE_ERROR       The help data format was incorrect.\r
+  @retval EFI_NOT_FOUND          The help data could not be found.\r
+  @retval EFI_SUCCESS            The operation was successful.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+ShellPrintHelp (\r
+  IN CONST CHAR16     *CommandToGetHelpOn,\r
+  IN CONST CHAR16     *SectionToGetHelpOn,\r
+  IN BOOLEAN          PrintCommandText\r
+  );\r
+\r
 #endif // __SHELL_LIB__\r