]>
Commit | Line | Data |
---|---|---|
a405b86d | 1 | /** @file\r |
2 | Main file for NULL named library for level 1 shell command functions.\r | |
3 | \r | |
28165f24 | 4 | Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>\r |
a405b86d | 5 | This program and the accompanying materials\r |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
13 | **/\r | |
14 | \r | |
a1d4bfcc | 15 | #ifndef _UEFI_SHELL_LEVEL1_COMMANDS_LIB_H_\r |
77dcec12 | 16 | #define _UEFI_SHELL_LEVEL1_COMMANDS_LIB_H_\r |
17 | \r | |
a405b86d | 18 | #include <Uefi.h>\r |
a405b86d | 19 | \r |
bca163ff LG |
20 | #include <Guid/ShellLibHiiGuid.h>\r |
21 | \r | |
28165f24 RN |
22 | #include <Protocol/Shell.h>\r |
23 | #include <Protocol/ShellParameters.h>\r | |
a405b86d | 24 | #include <Protocol/DevicePath.h>\r |
25 | #include <Protocol/LoadedImage.h>\r | |
26 | #include <Protocol/UnicodeCollation.h>\r | |
a405b86d | 27 | \r |
28 | #include <Library/BaseLib.h>\r | |
29 | #include <Library/BaseMemoryLib.h>\r | |
30 | #include <Library/DebugLib.h>\r | |
31 | #include <Library/MemoryAllocationLib.h>\r | |
32 | #include <Library/PcdLib.h>\r | |
33 | #include <Library/ShellCommandLib.h>\r | |
34 | #include <Library/ShellLib.h>\r | |
35 | #include <Library/SortLib.h>\r | |
36 | #include <Library/UefiLib.h>\r | |
37 | #include <Library/UefiRuntimeServicesTableLib.h>\r | |
38 | #include <Library/UefiBootServicesTableLib.h>\r | |
39 | #include <Library/HiiLib.h>\r | |
40 | #include <Library/FileHandleLib.h>\r | |
41 | \r | |
42 | extern EFI_HANDLE gShellLevel1HiiHandle;\r | |
a405b86d | 43 | \r |
77dcec12 | 44 | /**\r |
45 | Function for 'stall' command.\r | |
46 | \r | |
47 | @param[in] ImageHandle Handle to the Image (NULL if Internal).\r | |
48 | @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r | |
49 | **/\r | |
50 | SHELL_STATUS\r | |
51 | EFIAPI\r | |
52 | ShellCommandRunStall (\r | |
53 | IN EFI_HANDLE ImageHandle,\r | |
54 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
55 | );\r | |
56 | \r | |
a405b86d | 57 | /**\r |
58 | Function for 'exit' command.\r | |
59 | \r | |
60 | @param[in] ImageHandle Handle to the Image (NULL if Internal).\r | |
61 | @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r | |
62 | **/\r | |
63 | SHELL_STATUS\r | |
64 | EFIAPI\r | |
65 | ShellCommandRunExit (\r | |
66 | IN EFI_HANDLE ImageHandle,\r | |
67 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
68 | );\r | |
69 | \r | |
70 | /**\r | |
71 | Function for 'endif' command.\r | |
72 | \r | |
73 | @param[in] ImageHandle Handle to the Image (NULL if Internal).\r | |
74 | @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r | |
75 | **/\r | |
76 | SHELL_STATUS\r | |
77 | EFIAPI\r | |
78 | ShellCommandRunEndIf (\r | |
79 | IN EFI_HANDLE ImageHandle,\r | |
80 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
81 | );\r | |
82 | \r | |
83 | /**\r | |
84 | Function for 'for' command.\r | |
85 | \r | |
86 | @param[in] ImageHandle Handle to the Image (NULL if Internal).\r | |
87 | @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r | |
88 | **/\r | |
89 | SHELL_STATUS\r | |
90 | EFIAPI\r | |
91 | ShellCommandRunFor (\r | |
92 | IN EFI_HANDLE ImageHandle,\r | |
93 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
94 | );\r | |
95 | \r | |
96 | /**\r | |
97 | Function for 'endfor' command.\r | |
98 | \r | |
99 | @param[in] ImageHandle Handle to the Image (NULL if Internal).\r | |
100 | @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r | |
101 | **/\r | |
102 | SHELL_STATUS\r | |
103 | EFIAPI\r | |
104 | ShellCommandRunEndFor (\r | |
105 | IN EFI_HANDLE ImageHandle,\r | |
106 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
107 | );\r | |
108 | \r | |
109 | /**\r | |
110 | Function for 'if' command.\r | |
111 | \r | |
112 | @param[in] ImageHandle Handle to the Image (NULL if Internal).\r | |
113 | @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r | |
114 | **/\r | |
115 | SHELL_STATUS\r | |
116 | EFIAPI\r | |
117 | ShellCommandRunIf (\r | |
118 | IN EFI_HANDLE ImageHandle,\r | |
119 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
120 | );\r | |
121 | \r | |
122 | /**\r | |
123 | Function for 'goto' command.\r | |
124 | \r | |
125 | @param[in] ImageHandle Handle to the Image (NULL if Internal).\r | |
126 | @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r | |
127 | **/\r | |
128 | SHELL_STATUS\r | |
129 | EFIAPI\r | |
130 | ShellCommandRunGoto (\r | |
131 | IN EFI_HANDLE ImageHandle,\r | |
132 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
133 | );\r | |
134 | \r | |
135 | /**\r | |
136 | Function for 'shift' command.\r | |
137 | \r | |
138 | @param[in] ImageHandle Handle to the Image (NULL if Internal).\r | |
139 | @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r | |
140 | **/\r | |
141 | SHELL_STATUS\r | |
142 | EFIAPI\r | |
143 | ShellCommandRunShift (\r | |
144 | IN EFI_HANDLE ImageHandle,\r | |
145 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
146 | );\r | |
147 | \r | |
148 | \r | |
149 | /**\r | |
150 | Function for 'else' command.\r | |
151 | \r | |
152 | @param[in] ImageHandle Handle to the Image (NULL if Internal).\r | |
153 | @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r | |
154 | **/\r | |
155 | SHELL_STATUS\r | |
156 | EFIAPI\r | |
157 | ShellCommandRunElse (\r | |
158 | IN EFI_HANDLE ImageHandle,\r | |
159 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
160 | );\r | |
161 | \r | |
162 | ///\r | |
163 | /// Function prototype for BOTH GetNextNode and GetPreviousNode...\r | |
164 | /// This is used to control the MoveToTag function direction...\r | |
165 | ///\r | |
166 | typedef\r | |
167 | LIST_ENTRY *\r | |
168 | (EFIAPI *LIST_MANIP_FUNC)(\r | |
169 | IN CONST LIST_ENTRY *List,\r | |
170 | IN CONST LIST_ENTRY *Node\r | |
171 | );\r | |
172 | \r | |
173 | /**\r | |
77dcec12 | 174 | Move the script pointer from 1 tag (line) to another.\r |
175 | \r | |
176 | It functions so that count starts at 1 and it increases or decreases when it\r | |
177 | hits the specified tags. when it hits zero the location has been found.\r | |
178 | \r | |
179 | DecrementerTag and IncrementerTag are used to get around for/endfor and \r | |
180 | similar paired types where the entire middle should be ignored.\r | |
181 | \r | |
182 | If label is used it will be used instead of the count.\r | |
183 | \r | |
4ff7e37b ED |
184 | @param[in] Function The function to use to enumerate through the \r |
185 | list. Normally GetNextNode or GetPreviousNode.\r | |
186 | @param[in] DecrementerTag The tag to decrement the count at.\r | |
187 | @param[in] IncrementerTag The tag to increment the count at.\r | |
188 | @param[in] Label A label to look for.\r | |
189 | @param[in, out] ScriptFile The pointer to the current script file structure.\r | |
190 | @param[in] MovePast TRUE makes function return 1 past the found \r | |
191 | location.\r | |
192 | @param[in] FindOnly TRUE to not change the ScriptFile.\r | |
193 | @param[in] WrapAroundScript TRUE to wrap end-to-begining or vise versa in \r | |
194 | searching.\r | |
a405b86d | 195 | **/\r |
196 | BOOLEAN\r | |
a405b86d | 197 | MoveToTag (\r |
198 | IN CONST LIST_MANIP_FUNC Function,\r | |
199 | IN CONST CHAR16 *DecrementerTag,\r | |
200 | IN CONST CHAR16 *IncrementerTag,\r | |
201 | IN CONST CHAR16 *Label OPTIONAL,\r | |
77dcec12 | 202 | IN OUT SCRIPT_FILE *ScriptFile,\r |
a405b86d | 203 | IN CONST BOOLEAN MovePast,\r |
204 | IN CONST BOOLEAN FindOnly,\r | |
205 | IN CONST BOOLEAN WrapAroundScript\r | |
206 | );\r | |
207 | \r | |
77dcec12 | 208 | #endif\r |
209 | \r |