xref: /DragonStub/inc/efishellintf.h (revision 530d68ba191850edafc6da22cb2df55bec0c5fa5)
1*530d68baSNigel Croxon /** @file
2*530d68baSNigel Croxon   SHELL_INTERFACE_PROTOCOL from EDK shell (no spec).
3*530d68baSNigel Croxon 
4*530d68baSNigel Croxon   Shell Interface - additional information (over image_info) provided
5*530d68baSNigel Croxon   to an application started by the shell.
6*530d68baSNigel Croxon 
7*530d68baSNigel Croxon   ConIo provides a file-style interface to the console.
8*530d68baSNigel Croxon 
9*530d68baSNigel Croxon   The shell interface's and data (including ConIo) are only valid during
10*530d68baSNigel Croxon   the applications Entry Point.  Once the application returns from it's
11*530d68baSNigel Croxon   entry point the data is freed by the invoking shell.
12*530d68baSNigel Croxon 
13*530d68baSNigel Croxon   Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
14*530d68baSNigel Croxon   This program and the accompanying materials
15*530d68baSNigel Croxon   are licensed and made available under the terms and conditions of the BSD License
16*530d68baSNigel Croxon   which accompanies this distribution.  The full text of the license may be found at
17*530d68baSNigel Croxon   http://opensource.org/licenses/bsd-license.php
18*530d68baSNigel Croxon 
19*530d68baSNigel Croxon   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
20*530d68baSNigel Croxon   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
21*530d68baSNigel Croxon 
22*530d68baSNigel Croxon **/
23*530d68baSNigel Croxon /*
24*530d68baSNigel Croxon  * This is based on ShellPkg/Include/Protocol/EfiShellInterface.h from EDK II.
25*530d68baSNigel Croxon  */
26*530d68baSNigel Croxon 
27*530d68baSNigel Croxon #ifndef _SHELLINTERFACE_H_
28*530d68baSNigel Croxon #define _SHELLINTERFACE_H_
29*530d68baSNigel Croxon 
30*530d68baSNigel Croxon 
31*530d68baSNigel Croxon #define SHELL_INTERFACE_PROTOCOL_GUID \
32*530d68baSNigel Croxon   { \
33*530d68baSNigel Croxon     0x47c7b223, 0xc42a, 0x11d2, {0x8e, 0x57, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} \
34*530d68baSNigel Croxon   }
35*530d68baSNigel Croxon 
36*530d68baSNigel Croxon ///
37*530d68baSNigel Croxon /// Bit definitions for EFI_SHELL_ARG_INFO
38*530d68baSNigel Croxon ///
39*530d68baSNigel Croxon typedef enum {
40*530d68baSNigel Croxon   ARG_NO_ATTRIB         = 0x0,
41*530d68baSNigel Croxon   ARG_IS_QUOTED         = 1<<0,
42*530d68baSNigel Croxon   ARG_PARTIALLY_QUOTED  = 1<<1,
43*530d68baSNigel Croxon   ARG_FIRST_HALF_QUOTED = 1<<2,
44*530d68baSNigel Croxon   ARG_FIRST_CHAR_IS_ESC = 1<<3
45*530d68baSNigel Croxon } EFI_SHELL_ARG_INFO_TYPES;
46*530d68baSNigel Croxon 
47*530d68baSNigel Croxon ///
48*530d68baSNigel Croxon /// Attributes for an argument.
49*530d68baSNigel Croxon ///
50*530d68baSNigel Croxon typedef struct _EFI_SHELL_ARG_INFO {
51*530d68baSNigel Croxon   UINT32  Attributes;
52*530d68baSNigel Croxon } EFI_SHELL_ARG_INFO;
53*530d68baSNigel Croxon 
54*530d68baSNigel Croxon ///
55*530d68baSNigel Croxon /// This protocol provides access to additional information about a shell application.
56*530d68baSNigel Croxon ///
57*530d68baSNigel Croxon typedef struct {
58*530d68baSNigel Croxon   ///
59*530d68baSNigel Croxon   /// Handle back to original image handle & image information.
60*530d68baSNigel Croxon   ///
61*530d68baSNigel Croxon   EFI_HANDLE                ImageHandle;
62*530d68baSNigel Croxon   EFI_LOADED_IMAGE *Info;
63*530d68baSNigel Croxon 
64*530d68baSNigel Croxon   ///
65*530d68baSNigel Croxon   /// Parsed arg list converted more C-like format.
66*530d68baSNigel Croxon   ///
67*530d68baSNigel Croxon   CHAR16                    **Argv;
68*530d68baSNigel Croxon   UINTN                     Argc;
69*530d68baSNigel Croxon 
70*530d68baSNigel Croxon   ///
71*530d68baSNigel Croxon   /// Storage for file redirection args after parsing.
72*530d68baSNigel Croxon   ///
73*530d68baSNigel Croxon   CHAR16                    **RedirArgv;
74*530d68baSNigel Croxon   UINTN                     RedirArgc;
75*530d68baSNigel Croxon 
76*530d68baSNigel Croxon   ///
77*530d68baSNigel Croxon   /// A file style handle for console io.
78*530d68baSNigel Croxon   ///
79*530d68baSNigel Croxon   EFI_FILE         *StdIn;
80*530d68baSNigel Croxon   EFI_FILE         *StdOut;
81*530d68baSNigel Croxon   EFI_FILE         *StdErr;
82*530d68baSNigel Croxon 
83*530d68baSNigel Croxon   ///
84*530d68baSNigel Croxon   /// List of attributes for each argument.
85*530d68baSNigel Croxon   ///
86*530d68baSNigel Croxon   EFI_SHELL_ARG_INFO        *ArgInfo;
87*530d68baSNigel Croxon 
88*530d68baSNigel Croxon   ///
89*530d68baSNigel Croxon   /// Whether we are echoing.
90*530d68baSNigel Croxon   ///
91*530d68baSNigel Croxon   BOOLEAN                   EchoOn;
92*530d68baSNigel Croxon } EFI_SHELL_INTERFACE;
93*530d68baSNigel Croxon 
94*530d68baSNigel Croxon #endif
95