]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Include/Library/ShellLib.h
ShellPkg: Correct a parameter's name
[mirror_edk2.git] / ShellPkg / Include / Library / ShellLib.h
index 5c644debfcf9beeb1e465919b2eee11305398154..78bdcc8c53116ca65c3cae7651d6601b5d93cbef 100644 (file)
@@ -1,7 +1,8 @@
 /** @file\r
   Provides interface to shell functionality for shell commands and applications.\r
 \r
-  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
+  Copyright 2018 Dell Technologies.<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
@@ -12,7 +13,7 @@
 \r
 **/\r
 \r
-#if !defined(__SHELL_LIB__)\r
+#ifndef __SHELL_LIB__\r
 #define __SHELL_LIB__\r
 \r
 #include <Uefi.h>\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
+#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
+\r
+/**\r
+  Return a clean, fully-qualified version of an input path.  If the return value\r
+  is non-NULL the caller must free the memory when it is no longer needed.\r
+\r
+  If asserts are disabled, and if the input parameter is NULL, NULL is returned.\r
+\r
+  If there is not enough memory available to create the fully-qualified path or\r
+  a copy of the input path, NULL is returned.\r
+\r
+  If there is no working directory, a clean copy of Path is returned.\r
+\r
+  Otherwise, the current file system or working directory (as appropriate) is\r
+  prepended to Path and the resulting path is cleaned and returned.\r
+\r
+  NOTE: If the input path is an empty string, then the current working directory\r
+  (if it exists) is returned.  In other words, an empty input path is treated\r
+  exactly the same as ".".\r
+\r
+  @param[in] Path  A pointer to some file or directory path.\r
+\r
+  @retval NULL          The input path is NULL or out of memory.\r
+\r
+  @retval non-NULL      A pointer to a clean, fully-qualified version of Path.\r
+                        If there is no working directory, then a pointer to a\r
+                        clean, but not necessarily fully-qualified version of\r
+                        Path.  The caller must free this memory when it is no\r
+                        longer needed.\r
+**/\r
+CHAR16*\r
+EFIAPI\r
+FullyQualifyPath(\r
+  IN     CONST CHAR16     *Path\r
+  );\r
 \r
 /**\r
   This function will retrieve the information about the file for the handle\r
 EFI_FILE_INFO*\r
 EFIAPI\r
 ShellGetFileInfo (\r
-  IN EFI_FILE_HANDLE            FileHandle\r
+  IN SHELL_FILE_HANDLE          FileHandle\r
   );\r
 \r
 /**\r
-  This function will set the information about the file for the opened handle\r
+  This function sets the information about the file for the opened handle\r
   specified.\r
 \r
   @param[in]  FileHandle        The file handle of the file for which information\r
                                 is being set.\r
 \r
-  @param[in] FileInfo           The infotmation to set.\r
+  @param[in]  FileInfo          The information to set.\r
 \r
-  @retval EFI_SUCCESS            The information was set.\r
-  @retval EFI_UNSUPPORTED       The InformationType is not known.\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_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_ACCESS_DENIED        The file was opened read only.\r
-  @retval EFI_VOLUME_FULL            The volume is full.\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 EFI_FILE_HANDLE           FileHandle,\r
+  IN SHELL_FILE_HANDLE          FileHandle,\r
   IN EFI_FILE_INFO              *FileInfo\r
   );\r
 \r
@@ -75,76 +122,74 @@ 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]  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
-\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
+  @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_UNSUPPORTED       Could not open the file path.\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
+  @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
+  @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 EFI_VOLUME_FULL            The volume is full.\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 EFI_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
   This function will open a file or directory referenced by filename.\r
 \r
   If return is EFI_SUCCESS, the Filehandle is the opened file's handle;\r
-  otherwise, the Filehandle is NULL. The Attributes is valid only for\r
+  otherwise, the Filehandle is NULL. Attributes is valid only for\r
   EFI_FILE_MODE_CREATE.\r
 \r
-  @param[in] FileName                Pointer to file name.\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] FileName           The pointer to file name.\r
+  @param[out] FileHandle        The 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_UNSUPPORTED            Could not open the file path.\r
-  @retval EFI_NOT_FOUND                The specified file could not be found on the\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
                                 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
+  @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
+  @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 EFI_VOLUME_FULL            The volume is full.\r
+  @retval EFI_VOLUME_FULL       The volume is full.\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 ShellOpenFileByName(\r
-  IN CONST CHAR16                          *FilePath,\r
-  OUT EFI_FILE_HANDLE           *FileHandle,\r
+  IN CONST CHAR16               *FileName,\r
+  OUT SHELL_FILE_HANDLE         *FileHandle,\r
   IN UINT64                     OpenMode,\r
-  IN UINT64                            Attributes\r
+  IN UINT64                     Attributes\r
   );\r
 \r
 /**\r
@@ -154,31 +199,31 @@ ShellOpenFileByName(
   otherwise, the Filehandle is NULL. If the directory already existed, this\r
   function opens the existing directory.\r
 \r
-  @param[in]  DirectoryName     Pointer to Directory name.\r
-  @param[out] FileHandle        Pointer to the file handle.\r
+  @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_UNSUPPORTED            Could not open the file path.\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
+  @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
+                                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
+  @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
+  @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 EFI_VOLUME_FULL            The volume is full.\r
+  @retval EFI_VOLUME_FULL       The volume is full.\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 ShellCreateDirectory(\r
   IN CONST CHAR16             *DirectoryName,\r
-  OUT EFI_FILE_HANDLE         *FileHandle\r
+  OUT SHELL_FILE_HANDLE       *FileHandle\r
   );\r
 \r
 /**\r
@@ -197,23 +242,23 @@ 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] 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_DEVICE_ERROR         The device reported an error.\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
+  @retval EFI_SUCCESS           Data was read.\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_BUFFER_TO_SMALL   Buffer is too small. ReadSize contains required\r
                                 size.\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 ShellReadFile(\r
-  IN EFI_FILE_HANDLE            FileHandle,\r
+  IN SHELL_FILE_HANDLE          FileHandle,\r
   IN OUT UINTN                  *ReadSize,\r
   OUT VOID                      *Buffer\r
   );\r
@@ -228,26 +273,26 @@ 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] 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_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
-  @retval EFI_ACCESS_DENIED        The file was open for read only.\r
-  @retval EFI_VOLUME_FULL            The volume is full.\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_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
+  @retval EFI_ACCESS_DENIED     The file was open for read only.\r
+  @retval EFI_VOLUME_FULL       The volume is full.\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 ShellWriteFile(\r
-  IN EFI_FILE_HANDLE            FileHandle,\r
+  IN SHELL_FILE_HANDLE          FileHandle,\r
   IN OUT UINTN                  *BufferSize,\r
   IN VOID                       *Buffer\r
   );\r
@@ -262,12 +307,12 @@ ShellWriteFile(
   @param[in] FileHandle           The file handle to close.\r
 \r
   @retval EFI_SUCCESS             The file handle was closed sucessfully.\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
 ShellCloseFile (\r
-  IN EFI_FILE_HANDLE            *FileHandle\r
+  IN SHELL_FILE_HANDLE          *FileHandle\r
   );\r
 \r
 /**\r
@@ -282,12 +327,12 @@ 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
 ShellDeleteFile (\r
-  IN EFI_FILE_HANDLE           *FileHandle\r
+  IN SHELL_FILE_HANDLE          *FileHandle\r
   );\r
 \r
 /**\r
@@ -295,15 +340,15 @@ ShellDeleteFile (
 \r
   This function sets the current file position for the handle to the position\r
   supplied. With the exception of seeking to position 0xFFFFFFFFFFFFFFFF, only\r
-  absolute positioning is supported, and seeking past the end of the file is\r
-  allowed (a subsequent write would grow the file). Seeking to position\r
+  absolute positioning is supported, and moving past the end of the file is\r
+  allowed (a subsequent write would grow the file). Moving to position\r
   0xFFFFFFFFFFFFFFFF causes the current position to be set to the end of the file.\r
   If FileHandle is a directory, the only position that may be set is zero. This\r
   has the effect of starting the read process of the directory entries over.\r
 \r
   @param[in] FileHandle         The file handle on which the position is being set.\r
 \r
-  @param[in] Position           Byte position from begining of file.\r
+  @param[in] Position           The byte position from the begining of the file.\r
 \r
   @retval EFI_SUCCESS           Operation completed sucessfully.\r
   @retval EFI_UNSUPPORTED       The seek request for non-zero is not valid on\r
@@ -313,8 +358,8 @@ ShellDeleteFile (
 EFI_STATUS\r
 EFIAPI\r
 ShellSetFilePosition (\r
-  IN EFI_FILE_HANDLE           FileHandle,\r
-  IN UINT64            Position\r
+  IN SHELL_FILE_HANDLE  FileHandle,\r
+  IN UINT64             Position\r
   );\r
 \r
 /**\r
@@ -326,7 +371,7 @@ ShellSetFilePosition (
   if FileHandle is a directory.\r
 \r
   @param[in] FileHandle         The open file handle on which to get the position.\r
-  @param[out] Position          Byte position from begining of file.\r
+  @param[out] Position          The byte position from the begining of the file.\r
 \r
   @retval EFI_SUCCESS           The operation completed sucessfully.\r
   @retval INVALID_PARAMETER     One of the parameters has an invalid value.\r
@@ -335,7 +380,7 @@ ShellSetFilePosition (
 EFI_STATUS\r
 EFIAPI\r
 ShellGetFilePosition (\r
-  IN EFI_FILE_HANDLE            FileHandle,\r
+  IN SHELL_FILE_HANDLE          FileHandle,\r
   OUT UINT64                    *Position\r
   );\r
 \r
@@ -356,60 +401,66 @@ ShellGetFilePosition (
 EFI_STATUS\r
 EFIAPI\r
 ShellFlushFile (\r
-  IN EFI_FILE_HANDLE            FileHandle\r
+  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[out] Buffer            Pointer to pointer to buffer for file's information\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
   @retval EFI_NOT_FOUND         Cannot find the directory.\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
-  @return ShellReadFile\r
+  @return Others                Status of ShellGetFileInfo, ShellSetFilePosition,\r
+                                or ShellReadFile.\r
+\r
+  @sa ShellReadFile\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 ShellFindFirstFile (\r
-  IN EFI_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[out] Buffer                         Pointer to buffer for file's information.\r
-  @param[out] NoFile                         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 EFI_FILE_HANDLE             DirHandle,\r
-  OUT EFI_FILE_INFO              *Buffer,\r
-  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
@@ -419,7 +470,7 @@ ShellFindNextFile(
   data.\r
 \r
   @param[in] FileHandle         The file handle from which size is retrieved.\r
-  @param[out] Size              Pointer to size.\r
+  @param[out] Size              The pointer to size.\r
 \r
   @retval EFI_SUCCESS           The operation was completed sucessfully.\r
   @retval EFI_DEVICE_ERROR      Cannot access the file.\r
@@ -427,7 +478,7 @@ ShellFindNextFile(
 EFI_STATUS\r
 EFIAPI\r
 ShellGetFileSize (\r
-  IN EFI_FILE_HANDLE            FileHandle,\r
+  IN SHELL_FILE_HANDLE          FileHandle,\r
   OUT UINT64                    *Size\r
   );\r
 \r
@@ -436,8 +487,8 @@ ShellGetFileSize (
 \r
   This function is useful to check whether the application is being asked to halt by the shell.\r
 \r
-  @retval TRUE                  the execution break is enabled\r
-  @retval FALSE                 the execution break is not enabled\r
+  @retval TRUE                  The execution break is enabled.\r
+  @retval FALSE                 The execution break is not enabled.\r
 **/\r
 BOOLEAN\r
 EFIAPI\r
