]> git.proxmox.com Git - mirror_edk2.git/blob - ShellPkg/Application/Shell/FileHandleWrappers.h
ShellPkg: Fix the bug that handling Ctrl-C improperly
[mirror_edk2.git] / ShellPkg / Application / Shell / FileHandleWrappers.h
1 /** @file
2 EFI_FILE_PROTOCOL wrappers for other items (Like Environment Variables, StdIn, StdOut, StdErr, etc...)
3
4 Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #ifndef _SHELL_FILE_HANDLE_WRAPPERS_HEADER_
16 #define _SHELL_FILE_HANDLE_WRAPPERS_HEADER_
17
18 typedef struct {
19 LIST_ENTRY Link;
20 CHAR16* Buffer;
21 } SHELL_LINE_LIST;
22
23 typedef struct {
24 UINTN LogCount;
25 SHELL_LINE_LIST *Log;
26 } SHELL_LINE_LOG;
27
28 ///
29 /// FILE sytle interfaces for StdIn.
30 ///
31 extern EFI_FILE_PROTOCOL FileInterfaceStdIn;
32
33 ///
34 /// FILE sytle interfaces for StdOut.
35 ///
36 extern EFI_FILE_PROTOCOL FileInterfaceStdOut;
37
38 ///
39 /// FILE sytle interfaces for StdErr.
40 ///
41 extern EFI_FILE_PROTOCOL FileInterfaceStdErr;
42
43 ///
44 /// FILE style interface for NUL file.
45 ///
46 extern EFI_FILE_PROTOCOL FileInterfaceNulFile;
47
48 /**
49 Creates a EFI_FILE_PROTOCOL (almost) object for using to access
50 environment variables through file operations.
51
52 @param EnvName The name of the Environment Variable to be operated on.
53
54 @retval NULL Memory could not be allocated.
55 @return other a pointer to an EFI_FILE_PROTOCOL structure
56 **/
57 EFI_FILE_PROTOCOL*
58 CreateFileInterfaceEnv(
59 CONST CHAR16 *EnvName
60 );
61
62 /**
63 Creates a EFI_FILE_PROTOCOL (almost) object for using to access
64 a file entirely in memory through file operations.
65
66 @param[in] Unicode TRUE if the data is UNICODE, FALSE otherwise.
67
68 @retval NULL Memory could not be allocated.
69 @return other a pointer to an EFI_FILE_PROTOCOL structure
70 **/
71 EFI_FILE_PROTOCOL*
72 CreateFileInterfaceMem(
73 IN CONST BOOLEAN Unicode
74 );
75
76 /**
77 Creates a EFI_FILE_PROTOCOL (almost) object for using to access
78 a file entirely with unicode awareness through file operations.
79
80 @param[in] Template The pointer to the handle to start with.
81 @param[in] Unicode TRUE if the data is UNICODE, FALSE otherwise.
82
83 @retval NULL Memory could not be allocated.
84 @return other a pointer to an EFI_FILE_PROTOCOL structure
85 **/
86 EFI_FILE_PROTOCOL*
87 CreateFileInterfaceFile(
88 IN CONST EFI_FILE_PROTOCOL *Template,
89 IN CONST BOOLEAN Unicode
90 );
91
92 #endif //_SHELL_FILE_HANDLE_WRAPPERS_HEADER_
93