]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Application/Shell/Shell.h
Fix ECC errors:1.Update the comments in function headers to follow the Doxygen specia...
[mirror_edk2.git] / ShellPkg / Application / Shell / Shell.h
index d01b1260750e86f10babc7c4cfec2ef6b59d8a82..d0de1e4ffbce5e8f48e06442f51b46ba529e2cdf 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   function definitions for internal to shell functions.\r
 \r
-  Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2013, 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
@@ -19,6 +19,7 @@
 #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
@@ -45,6 +46,7 @@
 #include <Library/PrintLib.h>\r
 #include <Library/HandleParsingLib.h>\r
 #include <Library/PathLib.h>\r
+#include <Library/FileHandleLib.h>\r
 \r
 #include "ShellParametersProtocol.h"\r
 #include "ShellProtocol.h"\r
@@ -52,6 +54,7 @@
 #include "ConsoleLogger.h"\r
 #include "ShellManParser.h"\r
 #include "ConsoleWrappers.h"\r
+#include "FileHandleWrappers.h"\r
 \r
 typedef struct {\r
   LIST_ENTRY        Link;           ///< Standard linked list handler.\r
@@ -68,7 +71,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  Reserved:8;     ///< Extra bits\r
+  UINT32  Exit:1;         ///< Was "-_exit"          found on command line\r
+  UINT32  Reserved:7;     ///< Extra bits\r
 } SHELL_BITS;\r
 \r
 typedef union {\r
@@ -107,19 +111,53 @@ typedef struct {
   EFI_SHELL_PARAMETERS_PROTOCOL *OldShellParameters;  ///< old shell parameters to reinstall upon exiting.\r
   SHELL_PROTOCOL_HANDLE_LIST    OldShellList;         ///< List of other instances to reinstall when closing.\r
   SPLIT_LIST                    SplitList;            ///< List of Splits in FILO stack.\r
-  EFI_HANDLE                    CtrlCNotifyHandle1;   ///< The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify.\r
-  EFI_HANDLE                    CtrlCNotifyHandle2;   ///< The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify.\r
-  EFI_HANDLE                    CtrlCNotifyHandle3;   ///< The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify.\r
-  EFI_HANDLE                    CtrlCNotifyHandle4;   ///< The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify.\r
-  EFI_HANDLE                    CtrlSNotifyHandle1;   ///< The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify.\r
-  EFI_HANDLE                    CtrlSNotifyHandle2;   ///< The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify.\r
-  EFI_HANDLE                    CtrlSNotifyHandle3;   ///< The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify.\r
-  EFI_HANDLE                    CtrlSNotifyHandle4;   ///< The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify.\r
+  VOID                          *CtrlCNotifyHandle1;  ///< The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify.\r
+  VOID                          *CtrlCNotifyHandle2;  ///< The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify.\r
+  VOID                          *CtrlCNotifyHandle3;  ///< The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify.\r
+  VOID                          *CtrlCNotifyHandle4;  ///< The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify.\r
+  VOID                          *CtrlSNotifyHandle1;  ///< The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify.\r
+  VOID                          *CtrlSNotifyHandle2;  ///< The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify.\r
+  VOID                          *CtrlSNotifyHandle3;  ///< The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify.\r
+  VOID                          *CtrlSNotifyHandle4;  ///< The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify.\r
   BOOLEAN                       HaltOutput;           ///< TRUE to start a CTRL-S halt.\r
 } SHELL_INFO;\r
 \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
+  @param[in,out] CmdLine        pointer to the command line to update\r
+\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
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+ProcessCommandLineToFinal(\r
+  IN OUT CHAR16 **CmdLine\r
+  );\r
+\r
+/**\r
+  Function to update the shell variable "lasterror".\r
+\r
+  @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
+\r
 /**\r
   Sets all the alias' that were registered with the ShellCommandLib library.\r
 \r