]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Application/Shell/Shell.h
ShellPkg/Application: Fix various typos
[mirror_edk2.git] / ShellPkg / Application / Shell / Shell.h
index a34c91ad1e5d73018477b3e31b9a82a0b137f4b6..e6eb150f57a525fbf75974c2752ac0f67f3b17db 100644 (file)
@@ -2,14 +2,8 @@
   function definitions for internal to shell functions.\r
 \r
   (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>\r
-  Copyright (c) 2009 - 2016, 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 - 2018, Intel Corporation. All rights reserved.<BR>\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
 #define _SHELL_INTERNAL_HEADER_\r
 \r
 #include <Uefi.h>\r
-#include <ShellBase.h>\r
 \r
 #include <Guid/ShellVariableGuid.h>\r
 #include <Guid/ShellAliasGuid.h>\r
 \r
 #include <Protocol/LoadedImage.h>\r
 #include <Protocol/SimpleTextOut.h>\r
-#include <Protocol/EfiShell.h>\r
+#include <Protocol/Shell.h>\r
 #include <Protocol/EfiShellInterface.h>\r
 #include <Protocol/EfiShellEnvironment2.h>\r
-#include <Protocol/EfiShellParameters.h>\r
+#include <Protocol/ShellParameters.h>\r
 #include <Protocol/BlockIo.h>\r
 #include <Protocol/HiiPackageList.h>\r
 \r
@@ -64,8 +57,8 @@ extern CONST CHAR16 mNoNestingFalse[];
 \r
 typedef struct {\r
   LIST_ENTRY        Link;           ///< Standard linked list handler.\r
-  SHELL_FILE_HANDLE *SplitStdOut;   ///< ConsoleOut for use in the split.\r
-  SHELL_FILE_HANDLE *SplitStdIn;    ///< ConsoleIn for use in the split.\r
+  SHELL_FILE_HANDLE SplitStdOut;    ///< ConsoleOut for use in the split.\r
+  SHELL_FILE_HANDLE SplitStdIn;     ///< ConsoleIn for use in the split.\r
 } SPLIT_LIST;\r
 \r
 typedef struct {\r
@@ -142,7 +135,7 @@ typedef struct {
 extern SHELL_INFO ShellInfoObject;\r
 \r
 /**\r
-  Converts the command line to it's post-processed form.  this replaces variables and alias' per UEFI Shell spec.\r
+  Converts the command line to its post-processed form.  this replaces variables and alias' per UEFI Shell spec.\r
 \r
   @param[in,out] CmdLine        pointer to the command line to update\r
 \r
@@ -151,7 +144,6 @@ extern SHELL_INFO ShellInfoObject;
   @return                       some other error occurred\r
 **/\r
 EFI_STATUS\r
-EFIAPI\r
 ProcessCommandLineToFinal(\r
   IN OUT CHAR16 **CmdLine\r
   );\r
@@ -162,7 +154,6 @@ ProcessCommandLineToFinal(
   @param[in] ErrorCode      the error code to put into lasterror\r
 **/\r
 EFI_STATUS\r
-EFIAPI\r
 SetLastError(\r
   IN CONST SHELL_STATUS   ErrorCode\r
   );\r
@@ -173,7 +164,6 @@ SetLastError(
   @retval EFI_SUCCESS           all init commands were run successfully.\r
 **/\r
 EFI_STATUS\r
-EFIAPI\r
 SetBuiltInAlias(\r
   VOID\r
   );\r
@@ -193,7 +183,6 @@ SetBuiltInAlias(
   @sa HandleProtocol\r
 **/\r
 EFI_STATUS\r
-EFIAPI\r
 GetDevicePathsForImageAndFile (\r
   IN OUT EFI_DEVICE_PATH_PROTOCOL **DevPath,\r
   IN OUT EFI_DEVICE_PATH_PROTOCOL **FilePath\r
@@ -227,7 +216,6 @@ GetDevicePathsForImageAndFile (
   @retval EFI_SUCCESS           the variable is initialized.\r
 **/\r
 EFI_STATUS\r
-EFIAPI\r
 ProcessCommandLine(\r
   VOID\r
   );\r
@@ -243,7 +231,6 @@ ProcessCommandLine(
   @retval EFI_SUCCESS           The variable is initialized.\r
 **/\r
 EFI_STATUS\r
-EFIAPI\r
 DoStartupScript(\r
   IN EFI_DEVICE_PATH_PROTOCOL *ImagePath,\r
   IN EFI_DEVICE_PATH_PROTOCOL *FilePath\r
@@ -258,7 +245,6 @@ DoStartupScript(
   @retval RETURN_ABORTED\r
 **/\r
 EFI_STATUS\r
-EFIAPI\r
 DoShellPrompt (\r
   VOID\r
   );\r
@@ -270,7 +256,6 @@ DoShellPrompt (
   @param Buffer   Something to pass to FreePool when the shell is exiting.\r
 **/\r
 VOID*\r
-EFIAPI\r
 AddBufferToFreeList(\r
   VOID *Buffer\r
   );\r
@@ -281,7 +266,6 @@ AddBufferToFreeList(
   @param Buffer[in]     The line buffer to add.\r
 **/\r
 VOID\r
-EFIAPI\r
 AddLineToCommandHistory(\r
   IN CONST CHAR16 *Buffer\r
   );\r
@@ -297,7 +281,6 @@ AddLineToCommandHistory(
   @retval EFI_ABORTED     the command's operation was aborted\r
 **/\r
 EFI_STATUS\r
-EFIAPI\r
 RunCommand(\r
   IN CONST CHAR16   *CmdLine\r
   );\r
@@ -305,7 +288,7 @@ RunCommand(
 /**\r
   Function will process and run a command line.\r
 \r
-  This will determine if the command line represents an internal shell \r
+  This will determine if the command line represents an internal shell\r
   command or dispatch an external application.\r
 \r
   @param[in] CmdLine      The command line to parse.\r
@@ -315,26 +298,11 @@ RunCommand(
   @retval EFI_ABORTED     The command's operation was aborted.\r
 **/\r
 EFI_STATUS\r
-EFIAPI\r
 RunShellCommand(\r
   IN CONST CHAR16   *CmdLine,\r
   OUT EFI_STATUS    *CommandStatus\r
   );\r
 \r
-/**\r
-  Function determines if the CommandName COULD be a valid command.  It does not determine whether\r
-  this is a valid command.  It only checks for invalid characters.\r
-\r
-  @param[in] CommandName    The name to check\r
-\r
-  @retval TRUE              CommandName could be a command name\r
-  @retval FALSE             CommandName could not be a valid command name\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-IsValidCommandName(\r
-  IN CONST CHAR16     *CommandName\r
-  );\r
 \r
 /**\r
   Function to process a NSH script file via SHELL_FILE_HANDLE.\r
@@ -345,7 +313,6 @@ IsValidCommandName(
   @retval EFI_SUCCESS           the script completed successfully\r
 **/\r
 EFI_STATUS\r
-EFIAPI\r
 RunScriptFileHandle (\r
   IN SHELL_FILE_HANDLE  Handle,\r
   IN CONST CHAR16       *Name\r
@@ -362,7 +329,6 @@ RunScriptFileHandle (
   @retval EFI_SUCCESS           the script completed successfully\r
 **/\r
 EFI_STATUS\r
-EFIAPI\r
 RunScriptFile (\r
   IN CONST CHAR16                   *ScriptPath,\r
   IN SHELL_FILE_HANDLE              Handle OPTIONAL,\r
@@ -370,20 +336,36 @@ RunScriptFile (
   IN EFI_SHELL_PARAMETERS_PROTOCOL  *ParamProtocol\r
   );\r
 \r
+/**\r
+  Return the pointer to the first occurrence of any character from a list of characters.\r
+\r
+  @param[in] String           the string to parse\r
+  @param[in] CharacterList    the list of character to look for\r
+  @param[in] EscapeCharacter  An escape character to skip\r
+\r
+  @return the location of the first character in the string\r
+  @retval CHAR_NULL no instance of any character in CharacterList was found in String\r
+**/\r
+CONST CHAR16*\r
+FindFirstCharacter(\r
+  IN CONST CHAR16 *String,\r
+  IN CONST CHAR16 *CharacterList,\r
+  IN CONST CHAR16 EscapeCharacter\r
+  );\r
+\r
 /**\r
   Cleans off leading and trailing spaces and tabs.\r
 \r
   @param[in] String pointer to the string to trim them off.\r
 **/\r
 EFI_STATUS\r
-EFIAPI\r
 TrimSpaces(\r
   IN CHAR16 **String\r
   );\r
 \r
 /**\r
-  \r
-  Create a new buffer list and stores the old one to OldBufferList  \r
+\r
+  Create a new buffer list and stores the old one to OldBufferList\r
 \r
   @param OldBufferList   The temporary list head used to store the nodes in BufferToFreeList.\r
 **/\r