]> 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 88020a06a89c57cc3540ee0a7a97dbc184b87e56..92fddc50f5dd525f07deeb4568d64e8748328825 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Provides interface to shell functionality for shell commands and applications.\r
 \r
-  Copyright (c) 2006 - 2015, 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
@@ -84,7 +89,6 @@ ShellSetFileInfo (
 \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
@@ -110,7 +114,6 @@ EFI_STATUS
 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
@@ -1178,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
@@ -1351,9 +1354,9 @@ ShellFileHandleReadLine(
 \r
 /**\r
   Function to delete a file by name\r
-  \r
+\r
   @param[in]       FileName       Pointer to file name to delete.\r
-  \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
@@ -1383,7 +1386,7 @@ ShellDeleteFileByName(
 \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
+  @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