VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.h@ 58459

Last change on this file since 58459 was 58459, checked in by vboxsync, 9 years ago

EFI/Firmware: 'svn merge /vendor/edk2/UDK2010.SR1 /vendor/edk2/current .', reverting and removing files+dirs listed in ReadMe.vbox, resolving conflicts with help from ../UDK2014.SP1/. This is a raw untested merge.

  • Property svn:eol-style set to native
File size: 8.2 KB
Line 
1/** @file
2 Main file for NULL named library for level 2 shell command functions.
3
4 these functions are:
5 attrib, cd, cp, date*, time*, rm, reset,
6 load, ls, map, mkdir, mv, parse, set, timezone*
7
8
9 * functions are non-interactive only
10
11
12 Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
13 This program and the accompanying materials
14 are licensed and made available under the terms and conditions of the BSD License
15 which accompanies this distribution. The full text of the license may be found at
16 http://opensource.org/licenses/bsd-license.php
17
18 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
19 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
20
21**/
22
23#ifndef _UEFI_SHELL_LEVEL2_COMMANDS_LIB_H_
24#define _UEFI_SHELL_LEVEL2_COMMANDS_LIB_H_
25
26#include <Uefi.h>
27#include <ShellBase.h>
28
29#include <Guid/ShellLibHiiGuid.h>
30
31#include <Protocol/EfiShell.h>
32#include <Protocol/EfiShellParameters.h>
33#include <Protocol/DevicePath.h>
34#include <Protocol/LoadedImage.h>
35#include <Protocol/UnicodeCollation.h>
36
37#include <Library/BaseLib.h>
38#include <Library/BaseMemoryLib.h>
39#include <Library/DebugLib.h>
40#include <Library/MemoryAllocationLib.h>
41#include <Library/PcdLib.h>
42#include <Library/ShellCommandLib.h>
43#include <Library/ShellLib.h>
44#include <Library/UefiLib.h>
45#include <Library/UefiRuntimeServicesTableLib.h>
46#include <Library/UefiBootServicesTableLib.h>
47#include <Library/HiiLib.h>
48#include <Library/SortLib.h>
49#include <Library/FileHandleLib.h>
50#include <Library/PathLib.h>
51
52extern CONST CHAR16 mFileName[];
53extern EFI_HANDLE gShellLevel2HiiHandle;
54
55/**
56 Function for 'attrib' command.
57
58 @param[in] ImageHandle Handle to the Image (NULL if Internal).
59 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
60**/
61SHELL_STATUS
62EFIAPI
63ShellCommandRunAttrib (
64 IN EFI_HANDLE ImageHandle,
65 IN EFI_SYSTEM_TABLE *SystemTable
66 );
67
68/**
69 Function for 'date' command.
70
71 @param[in] ImageHandle Handle to the Image (NULL if Internal).
72 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
73**/
74SHELL_STATUS
75EFIAPI
76ShellCommandRunDate (
77 IN EFI_HANDLE ImageHandle,
78 IN EFI_SYSTEM_TABLE *SystemTable
79 );
80
81/**
82 Function for 'time' command.
83
84 @param[in] ImageHandle Handle to the Image (NULL if Internal).
85 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
86**/
87SHELL_STATUS
88EFIAPI
89ShellCommandRunTime (
90 IN EFI_HANDLE ImageHandle,
91 IN EFI_SYSTEM_TABLE *SystemTable
92 );
93
94/**
95 Function for 'load' command.
96
97 @param[in] ImageHandle Handle to the Image (NULL if Internal).
98 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
99**/
100SHELL_STATUS
101EFIAPI
102ShellCommandRunLoad (
103 IN EFI_HANDLE ImageHandle,
104 IN EFI_SYSTEM_TABLE *SystemTable
105 );
106
107/**
108 Function for 'ls' command.
109
110 @param[in] ImageHandle Handle to the Image (NULL if Internal).
111 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
112**/
113SHELL_STATUS
114EFIAPI
115ShellCommandRunLs (
116 IN EFI_HANDLE ImageHandle,
117 IN EFI_SYSTEM_TABLE *SystemTable
118 );
119
120/**
121 Function for 'map' command.
122
123 @param[in] ImageHandle Handle to the Image (NULL if Internal).
124 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
125**/
126SHELL_STATUS
127EFIAPI
128ShellCommandRunMap (
129 IN EFI_HANDLE ImageHandle,
130 IN EFI_SYSTEM_TABLE *SystemTable
131 );
132
133/**
134 Function for 'reset' command.
135
136 @param[in] ImageHandle Handle to the Image (NULL if Internal).
137 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
138**/
139SHELL_STATUS
140EFIAPI
141ShellCommandRunReset (
142 IN EFI_HANDLE ImageHandle,
143 IN EFI_SYSTEM_TABLE *SystemTable
144 );
145
146/**
147 Function for 'timezone' command.
148
149 @param[in] ImageHandle Handle to the Image (NULL if Internal).
150 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
151**/
152SHELL_STATUS
153EFIAPI
154ShellCommandRunTimeZone (
155 IN EFI_HANDLE ImageHandle,
156 IN EFI_SYSTEM_TABLE *SystemTable
157 );
158
159/**
160 Function for 'set' command.
161
162 @param[in] ImageHandle Handle to the Image (NULL if Internal).
163 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
164**/
165SHELL_STATUS
166EFIAPI
167ShellCommandRunSet (
168 IN EFI_HANDLE ImageHandle,
169 IN EFI_SYSTEM_TABLE *SystemTable
170 );
171
172/**
173 Function for 'mkdir' command.
174
175 @param[in] ImageHandle Handle to the Image (NULL if Internal).
176 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
177**/
178SHELL_STATUS
179EFIAPI
180ShellCommandRunMkDir (
181 IN EFI_HANDLE ImageHandle,
182 IN EFI_SYSTEM_TABLE *SystemTable
183 );
184
185/**
186 Function for 'cd' command.
187
188 @param[in] ImageHandle Handle to the Image (NULL if Internal).
189 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
190**/
191SHELL_STATUS
192EFIAPI
193ShellCommandRunCd (
194 IN EFI_HANDLE ImageHandle,
195 IN EFI_SYSTEM_TABLE *SystemTable
196 );
197
198/**
199 Function for 'cp' command.
200
201 @param[in] ImageHandle Handle to the Image (NULL if Internal).
202 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
203**/
204SHELL_STATUS
205EFIAPI
206ShellCommandRunCp (
207 IN EFI_HANDLE ImageHandle,
208 IN EFI_SYSTEM_TABLE *SystemTable
209 );
210
211/**
212 Function for 'parse' command.
213
214 @param[in] ImageHandle Handle to the Image (NULL if Internal).
215 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
216**/
217SHELL_STATUS
218EFIAPI
219ShellCommandRunParse (
220 IN EFI_HANDLE ImageHandle,
221 IN EFI_SYSTEM_TABLE *SystemTable
222 );
223
224/**
225 Function for 'rm' command.
226
227 @param[in] ImageHandle Handle to the Image (NULL if Internal).
228 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
229**/
230SHELL_STATUS
231EFIAPI
232ShellCommandRunRm (
233 IN EFI_HANDLE ImageHandle,
234 IN EFI_SYSTEM_TABLE *SystemTable
235 );
236
237/**
238 Function for 'mv' command.
239
240 @param[in] ImageHandle Handle to the Image (NULL if Internal).
241 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
242**/
243SHELL_STATUS
244EFIAPI
245ShellCommandRunMv (
246 IN EFI_HANDLE ImageHandle,
247 IN EFI_SYSTEM_TABLE *SystemTable
248 );
249
250/**
251 returns a fully qualified directory (contains a map drive at the begining)
252 path from a unknown directory path.
253
254 If Path is already fully qualified this will return a duplicat otherwise this
255 will use get the current directory and use that to build the fully qualified
256 version.
257
258 if the return value is not NULL it must be caller freed.
259
260 @param[in] Path The unknown Path Value
261
262 @retval NULL A memory allocation failed
263 @retval NULL a fully qualified path could not be discovered.
264 @retval other pointer to a fuly qualified path.
265**/
266CHAR16*
267EFIAPI
268GetFullyQualifiedPath(
269 IN CONST CHAR16* Path
270 );
271
272/**
273 Function to verify all intermediate directories in the path.
274
275 @param[in] Path The pointer to the path to fix.
276
277 @retval EFI_SUCCESS The operation was successful.
278**/
279EFI_STATUS
280EFIAPI
281VerifyIntermediateDirectories (
282 IN CONST CHAR16 *Path
283 );
284
285/**
286 CaseInsensitive length limited string comparison.
287
288 @param[in] Source Pointer to first string.
289 @param[in] Target Pointer to second string.
290 @param[in] Count Number of characters to compare.
291
292 @retval 0 The strings are the same.
293 @return non-zero if the strings are different.
294**/
295CONST CHAR16*
296EFIAPI
297StrniCmp(
298 IN CONST CHAR16 *Source,
299 IN CONST CHAR16 *Target,
300 IN CONST UINTN Count
301 );
302
303/**
304 Cleans off all the quotes in the string.
305
306 @param[in] OriginalString pointer to the string to be cleaned.
307 @param[out] CleanString The new string with all quotes removed.
308 Memory allocated in the function and free
309 by caller.
310
311 @retval EFI_SUCCESS The operation was successful.
312**/
313EFI_STATUS
314EFIAPI
315ShellLevel2StripQuotes (
316 IN CONST CHAR16 *OriginalString,
317 OUT CHAR16 **CleanString
318 );
319
320/**
321 Function for 'Vol' command.
322
323 @param[in] ImageHandle Handle to the Image (NULL if Internal).
324 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
325**/
326SHELL_STATUS
327EFIAPI
328ShellCommandRunVol (
329 IN EFI_HANDLE ImageHandle,
330 IN EFI_SYSTEM_TABLE *SystemTable
331 );
332
333#endif
334
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette