fixed to build under IPF.
[mirror_edk2.git] / ShellPkg / Include / Protocol / EfiShellInterface.h
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. Note that the
8 ConOut & ConIn interfaces in the system table will work as well, and both
9 all will be redirected to a file if needed on a command line
10
11 The shell interface's and data (including ConIo) are only valid during
12 the applications Entry Point. Once the application returns from it's
13 entry point the data is freed by the invoking shell.
14
15 Copyright (c) 2006 - 2009, Intel Corporation
16 All rights reserved. This program and the accompanying materials
17 are licensed and made available under the terms and conditions of the BSD License
18 which accompanies this distribution. The full text of the license may be found at
19 http://opensource.org/licenses/bsd-license.php
20
21 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
22 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
23
24 **/
25
26 #ifndef _SHELLINTERFACE_H_
27 #define _SHELLINTERFACE_H_
28
29 #include <Protocol\LoadedImage.h>
30
31 #define SHELL_INTERFACE_PROTOCOL_GUID \
32 { \
33 0x47c7b223, 0xc42a, 0x11d2, 0x8e, 0x57, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b \
34 }
35
36 ///
37 /// bit definitions for EFI_SHELL_ARG_INFO
38 ///
39 typedef enum {
40 ARG_NO_ATTRIB = 0x0,
41 ARG_IS_QUOTED = 0x1,
42 ARG_PARTIALLY_QUOTED = 0x2,
43 ARG_FIRST_HALF_QUOTED = 0x4,
44 ARG_FIRST_CHAR_IS_ESC = 0x8
45 };
46
47 ///
48 /// attributes for an argument.
49 ///
50 typedef struct _EFI_SHELL_ARG_INFO {
51 UINT32 Attributes;
52 } EFI_SHELL_ARG_INFO;
53
54 ///
55 /// This protocol provides access to additional information about a shell app.
56 ///
57 typedef struct {
58 ///
59 /// Handle back to original image handle & image info
60 ///
61 EFI_HANDLE ImageHandle;
62 EFI_LOADED_IMAGE_PROTOCOL *Info;
63
64 ///
65 /// Parsed arg list converted more C like format
66 ///
67 CHAR16 **Argv;
68 UINTN Argc;
69
70 ///
71 /// Storage for file redirection args after parsing
72 ///
73 CHAR16 **RedirArgv;
74 UINTN RedirArgc;
75
76 ///
77 /// A file style handle for console io
78 ///
79 EFI_FILE_HANDLE StdIn;
80 EFI_FILE_HANDLE StdOut;
81 EFI_FILE_HANDLE StdErr;
82
83 ///
84 /// list of attributes for each argument
85 ///
86 EFI_SHELL_ARG_INFO *ArgInfo;
87
88 ///
89 /// whether we are echoing
90 ///
91 BOOLEAN EchoOn;
92 } EFI_SHELL_INTERFACE;
93
94 extern EFI_GUID gEfiShellInterfaceGuid;
95
96 #endif