1 /** @file
2   EFI Shell Interface protocol from EDK shell (no spec).
3 
4   Shell Interface - additional information (over image_info) provided
5   to an application started by the shell.
6 
7   ConIo provides a file-style interface to the console.
8 
9   The shell interface's and data (including ConIo) are only valid during
10   the applications Entry Point.  Once the application returns from it's
11   entry point the data is freed by the invoking shell.
12 
13   Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
14   SPDX-License-Identifier: BSD-2-Clause-Patent
15 
16 **/
17 
18 #ifndef _SHELLINTERFACE_H_
19 #define _SHELLINTERFACE_H_
20 
21 #include <Protocol/SimpleFileSystem.h>
22 
23 #define SHELL_INTERFACE_PROTOCOL_GUID \
24   { \
25     0x47c7b223, 0xc42a, 0x11d2, {0x8e, 0x57, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} \
26   }
27 
28 ///
29 /// Bit definitions for EFI_SHELL_ARG_INFO
30 ///
31 typedef enum {
32   ARG_NO_ATTRIB         = 0x0,
33   ARG_IS_QUOTED         = BIT0,
34   ARG_PARTIALLY_QUOTED  = BIT1,
35   ARG_FIRST_HALF_QUOTED = BIT2,
36   ARG_FIRST_CHAR_IS_ESC = BIT3
37 } EFI_SHELL_ARG_INFO_TYPES;
38 
39 ///
40 /// Attributes for an argument.
41 ///
42 typedef struct _EFI_SHELL_ARG_INFO {
43   UINT32  Attributes;
44 } EFI_SHELL_ARG_INFO;
45 
46 ///
47 /// This protocol provides access to additional information about a shell application.
48 ///
49 typedef struct {
50   ///
51   /// Handle back to original image handle & image information.
52   ///
53   EFI_HANDLE                ImageHandle;
54   EFI_LOADED_IMAGE_PROTOCOL *Info;
55 
56   ///
57   /// Parsed arg list converted more C-like format.
58   ///
59   CHAR16                    **Argv;
60   UINTN                     Argc;
61 
62   ///
63   /// Storage for file redirection args after parsing.
64   ///
65   CHAR16                    **RedirArgv;
66   UINTN                     RedirArgc;
67 
68   ///
69   /// A file style handle for console io.
70   ///
71   EFI_FILE_PROTOCOL         *StdIn;
72   EFI_FILE_PROTOCOL         *StdOut;
73   EFI_FILE_PROTOCOL         *StdErr;
74 
75   ///
76   /// List of attributes for each argument.
77   ///
78   EFI_SHELL_ARG_INFO        *ArgInfo;
79 
80   ///
81   /// Whether we are echoing.
82   ///
83   BOOLEAN                   EchoOn;
84 } EFI_SHELL_INTERFACE;
85 
86 extern EFI_GUID gEfiShellInterfaceGuid;
87 
88 #endif
89