]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Application/Shell/ShellParametersProtocol.h
ShellPkg/Application: Fix various typos
[mirror_edk2.git] / ShellPkg / Application / Shell / ShellParametersProtocol.h
index df3bfa7cbcc2bd8982d35e55eda532ea88c6f927..398147c8bd4c31292581eebd15d150134d6abf06 100644 (file)
@@ -2,50 +2,32 @@
   Member functions of EFI_SHELL_PARAMETERS_PROTOCOL and functions for creation,\r
   manipulation, and initialization of EFI_SHELL_PARAMETERS_PROTOCOL.\r
 \r
-  Copyright (c) 2009 - 2010, 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
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+  Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
 #ifndef _SHELL_PARAMETERS_PROTOCOL_PROVIDER_HEADER_\r
 #define _SHELL_PARAMETERS_PROTOCOL_PROVIDER_HEADER_\r
 \r
-#include <Uefi.h>\r
-\r
-#include <Protocol/SimpleFileSystem.h>\r
-#include <Protocol/EfiShellParameters.h>\r
-#include <Protocol/LoadedImage.h>\r
-#include <Protocol/SimpleTextOut.h>\r
-#include <Protocol/SimpleTextIn.h>\r
-\r
-#include <Guid/ShellVariableGuid.h>\r
-\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/UefiRuntimeServicesTableLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-#include <Library/UefiLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/ShellLib.h>\r
-#include <Library/FileHandleLib.h>\r
-\r
-#include "ShellEnvVar.h"\r
-#include "FileHandleWrappers.h"\r
 #include "Shell.h"\r
 \r
+typedef enum {\r
+  Internal_Command,\r
+  Script_File_Name,\r
+  Efi_Application,\r
+  File_Sys_Change,\r
+  Unknown_Invalid\r
+} SHELL_OPERATION_TYPES;\r
+\r
 /**\r
   creates a new EFI_SHELL_PARAMETERS_PROTOCOL instance and populates it and then\r
   installs it on our handle and if there is an existing version of the protocol\r
   that one is cached for removal later.\r
 \r
-  @param[in,out] NewShellParameters on a successful return, a pointer to pointer\r
+  @param[in, out] NewShellParameters on a successful return, a pointer to pointer\r
                                      to the newly installed interface.\r
-  @param[in,out] RootShellInstance  on a successful return, pointer to boolean.\r
+  @param[in, out] RootShellInstance  on a successful return, pointer to boolean.\r
                                      TRUE if this is the root shell instance.\r
 \r
   @retval EFI_SUCCESS               the operation completed successfully.\r
   @sa ParseCommandLineToArgs\r
 **/\r
 EFI_STATUS\r
-EFIAPI\r
 CreatePopulateInstallShellParametersProtocol (\r
   IN OUT EFI_SHELL_PARAMETERS_PROTOCOL  **NewShellParameters,\r
   IN OUT BOOLEAN                        *RootShellInstance\r
   );\r
 \r
 /**\r
-  frees all memory used by createion and installation of shell parameters protocol\r
+  frees all memory used by creation and installation of shell parameters protocol\r
   and if there was an old version installed it will restore that one.\r
 \r
   @param NewShellParameters the interface of EFI_SHELL_PARAMETERS_PROTOCOL that is\r
@@ -74,44 +55,43 @@ CreatePopulateInstallShellParametersProtocol (
   @sa UninstallProtocolInterface\r
 **/\r
 EFI_STATUS\r
-EFIAPI\r
 CleanUpShellParametersProtocol (\r
   IN OUT EFI_SHELL_PARAMETERS_PROTOCOL  *NewShellParameters\r
   );\r
 \r
 /**\r
-  Funcion will replace the current Argc and Argv in the ShellParameters protocol\r
+  Function will replace the current Argc and Argv in the ShellParameters protocol\r
   structure by parsing NewCommandLine.  The current values are returned to the\r
   user.\r
 \r
-  @param[in,out] ShellParameters       pointer to parameter structure to modify\r
+  @param[in, out] ShellParameters       pointer to parameter structure to modify\r
   @param[in] NewCommandLine             the new command line to parse and use\r
+  @param[in] Type                       the type of operation.\r
   @param[out] OldArgv                   pointer to old list of parameters\r
   @param[out] OldArgc                   pointer to old number of items in Argv list\r
 \r
-  @retval   EFI_SUCCESS                 operation was sucessful, Argv and Argc are valid\r
+  @retval   EFI_SUCCESS                 operation was successful, Argv and Argc are valid\r
   @retval   EFI_OUT_OF_RESOURCES        a memory allocation failed.\r
 **/\r
 EFI_STATUS\r
