]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Application/Shell/Shell.h
SecurityPkg: Add TPM PTP support in TCG2 SMM.
[mirror_edk2.git] / ShellPkg / Application / Shell / Shell.h
index 4fadab15e2ff4c4853ee39ff80cabba34335ac1f..351b94188eab9707834eed990f62c0eb4ab51cdf 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   function definitions for internal to shell functions.\r
 \r
-  (C) Copyright 2014, Hewlett-Packard Development Company, L.P.\r
+  (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>\r
   Copyright (c) 2009 - 2015, 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
@@ -124,14 +124,6 @@ typedef struct {
 \r
 extern SHELL_INFO ShellInfoObject;\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
   Converts the command line to it's post-processed form.  this replaces variables and alias' per UEFI Shell spec.\r
 \r
@@ -139,7 +131,7 @@ typedef enum {
 \r
   @retval EFI_SUCCESS           The operation was successful\r
   @retval EFI_OUT_OF_RESOURCES  A memory allocation failed.\r
-  @return                       some other error occured\r
+  @return                       some other error occurred\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -161,7 +153,7 @@ SetLastError(
 /**\r
   Sets all the alias' that were registered with the ShellCommandLib library.\r
 \r
-  @retval EFI_SUCCESS           all init commands were run sucessfully.\r
+  @retval EFI_SUCCESS           all init commands were run successfully.\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -175,10 +167,10 @@ SetBuiltInAlias(
   loaded image protocol installed on it.  the FilePath will point to the device path\r
   for the file that was loaded.\r
 \r
-  @param[in, out] DevPath       on a sucessful return the device path to the loaded image\r
-  @param[in, out] FilePath      on a sucessful return the device path to the file\r
+  @param[in, out] DevPath       on a successful return the device path to the loaded image\r
+  @param[in, out] FilePath      on a successful return the device path to the file\r
 \r
-  @retval EFI_SUCCESS           the 2 device paths were sucessfully returned.\r
+  @retval EFI_SUCCESS           the 2 device paths were successfully returned.\r
   @return other                 a error from gBS->HandleProtocol\r
 \r
   @sa HandleProtocol\r
@@ -294,7 +286,26 @@ RunCommand(
   );\r
 \r
 /**\r
-  Function determins if the CommandName COULD be a valid command.  It does not determine whether\r
+  Function will process and run a command line.\r
+\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
+  @param[out] CommandStatus   The status from the command line.\r
+\r
+  @retval EFI_SUCCESS     The command was completed.\r
+  @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
@@ -314,7 +325,7 @@ IsValidCommandName(
   @param[in] Handle             The handle to the already opened file.\r
   @param[in] Name               The name of the script file.\r
 \r
-  @retval EFI_SUCCESS           the script completed sucessfully\r
+  @retval EFI_SUCCESS           the script completed successfully\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -331,7 +342,7 @@ RunScriptFileHandle (
   @param[in] CmdLine            the command line to run.\r
   @param[in] ParamProtocol      the shell parameters protocol pointer\r
 \r
-  @retval EFI_SUCCESS           the script completed sucessfully\r
+  @retval EFI_SUCCESS           the script completed successfully\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -343,7 +354,7 @@ RunScriptFile (
   );\r
 \r
 /**\r
-  Return the pointer to the first occurance of any character from a list of characters\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
@@ -360,5 +371,39 @@ FindFirstCharacter(
   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
+  @param OldBufferList   The temporary list head used to store the nodes in BufferToFreeList.\r
+**/\r
+VOID\r
+SaveBufferList (\r
+  OUT LIST_ENTRY     *OldBufferList\r
+  );\r
+\r
+/**\r
+  Restore previous nodes into BufferToFreeList .\r
+\r
+  @param OldBufferList   The temporary list head used to store the nodes in BufferToFreeList.\r
+**/\r
+VOID\r
+RestoreBufferList (\r
+  IN OUT LIST_ENTRY     *OldBufferList\r
+  );\r
+\r
+\r
+\r
 #endif //_SHELL_INTERNAL_HEADER_\r
 \r