]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Include/Protocol/EfiShellDynamicCommand.h
ShellPkg: Add new dynamic command protocol
[mirror_edk2.git] / ShellPkg / Include / Protocol / EfiShellDynamicCommand.h
diff --git a/ShellPkg/Include/Protocol/EfiShellDynamicCommand.h b/ShellPkg/Include/Protocol/EfiShellDynamicCommand.h
new file mode 100644 (file)
index 0000000..713f5df
--- /dev/null
@@ -0,0 +1,86 @@
+/** @file\r
+  EFI Shell Dynamic Command registration protocol\r
+\r
+  Copyright (c) 2012 Hewlett-Packard Company. 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
+\r
+**/\r
+\r
+#ifndef __EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL__\r
+#define __EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL__\r
+\r
+#include <ShellBase.h>\r
+#include <Protocol/EfiShellParameters.h>\r
+#include <Protocol/EfiShell.h>\r
+\r
+\r
+// {0CD3258C-D677-4fcc-B343-934D30983888}\r
+#define EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL_GUID \\r
+  { \\r
+  0xcd3258c, 0xd677, 0x4fcc, { 0xb3, 0x43, 0x93, 0x4d, 0x30, 0x98, 0x38, 0x88 } \\r
+  }\r
+\r
+\r
+//\r
+// Define for forward reference.\r
+//\r
+typedef struct _EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL;\r
+\r
+\r
+/**\r
+  This is the shell command handler function pointer callback type.  This\r
+  function handles the command when it is invoked in the shell.\r
+\r
+  @param[in] This                   The instance of the EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL.\r
+  @param[in] SystemTable            The pointer to the system table.\r
+  @param[in] ShellParameters        The parameters associated with the command.\r
+  @param[in] Shell                  The instance of the shell protocol used in the context\r
+                                    of processing this command.\r
+\r
+  @return EFI_SUCCESS               the operation was sucessful\r
+  @return other                     the operation failed.\r
+**/\r
+typedef\r
+SHELL_STATUS\r
+(EFIAPI * SHELL_COMMAND_HANDLER)(\r
+  IN EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL    *This,\r
+  IN EFI_SYSTEM_TABLE                      *SystemTable,\r
+  IN EFI_SHELL_PARAMETERS_PROTOCOL         *ShellParameters,\r
+  IN EFI_SHELL_PROTOCOL                    *Shell\r
+  );\r
+\r
+/**\r
+  This is the command help handler function pointer callback type.  This\r
+  function is responsible for displaying help information for the associated\r
+  command.\r
+\r
+  @param[in] This                   The instance of the EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL.\r
+  @param[in] Language               The pointer to the language string to use.\r
+\r
+  @return string                    Pool allocated help string, must be freed by caller\r
+**/\r
+typedef\r
+CHAR16*\r
+(EFIAPI * SHELL_COMMAND_GETHELP)(\r
+  IN EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL    *This,\r
+  IN CONST CHAR8                           *Language\r
+  );\r
+\r
+/// EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL protocol structure.\r
+typedef struct _EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL {\r
+  \r
+  CONST CHAR16           *CommandName;\r
+  SHELL_COMMAND_HANDLER  Handler;\r
+  SHELL_COMMAND_GETHELP  GetHelp;\r
+\r
+} EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL;\r
+\r
+extern EFI_GUID gEfiShellDynamicCommandProtocolGuid;\r
+\r
+#endif\r