-EFIAPI\r
 UpdateArgcArgv(\r
   IN OUT EFI_SHELL_PARAMETERS_PROTOCOL  *ShellParameters,\r
   IN CONST CHAR16                       *NewCommandLine,\r
+  IN SHELL_OPERATION_TYPES              Type,\r
   OUT CHAR16                            ***OldArgv,\r
   OUT UINTN                             *OldArgc\r
   );\r
 \r
 /**\r
-  Funcion will replace the current Argc and Argv in the ShellParameters protocol\r
+  Function will replace the current Argc and Argv in the ShellParameters protocol\r
   structure with Argv and Argc.  The current values are de-allocated and the\r
   OldArgv must not be deallocated by the caller.\r
 \r
-  @param[in,out] ShellParameters       pointer to parameter structure to modify\r
-  @param[in] OldArgv                   pointer to old list of parameters\r
-  @param[in] OldArgc                   pointer to old number of items in Argv list\r
+  @param[in, out] ShellParameters       pointer to parameter structure to modify\r
+  @param[in] OldArgv                    pointer to old list of parameters\r
+  @param[in] OldArgc                    pointer to old number of items in Argv list\r
 **/\r
 VOID\r
-EFIAPI\r
 RestoreArgcArgv(\r
   IN OUT EFI_SHELL_PARAMETERS_PROTOCOL  *ShellParameters,\r
   IN CHAR16                             ***OldArgv,\r
@@ -123,29 +103,28 @@ typedef struct {
   EFI_HANDLE                            ConInHandle;\r
   EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL       *ConOut;\r
   EFI_HANDLE                            ConOutHandle;\r
-  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL       *ConErr;\r
-  EFI_HANDLE                            ConErrHandle;\r
+  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL       *ErrOut;\r
+  EFI_HANDLE                            ErrOutHandle;\r
 } SYSTEM_TABLE_INFO;\r
 \r
 /**\r
-  Funcion will replace the current StdIn and StdOut in the ShellParameters protocol\r
+  Function will replace the current StdIn and StdOut in the ShellParameters protocol\r
   structure by parsing NewCommandLine.  The current values are returned to the\r
   user.\r
 \r
   This will also update the system table.\r
 \r
-  @param[in,out] ShellParameters        Pointer to parameter structure to modify.\r
-  @param[in] NewCommandLine             The new command line to parse and use.\r
-  @param[out] OldStdIn                  Pointer to old StdIn.\r
-  @param[out] OldStdOut                 Pointer to old StdOut.\r
-  @param[out] OldStdErr                 Pointer to old StdErr.\r
-  @param[out] SystemTableInfo           Pointer to old system table information.\r
+  @param[in, out] ShellParameters        Pointer to parameter structure to modify.\r
+  @param[in] NewCommandLine              The new command line to parse and use.\r
+  @param[out] OldStdIn                   Pointer to old StdIn.\r
+  @param[out] OldStdOut                  Pointer to old StdOut.\r
+  @param[out] OldStdErr                  Pointer to old StdErr.\r
+  @param[out] SystemTableInfo            Pointer to old system table information.\r
 \r
-  @retval   EFI_SUCCESS                 Operation was sucessful, Argv and Argc are valid.\r
+  @retval   EFI_SUCCESS                 Operation was successful, Argv and Argc are valid.\r
   @retval   EFI_OUT_OF_RESOURCES        A memory allocation failed.\r
 **/\r
 EFI_STATUS\r
-EFIAPI\r
 UpdateStdInStdOutStdErr(\r
   IN OUT EFI_SHELL_PARAMETERS_PROTOCOL  *ShellParameters,\r
   IN CHAR16                             *NewCommandLine,\r
@@ -156,17 +135,16 @@ UpdateStdInStdOutStdErr(
   );\r
 \r
 /**\r
-  Funcion will replace the current StdIn and StdOut in the ShellParameters protocol\r
+  Function will replace the current StdIn and StdOut in the ShellParameters protocol\r
   structure with StdIn and StdOut.  The current values are de-allocated.\r
 \r
-  @param[in,out] ShellParameters      Pointer to parameter structure to modify.\r
-  @param[in] OldStdIn                 Pointer to old StdIn.\r
-  @param[in] OldStdOut                Pointer to old StdOut.\r
-  @param[in] OldStdErr                Pointer to old StdErr.\r
-  @param[in] SystemTableInfo          Pointer to old system table information.\r
+  @param[in, out] ShellParameters      Pointer to parameter structure to modify.\r
+  @param[in] OldStdIn                  Pointer to old StdIn.\r
+  @param[in] OldStdOut                 Pointer to old StdOut.\r
+  @param[in] OldStdErr                 Pointer to old StdErr.\r
+  @param[in] SystemTableInfo           Pointer to old system table information.\r
 **/\r
 EFI_STATUS\r
-EFIAPI\r
 RestoreStdInStdOutStdErr (\r
   IN OUT EFI_SHELL_PARAMETERS_PROTOCOL  *ShellParameters,\r
   IN  SHELL_FILE_HANDLE                 *OldStdIn,\r
@@ -182,19 +160,21 @@ RestoreStdInStdOutStdErr (
   parameters for inclusion in EFI_SHELL_PARAMETERS_PROTOCOL.  this supports space\r
   delimited and quote surrounded parameter definition.\r
 \r
-  @param[in] CommandLine        String of command line to parse\r
-  @param[in,out] Argv           pointer to array of strings; one for each parameter\r
-  @param[in,out] Argc           pointer to number of strings in Argv array\r
+  @param[in] CommandLine          String of command line to parse\r
+  @param[in] StripQuotation       if TRUE then strip the quotation marks surrounding\r
+                                  the parameters.\r
+  @param[in, out] Argv            pointer to array of strings; one for each parameter\r
+  @param[in, out] Argc            pointer to number of strings in Argv array\r
 \r
-  @return EFI_SUCCESS           the operation was sucessful\r
+  @return EFI_SUCCESS           the operation was successful\r
   @return EFI_OUT_OF_RESOURCES  a memory allocation failed.\r
 **/\r
 EFI_STATUS\r
-EFIAPI\r
 ParseCommandLineToArgs(\r
   IN CONST CHAR16 *CommandLine,\r
-  IN OUT CHAR16 ***Argv,\r
-  IN OUT UINTN *Argc\r
+  IN BOOLEAN      StripQuotation,\r
+  IN OUT CHAR16   ***Argv,\r
+  IN OUT UINTN    *Argc\r
   );\r
 \r
 /**\r
@@ -207,16 +187,22 @@ ParseCommandLineToArgs(
   Temp Parameter must be large enough to hold the parameter before calling this\r
   function.\r
 \r
-  @param[in,out] Walker        pointer to string of command line.  Adjusted to\r
-                                reminaing command line on return\r
-  @param[in,out] TempParameter pointer to string of command line item extracted.\r
+  @param[in, out] Walker          pointer to string of command line.  Adjusted to\r
+                                  remaining command line on return\r
+  @param[in, out] TempParameter   pointer to string of command line item extracted.\r
+  @param[in]      Length          Length of (*TempParameter) in bytes\r
+  @param[in]      StripQuotation  if TRUE then strip the quotation marks surrounding\r
+                                  the parameters.\r
 \r
+  @return   EFI_INVALID_PARAMETER A required parameter was NULL or pointed to a NULL or empty string.\r
+  @return   EFI_NOT_FOUND         A closing " could not be found on the specified string\r
 **/\r
-VOID\r
-EFIAPI\r
+EFI_STATUS\r
 GetNextParameter(\r
-  CHAR16 **Walker,\r
-  CHAR16 **TempParameter\r
+  IN OUT CHAR16   **Walker,\r
+  IN OUT CHAR16   **TempParameter,\r
+  IN CONST UINTN  Length,\r
+  IN BOOLEAN      StripQuotation\r
   );\r
 \r
 #endif //_SHELL_PARAMETERS_PROTOCOL_PROVIDER_HEADER_\r