]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Include/Protocol/EfiShellInterface.h
First (Alpha) release of ShellPkg
[mirror_edk2.git] / ShellPkg / Include / Protocol / EfiShellInterface.h
diff --git a/ShellPkg/Include/Protocol/EfiShellInterface.h b/ShellPkg/Include/Protocol/EfiShellInterface.h
new file mode 100644 (file)
index 0000000..bc15b4b
--- /dev/null
@@ -0,0 +1,96 @@
+/** @file\r
+  EFI Shell Interface protocol from EDK shell (no spec).\r
+\r
+  Shell Interface - additional information (over image_info) provided\r
+  to an application started by the shell.\r
+\r
+  ConIo - provides a file style interface to the console.  Note that the\r
+  ConOut & ConIn interfaces in the system table will work as well, and both\r
+  all will be redirected to a file if needed on a command line\r
+\r
+  The shell interface's and data (including ConIo) are only valid during\r
+  the applications Entry Point.  Once the application returns from it's\r
+  entry point the data is freed by the invoking shell.\r
+  \r
+  Copyright (c) 2006 - 2009, Intel Corporation                                                         \r
+  All rights reserved. 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
+\r
+**/\r
+\r
+#ifndef _SHELLINTERFACE_H_\r
+#define _SHELLINTERFACE_H_\r
+\r
+#include <Protocol\LoadedImage.h>\r
+\r
+#define SHELL_INTERFACE_PROTOCOL_GUID \\r
+  { \\r
+    0x47c7b223, 0xc42a, 0x11d2, 0x8e, 0x57, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b \\r
+  }\r
+\r
+///\r
+/// bit definitions for EFI_SHELL_ARG_INFO\r
+///\r
+typedef enum {\r
+  ARG_NO_ATTRIB         = 0x0,\r
+  ARG_IS_QUOTED         = 0x1,\r
+  ARG_PARTIALLY_QUOTED  = 0x2,\r
+  ARG_FIRST_HALF_QUOTED = 0x4,\r
+  ARG_FIRST_CHAR_IS_ESC = 0x8\r
+};\r
+\r
+///\r
+/// attributes for an argument.\r
+///\r
+typedef struct _EFI_SHELL_ARG_INFO {\r
+  UINT32  Attributes;\r
+} EFI_SHELL_ARG_INFO;\r
+\r
+///\r
+/// This protocol provides access to additional information about a shell app.\r
+///\r
+typedef struct {\r
+  ///\r
+  /// Handle back to original image handle & image info\r
+  ///\r
+  EFI_HANDLE                ImageHandle;\r
+  EFI_LOADED_IMAGE_PROTOCOL *Info;\r
+\r
+  ///\r
+  /// Parsed arg list converted more C like format\r
+  ///\r
+  CHAR16                    **Argv;\r
+  UINTN                     Argc;\r
+\r
+  ///\r
+  /// Storage for file redirection args after parsing\r
+  ///\r
+  CHAR16                    **RedirArgv;\r
+  UINTN                     RedirArgc;\r
+\r
+  ///\r
+  /// A file style handle for console io\r
+  ///\r
+  EFI_FILE_HANDLE           StdIn;\r
+  EFI_FILE_HANDLE           StdOut;\r
+  EFI_FILE_HANDLE           StdErr;\r
+\r
+  ///\r
+  /// list of attributes for each argument\r
+  ///\r
+  EFI_SHELL_ARG_INFO        *ArgInfo;\r
+\r
+  ///\r
+  /// whether we are echoing\r
+  ///\r
+  BOOLEAN                   EchoOn;\r
+} EFI_SHELL_INTERFACE;\r
+\r
+extern EFI_GUID gEfiShellInterfaceGuid;\r
+\r
+#endif\r