]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Application/Shell/Shell.h
ShellPkg: Unregister hotkey callback when exiting Shell
[mirror_edk2.git] / ShellPkg / Application / Shell / Shell.h
index 4d804fc45bb3add38c2d60e960be26f677434602..a34c91ad1e5d73018477b3e31b9a82a0b137f4b6 100644 (file)
@@ -2,7 +2,7 @@
   function definitions for internal to shell functions.\r
 \r
   (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>\r
-  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<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
@@ -29,6 +29,7 @@
 #include <Protocol/EfiShellEnvironment2.h>\r
 #include <Protocol/EfiShellParameters.h>\r
 #include <Protocol/BlockIo.h>\r
+#include <Protocol/HiiPackageList.h>\r
 \r
 #include <Library/BaseLib.h>\r
 #include <Library/UefiApplicationEntryPoint.h>\r
@@ -47,6 +48,7 @@
 #include <Library/PrintLib.h>\r
 #include <Library/HandleParsingLib.h>\r
 #include <Library/FileHandleLib.h>\r
+#include <Library/UefiHiiServicesLib.h>\r
 \r
 #include "ShellParametersProtocol.h"\r
 #include "ShellProtocol.h"\r
 #include "ConsoleWrappers.h"\r
 #include "FileHandleWrappers.h"\r
 \r
+extern CONST CHAR16 mNoNestingEnvVarName[];\r
+extern CONST CHAR16 mNoNestingTrue[];\r
+extern CONST CHAR16 mNoNestingFalse[];\r
+\r
 typedef struct {\r
   LIST_ENTRY        Link;           ///< Standard linked list handler.\r
   SHELL_FILE_HANDLE *SplitStdOut;   ///< ConsoleOut for use in the split.\r
@@ -71,7 +77,8 @@ typedef struct {
   UINT32  NoMap:1;        ///< Was "-nomap"         found on command line.\r
   UINT32  NoVersion:1;    ///< Was "-noversion"     found on command line.\r
   UINT32  Delay:1;        ///< Was "-delay[:n]      found on command line\r
-  UINT32  Exit:1;         ///< Was "-_exit"          found on command line\r
+  UINT32  Exit:1;         ///< Was "-_exit"         found on command line\r
+  UINT32  NoNest:1;       ///< Was "-nonest"        found on command line\r
   UINT32  Reserved:7;     ///< Extra bits\r
 } SHELL_BITS;\r
 \r
@@ -122,15 +129,17 @@ typedef struct {
   BOOLEAN                       HaltOutput;           ///< TRUE to start a CTRL-S halt.\r
 } SHELL_INFO;\r
 \r
-extern SHELL_INFO ShellInfoObject;\r
+#pragma pack(1)\r
+///\r
+/// HII specific Vendor Device Path definition.\r
+///\r
+typedef struct {\r
+  VENDOR_DEVICE_PATH             VendorDevicePath;\r
+  EFI_DEVICE_PATH_PROTOCOL       End;\r
+} SHELL_MAN_HII_VENDOR_DEVICE_PATH;\r
+#pragma pack()\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
+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
@@ -293,6 +302,25 @@ RunCommand(
   IN CONST CHAR16   *CmdLine\r
   );\r
 \r
+/**\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
@@ -343,22 +371,38 @@ RunScriptFile (
   );\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
+  Cleans off leading and trailing spaces and tabs.\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
+  @param[in] String pointer to the string to trim them off.\r
 **/\r
-CONST CHAR16*\r
+EFI_STATUS\r
 EFIAPI\r
-FindFirstCharacter(\r
-  IN CONST CHAR16 *String,\r
-  IN CONST CHAR16 *CharacterList,\r
-  IN CONST CHAR16 EscapeCharacter\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