blob: 58ae0b8447605ccd0af8f3466124e38392c6e89f [file] [log] [blame]
Subrata Banik20fe24b2021-12-09 02:46:38 +05301/** @file
2 EFI Shell Dynamic Command registration protocol
3
4 (C) Copyright 2012-2014 Hewlett-Packard Development Company, L.P.<BR>
5 Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7
8**/
9
10#ifndef __EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL_H__
11#define __EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL_H__
12
13#include <Protocol/Shell.h>
14#include <Protocol/ShellParameters.h>
15
16// {3C7200E9-005F-4EA4-87DE-A3DFAC8A27C3}
17#define EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL_GUID \
18 { \
19 0x3c7200e9, 0x005f, 0x4ea4, { 0x87, 0xde, 0xa3, 0xdf, 0xac, 0x8a, 0x27, 0xc3 } \
20 }
21
22
23//
24// Define for forward reference.
25//
26typedef struct _EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL;
27
28
29/**
30 This is the shell command handler function pointer callback type. This
31 function handles the command when it is invoked in the shell.
32
33 @param[in] This The instance of the EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL.
34 @param[in] SystemTable The pointer to the system table.
35 @param[in] ShellParameters The parameters associated with the command.
36 @param[in] Shell The instance of the shell protocol used in the context
37 of processing this command.
38
39 @return EFI_SUCCESS the operation was sucessful
40 @return other the operation failed.
41**/
42typedef
43SHELL_STATUS
44(EFIAPI * SHELL_COMMAND_HANDLER)(
45 IN EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL *This,
46 IN EFI_SYSTEM_TABLE *SystemTable,
47 IN EFI_SHELL_PARAMETERS_PROTOCOL *ShellParameters,
48 IN EFI_SHELL_PROTOCOL *Shell
49 );
50
51/**
52 This is the command help handler function pointer callback type. This
53 function is responsible for displaying help information for the associated
54 command.
55
56 @param[in] This The instance of the EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL.
57 @param[in] Language The pointer to the language string to use.
58
59 @return string Pool allocated help string, must be freed by caller
60**/
61typedef
62CHAR16*
63(EFIAPI * SHELL_COMMAND_GETHELP)(
64 IN EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL *This,
65 IN CONST CHAR8 *Language
66 );
67
68/// EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL protocol structure.
69struct _EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL {
70
71 CONST CHAR16 *CommandName;
72 SHELL_COMMAND_HANDLER Handler;
73 SHELL_COMMAND_GETHELP GetHelp;
74
75};
76
77extern EFI_GUID gEfiShellDynamicCommandProtocolGuid;
78
79#endif