@@ -454,7 +505,7 @@ ShellGetExecutionBreakFlag(
   @param[in] EnvKey             The key name of the environment variable.\r
 \r
   @retval NULL                  The named environment variable does not exist.\r
-  @return != NULL               pointer to the value of the environment variable.\r
+  @return != NULL               The pointer to the value of the environment variable.\r
 **/\r
 CONST CHAR16*\r
 EFIAPI\r
@@ -479,8 +530,8 @@ ShellGetEnvironmentVariable (
   @param[in] EnvVal             The Value of the environment variable\r
   @param[in] Volatile           Indicates whether the variable is non-volatile (FALSE) or volatile (TRUE).\r
 \r
-  @retval EFI_SUCCESS           the operation was completed sucessfully\r
-  @retval EFI_UNSUPPORTED       This operation is not allowed in pre UEFI 2.0 Shell environments\r
+  @retval EFI_SUCCESS           The operation completed sucessfully\r
+  @retval EFI_UNSUPPORTED       This operation is not allowed in pre-UEFI 2.0 Shell environments.\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -507,11 +558,11 @@ ShellSetEnvironmentVariable (
   ShellExecute() function.  The Output parameter has no effect in a\r
   UEFI Shell 2.0 environment.\r
 \r
-  @param[in] ImageHandle          Parent image that is starting the operation.\r
-  @param[in] CommandLine          Pointer to NULL terminated command line.\r
+  @param[in] ParentHandle         The parent image starting the operation.\r
+  @param[in] CommandLine          The pointer to a NULL terminated command line.\r
   @param[in] Output               True to display debug output.  False to hide it.\r
   @param[in] EnvironmentVariables Optional pointer to array of environment variables\r
-                                  in the form "x=y".  If NULL current set is used.\r
+                                  in the form "x=y".  If NULL, the current set is used.\r
   @param[out] Status              The status of the run command line.\r
 \r
   @retval EFI_SUCCESS             The operation completed sucessfully.  Status\r
@@ -537,6 +588,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
@@ -545,7 +598,7 @@ ShellExecute (
 CONST CHAR16*\r
 EFIAPI\r
 ShellGetCurrentDir (\r
-  IN CHAR16                     *DeviceName OPTIONAL\r
+  IN CHAR16                     * CONST DeviceName OPTIONAL\r
   );\r
 \r
 /**\r
@@ -575,9 +628,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                Pointer to path string.\r
-  @param[in] OpenMode           Mode to open files with.\r
-  @param[in] 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
@@ -596,7 +649,7 @@ ShellOpenFileMetaArg (
 /**\r
   Free the linked list returned from ShellOpenFileMetaArg.\r
 \r
-  @param[in] 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
@@ -631,12 +684,12 @@ ShellFindFilePath (
   in the order provided and return the first one that is successful.\r
 \r
   If FileName is NULL, then ASSERT.\r
-  If FileExtension is NULL, then behavior is identical to ShellFindFilePath.\r
+  If FileExtension is NULL, then the behavior is identical to ShellFindFilePath.\r
 \r
   If the return value is not NULL then the memory must be caller freed.\r
 \r
-  @param[in] FileName           Filename string.\r
-  @param[in] FileExtension      Semi-colon delimeted list of possible extensions.\r
+  @param[in] FileName           The filename string.\r
+  @param[in] FileExtension      Semicolon delimited list of possible extensions.\r
 \r
   @retval NULL                  The file was not found.\r
   @retval !NULL                 The path to the file.\r
@@ -655,26 +708,30 @@ 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
-} ParamType;\r
+} SHELL_PARAM_TYPE;\r
 \r
 typedef struct {\r
-  CHAR16      *Name;\r
-  ParamType   Type;\r
+  CHAR16             *Name;\r
+  SHELL_PARAM_TYPE   Type;\r
 } SHELL_PARAM_ITEM;\r
 \r
 \r
 /// Helper structure for no parameters (besides -? and -b)\r
 extern SHELL_PARAM_ITEM EmptyParamList[];\r
 \r
+/// Helper structure for -sfo only (besides -? and -b)\r
+extern SHELL_PARAM_ITEM SfoParamList[];\r
+\r
 /**\r
   Checks the command line arguments passed against the list of valid ones.\r
   Optionally removes NULL values first.\r
 \r
   If no initialization is required, then return RETURN_SUCCESS.\r
 \r
-  @param[in] CheckList          Pointer to list of parameters to check.\r
-  @param[out] CheckPackage      Package of checked values.\r
+  @param[in] CheckList          The pointer to list of parameters to check.\r
+  @param[out] CheckPackage      The package of checked values.\r
   @param[out] ProblemParam      Optional pointer to pointer to unicode string for\r
                                 the paramater that caused failure.\r
   @param[in] AutoPageBreak      Will automatically set PageBreakEnabled.\r
@@ -683,9 +740,7 @@ extern SHELL_PARAM_ITEM EmptyParamList[];
   @retval EFI_SUCCESS           The operation completed sucessfully.\r
   @retval EFI_OUT_OF_RESOURCES  A memory allocation failed.\r
   @retval EFI_INVALID_PARAMETER A parameter was invalid.\r
-  @retval EFI_VOLUME_CORRUPTED  The command line was corrupt.  An argument was\r
-                                duplicated.  The duplicated command line argument\r
-                                was returned in ProblemParam if provided.\r
+  @retval EFI_VOLUME_CORRUPTED  The command line was corrupt.\r
   @retval EFI_DEVICE_ERROR      The commands contained 2 opposing arguments.  One\r
                                 of the command line arguments was returned in\r
                                 ProblemParam if provided.\r
@@ -735,12 +790,12 @@ ShellCommandLineFreeVarList (
 \r
   @retval TRUE                  The flag is on the command line.\r
   @retval FALSE                 The flag is not on the command line.\r
-  **/\r
+**/\r
 BOOLEAN\r
 EFIAPI\r
 ShellCommandLineGetFlag (\r
-  IN CONST LIST_ENTRY              *CheckPackage,\r
-  IN CHAR16                        *KeyString\r
+  IN CONST LIST_ENTRY         * CONST CheckPackage,\r
+  IN CONST CHAR16             * CONST KeyString\r
   );\r
 \r
 /**\r
@@ -754,8 +809,8 @@ ShellCommandLineGetFlag (
   @param[in] KeyString          The Key of the command line argument to check for.\r
 \r
   @retval NULL                  The flag is not on the command line.\r
-  @retval !=NULL                Pointer to unicode string of the value.\r
-  **/\r
+  @retval !=NULL                The pointer to unicode string of the value.\r
+**/\r
 CONST CHAR16*\r
 EFIAPI\r
 ShellCommandLineGetValue (\r
@@ -774,13 +829,13 @@ ShellCommandLineGetValue (
   @param[in] Position           The position of the value.\r
 \r
   @retval NULL                  The flag is not on the command line.\r
-  @retval !=NULL                Pointer to unicode string of the value.\r
-  **/\r
+  @retval !=NULL                The pointer to unicode string of the value.\r
+**/\r
 CONST CHAR16*\r
 EFIAPI\r
 ShellCommandLineGetRawValue (\r
-  IN CONST LIST_ENTRY              *CheckPackage,\r
-  IN UINT32                        Position\r
+  IN CONST LIST_ENTRY              * CONST CheckPackage,\r
+  IN UINT                        Position\r
   );\r
 \r
 /**\r
@@ -788,20 +843,22 @@ ShellCommandLineGetRawValue (
 \r
   This will not include flags.\r
 \r
-  @retval (UINTN)-1     No parsing has ocurred.\r
-  @return               The number of value parameters found.\r
+  @param[in] CheckPackage       The package of parsed command line arguments.\r
+\r
+  @retval (UINTN)-1             No parsing has occurred.\r
+  @retval other                 The number of value parameters found.\r
 **/\r
 UINTN\r
 EFIAPI\r
 ShellCommandLineGetCount(\r
-  VOID\r
+  IN CONST LIST_ENTRY              *CheckPackage\r
   );\r
 \r
 /**\r
-  Determins if a parameter is duplicated.\r
+  Determines if a parameter is duplicated.\r
 \r
-  If Param is not NULL then it will point to a callee allocated string buffer\r
-  with the parameter value if a duplicate is found.\r
+  If Param is not NULL, then it will point to a callee-allocated string buffer\r
+  with the parameter value, if a duplicate is found.\r
 \r
   If CheckPackage is NULL, then ASSERT.\r
 \r
@@ -820,7 +877,7 @@ ShellCommandLineCheckDuplicate (
 \r
 /**\r
   This function causes the shell library to initialize itself.  If the shell library\r
-  is already initialized it will de-initialize all the current protocol poitners and\r
+  is already initialized it will de-initialize all the current protocol pointers and\r
   re-populate them again.\r
 \r
   When the library is used with PcdShellLibAutoInitialize set to true this function\r
@@ -828,7 +885,7 @@ ShellCommandLineCheckDuplicate (
 \r
   This function is intended for internal access for shell commands only.\r
 \r
-  @retval EFI_SUCCESS   the initialization was complete sucessfully\r
+  @retval EFI_SUCCESS   The initialization was complete sucessfully.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -858,14 +915,15 @@ ShellInitialize (
 \r
   Note: The background color is controlled by the shell command cls.\r
 \r
-  @param[in] Row        The row to print at.\r
   @param[in] Col        The column to print at.\r
+  @param[in] Row        The row to print at.\r
   @param[in] Format     The format string.\r
+  @param[in] ...        The variable argument list.\r
 \r
-  @return The number of characters printed to the screen.\r
+  @return EFI_SUCCESS           The printing was successful.\r
+  @return EFI_DEVICE_ERROR      The console device reported an error.\r
 **/\r
-\r
-UINTN\r
+EFI_STATUS\r
 EFIAPI\r
 ShellPrintEx(\r
   IN INT32                Col OPTIONAL,\r
@@ -895,16 +953,18 @@ ShellPrintEx(
 \r
   Note: The background color is controlled by the shell command cls.\r
 \r
-  @param[in] Row                The row to print at.\r
   @param[in] Col                The column to print at.\r
+  @param[in] Row                The row to print at.\r
   @param[in] Language           The language of the string to retrieve.  If this parameter\r
                                 is NULL, then the current platform language is used.\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] ...                The variable argument list.\r
 \r
-  @return the number of characters printed to the screen.\r
+  @return EFI_SUCCESS           The printing was successful.\r
+  @return EFI_DEVICE_ERROR      The console device reported an error.\r
 **/\r
-UINTN\r
+EFI_STATUS\r
 EFIAPI\r
 ShellPrintHiiEx(\r
   IN INT32                Col OPTIONAL,\r
@@ -974,9 +1034,13 @@ 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
-  @param[in] String   String representation of a number\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
@@ -984,6 +1048,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
@@ -999,22 +1080,22 @@ ShellStrToUintn(
   given in CurrentSize the string will be grown such that the copy can be performed\r
   and CurrentSize will be updated to the new size.\r
 \r
-  If Source is NULL, there is nothing to append, just return the current buffer in\r
+  If Source is NULL, there is nothing to append, so return the current buffer in\r
   Destination.\r
 \r
   If Destination is NULL, then ASSERT().\r
   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          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 apending the Source.\r
+  @return                       The Destination after appending the Source.\r
 **/\r
 CHAR16*\r
 EFIAPI\r
@@ -1033,13 +1114,14 @@ StrnCatGrow (
 \r
   If the string would grow bigger than NewSize it will halt and return error.\r
 \r
-  @param[in] SourceString             String with source buffer.\r
-  @param[in,out] NewString            String with resultant buffer.\r
-  @param[in] NewSize                  Size in bytes of NewString.\r
-  @param[in] FindTarget               String to look for.\r
-  @param[in] ReplaceWith              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] 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
@@ -1049,36 +1131,32 @@ StrnCatGrow (
   @retval EFI_INVALID_PARAMETER       SourceString had length < 1.\r
   @retval EFI_BUFFER_TOO_SMALL        NewSize was less than the minimum size to hold\r
                                       the new string (truncation occurred).\r
-  @retval EFI_SUCCESS                 The string was sucessfully copied with replacement.\r
+  @retval EFI_SUCCESS                 The string was successfully copied with replacement.\r
 **/\r
-\r
 EFI_STATUS\r
 EFIAPI\r
-ShellCopySearchAndReplace2(\r
+ShellCopySearchAndReplace(\r
   IN CHAR16 CONST                     *SourceString,\r
-  IN CHAR16                           *NewString,\r
+  IN OUT CHAR16                       *NewString,\r
   IN UINTN                            NewSize,\r
   IN CONST CHAR16                     *FindTarget,\r
   IN CONST CHAR16                     *ReplaceWith,\r
-  IN CONST BOOLEAN                    SkipPreCarrot\r
+  IN CONST BOOLEAN                    SkipPreCarrot,\r
+  IN CONST BOOLEAN                    ParameterReplacing\r
   );\r
 \r
-///\r
-/// make upgrades easier from old version\r
-///\r
-#define ShellLibCopySearchAndReplace(a,b,c,d,e) ShellCopySearchAndReplace2(a,b,c,d,e,FALSE)\r
-\r
 /**\r
   Check if a Unicode character is a hexadecimal character.\r
 \r
   This internal function checks if a Unicode character is a\r
-  decimal character.  The valid hexadecimal character is\r
+  numeric character.  The valid hexadecimal characters are\r
   L'0' to L'9', L'a' to L'f', or L'A' to L'F'.\r
 \r
-  @param[in]  Char  The character to check.\r
 \r
-  @retval TRUE      The Char is a hexadecmial character.\r
-  @retval FALSE     The Char is not a hexadecmial character.\r
+  @param  Char  The character to check against.\r
+\r
+  @retval TRUE  The Char is a hexadecmial character.\r
+  @retval FALSE The Char is not a hexadecmial character.\r
 \r
 **/\r
 BOOLEAN\r
@@ -1087,56 +1165,75 @@ ShellIsHexaDecimalDigitCharacter (
   IN      CHAR16                    Char\r
   );\r
 \r
+/**\r
+  Check if a Unicode character is a decimal character.\r
+\r
+  This internal function checks if a Unicode character is a\r
+  decimal character.  The valid characters are\r
+  L'0' to L'9'.\r
+\r
+\r
+  @param  Char  The character to check against.\r
+\r
+  @retval TRUE  The Char is a hexadecmial character.\r
+  @retval FALSE The Char is not a hexadecmial character.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+ShellIsDecimalDigitCharacter (\r
+  IN      CHAR16                    Char\r
+  );\r
+\r
 ///\r
-/// What type of answer is requested\r
+/// What type of answer is requested.\r
 ///\r
 typedef enum {\r
-  SHELL_PROMPT_REQUEST_TYPE_YES_NO,\r
-  SHELL_PROMPT_REQUEST_TYPE_YES_NO_CANCEL,\r
-  SHELL_PROMPT_REQUEST_TYPE_FREEFORM,\r
-  SHELL_PROMPT_REQUEST_TYPE_QUIT_CONTINUE,\r
-  SHELL_PROMPT_REQUEST_TYPE_YES_NO_ALL_CANCEL,\r
-  SHELL_PROMPT_REQUEST_TYPE_ENTER_TO_COMTINUE,\r
-  SHELL_PROMPT_REQUEST_TYPE_ANYKEY_TO_COMTINUE,\r
-  SHELL_PROMPT_REQUEST_TYPE_MAX\r
+  ShellPromptResponseTypeYesNo,\r
+  ShellPromptResponseTypeYesNoCancel,\r
+  ShellPromptResponseTypeFreeform,\r
+  ShellPromptResponseTypeQuitContinue,\r
+  ShellPromptResponseTypeYesNoAllCancel,\r
+  ShellPromptResponseTypeEnterContinue,\r
+  ShellPromptResponseTypeAnyKeyContinue,\r
+  ShellPromptResponseTypeMax\r
 } SHELL_PROMPT_REQUEST_TYPE;\r
 \r
 ///\r
-/// what answer was given\r
+/// What answer was given.\r
 ///\r
 typedef enum {\r
-  SHELL_PROMPT_RESPONSE_YES,\r
-  SHELL_PROMPT_RESPONSE_NO,\r
-  SHELL_PROMPT_RESPONSE_CANCEL,\r
-  SHELL_PROMPT_RESPONSE_QUIT,\r
-  SHELL_PROMPT_RESPONSE_CONTINUE,\r
-  SHELL_PROMPT_RESPONSE_ALL,\r
-  SHELL_PROMPT_RESPONSE_MAX\r
+  ShellPromptResponseYes,\r
+  ShellPromptResponseNo,\r
+  ShellPromptResponseCancel,\r
+  ShellPromptResponseQuit,\r
+  ShellPromptResponseContinue,\r
+  ShellPromptResponseAll,\r
+  ShellPromptResponseMax\r
 } SHELL_PROMPT_RESPONSE;\r
 \r
 /**\r
   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, SHELL_PROMPT_REQUEST_TYPE_QUIT_CONTINUE\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
 \r
-  if the SHELL_PROMPT_REQUEST_TYPE is SHELL_PROMPT_REQUEST_TYPE_FREEFORM then *Response is of type\r
+  If the SHELL_PROMPT_REQUEST_TYPE is ShellPromptResponseTypeFreeform then *Response is of type\r
   CHAR16*.\r
 \r
   In either case *Response must be callee freed if Response was not NULL;\r
 \r
   @param Type                     What type of question is asked.  This is used to filter the input\r
                                   to prevent invalid answers to question.\r
-  @param Prompt                   Pointer to string prompt to use to request input.\r
-  @param Response                 Pointer to Response which will be populated upon return.\r
+  @param Prompt                   The pointer to a string prompt used to request input.\r
+  @param Response                 The pointer to Response, which will be populated upon return.\r
 \r
-  @retval EFI_SUCCESS             The operation was sucessful.\r
+  @retval EFI_SUCCESS             The operation was successful.\r
   @retval EFI_UNSUPPORTED         The operation is not supported as requested.\r
   @retval EFI_INVALID_PARAMETER   A parameter was invalid.\r
-  @retval EFI_OUT_OF_RESOURCES    A memory allocation failed.\r
   @return other                   The operation failed.\r
 **/\r
 EFI_STATUS\r
@@ -1153,13 +1250,14 @@ ShellPromptForResponse (
   This function is the same as ShellPromptForResponse, except that the prompt is\r
   automatically pulled from HII.\r
 \r
-  @param Type     What type of question is asked.  This is used to filter the input\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 Prompt   Pointer to string prompt to use to request input.\r
-  @param Response 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
+  @retval EFI_SUCCESS The operation was sucessful.\r
+  @return other       The operation failed.\r
 \r
   @sa ShellPromptForResponse\r
 **/\r
@@ -1172,5 +1270,169 @@ ShellPromptForResponseHii (
   IN OUT VOID             **Response\r
   );\r
 \r
+/**\r
+  Function to determin if an entire string is a valid number.\r
+\r
+  If Hex it must be preceeded with a 0x, 0X, or has ForceHex set TRUE.\r
+\r
+  @param[in] String       The string to evaluate.\r
+  @param[in] ForceHex     TRUE - always assume hex.\r
+  @param[in] StopAtSpace  TRUE to halt upon finding a space, FALSE to keep going.\r
+\r
+  @retval TRUE        It is all numeric (dec/hex) characters.\r
+  @retval FALSE       There is a non-numeric character.\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+ShellIsHexOrDecimalNumber (\r
+  IN CONST CHAR16   *String,\r
+  IN CONST BOOLEAN  ForceHex,\r
+  IN CONST BOOLEAN  StopAtSpace\r
+  );\r
+\r
+/**\r
+  Function to verify and convert a string to its numerical 64 bit representation.\r
+\r
+  If Hex it must be preceeded with a 0x, 0X, or has ForceHex set TRUE.\r
+\r
+  @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
+                          process the entire String.\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
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+ShellConvertStringToUint64(\r
+  IN CONST CHAR16   *String,\r
+     OUT   UINT64   *Value,\r
+  IN CONST BOOLEAN  ForceHex,\r
+  IN CONST BOOLEAN  StopAtSpace\r
+  );\r
+\r
+/**\r
+  Function to determine if a given filename exists.\r
+\r
+  @param[in] Name         Path to test.\r
+\r
+  @retval EFI_SUCCESS     The Path represents a file.\r
+  @retval EFI_NOT_FOUND   The Path does not represent a file.\r
+  @retval other           The path failed to open.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+ShellFileExists(\r
+  IN CONST CHAR16 *Name\r
+  );\r
+\r
+/**\r
+  Function to read a single line from a SHELL_FILE_HANDLE. The \n is not included in the returned\r
+  buffer.  The returned buffer must be callee freed.\r
+\r
+  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
+\r
+  @return                        The line of text from the file.\r
+\r
+  @sa ShellFileHandleReadLine\r
+**/\r
+CHAR16*\r
+EFIAPI\r
+ShellFileHandleReturnLine(\r
+  IN SHELL_FILE_HANDLE            Handle,\r
+  IN OUT BOOLEAN                *Ascii\r
+  );\r
+\r
+/**\r
+  Function to read a single line (up to but not including the \n) from a SHELL_FILE_HANDLE.\r
+\r
+  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
+\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
+                                Size was updated to the minimum space required.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+ShellFileHandleReadLine(\r
+  IN SHELL_FILE_HANDLE          Handle,\r
+  IN OUT CHAR16                 *Buffer,\r
+  IN OUT UINTN                  *Size,\r
+  IN BOOLEAN                    Truncate,\r
+  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