xref: /netbsd-src/sys/external/bsd/gnu-efi/dist/inc/efishellintf.h (revision d1b935f8e85510a16a1b49122bd2ccf5ad7e104c)
1 /*	$NetBSD: efishellintf.h,v 1.1.1.1 2018/08/16 18:17:47 jmcneill Exp $	*/
2 
3 /** @file
4   SHELL_INTERFACE_PROTOCOL from EDK shell (no spec).
5 
6   Shell Interface - additional information (over image_info) provided
7   to an application started by the shell.
8 
9   ConIo provides a file-style interface to the console.
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 - 2010, Intel Corporation. All rights reserved.<BR>
16   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  * This is based on ShellPkg/Include/Protocol/EfiShellInterface.h from EDK II.
27  */
28 
29 #ifndef _SHELLINTERFACE_H_
30 #define _SHELLINTERFACE_H_
31 
32 
33 #define SHELL_INTERFACE_PROTOCOL_GUID \
34   { \
35     0x47c7b223, 0xc42a, 0x11d2, {0x8e, 0x57, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} \
36   }
37 
38 ///
39 /// Bit definitions for EFI_SHELL_ARG_INFO
40 ///
41 typedef enum {
42   ARG_NO_ATTRIB         = 0x0,
43   ARG_IS_QUOTED         = 1<<0,
44   ARG_PARTIALLY_QUOTED  = 1<<1,
45   ARG_FIRST_HALF_QUOTED = 1<<2,
46   ARG_FIRST_CHAR_IS_ESC = 1<<3
47 } EFI_SHELL_ARG_INFO_TYPES;
48 
49 ///
50 /// Attributes for an argument.
51 ///
52 typedef struct _EFI_SHELL_ARG_INFO {
53   UINT32  Attributes;
54 } EFI_SHELL_ARG_INFO;
55 
56 ///
57 /// This protocol provides access to additional information about a shell application.
58 ///
59 typedef struct {
60   ///
61   /// Handle back to original image handle & image information.
62   ///
63   EFI_HANDLE                ImageHandle;
64   EFI_LOADED_IMAGE *Info;
65 
66   ///
67   /// Parsed arg list converted more C-like format.
68   ///
69   CHAR16                    **Argv;
70   UINTN                     Argc;
71 
72   ///
73   /// Storage for file redirection args after parsing.
74   ///
75   CHAR16                    **RedirArgv;
76   UINTN                     RedirArgc;
77 
78   ///
79   /// A file style handle for console io.
80   ///
81   EFI_FILE         *StdIn;
82   EFI_FILE         *StdOut;
83   EFI_FILE         *StdErr;
84 
85   ///
86   /// List of attributes for each argument.
87   ///
88   EFI_SHELL_ARG_INFO        *ArgInfo;
89 
90   ///
91   /// Whether we are echoing.
92   ///
93   BOOLEAN                   EchoOn;
94 } EFI_SHELL_INTERFACE;
95 
96 #endif
97