2 Main file for NULL named library for level 2 shell command functions.
5 attrib, cd, cp, date*, time*, rm, reset,
6 load, ls, map, mkdir, mv, parse, set, timezone*
9 * functions are non-interactive only
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
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.
23 #ifndef _UEFI_SHELL_LEVEL2_COMMANDS_LIB_H_
24 #define _UEFI_SHELL_LEVEL2_COMMANDS_LIB_H_
27 #include <ShellBase.h>
29 #include <Guid/ShellLibHiiGuid.h>
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>
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>
52 extern CONST CHAR16 mFileName
[];
53 extern EFI_HANDLE gShellLevel2HiiHandle
;
56 Function for 'attrib' command.
58 @param[in] ImageHandle Handle to the Image (NULL if Internal).
59 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
63 ShellCommandRunAttrib (
64 IN EFI_HANDLE ImageHandle
,
65 IN EFI_SYSTEM_TABLE
*SystemTable
69 Function for 'date' command.
71 @param[in] ImageHandle Handle to the Image (NULL if Internal).
72 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
77 IN EFI_HANDLE ImageHandle
,
78 IN EFI_SYSTEM_TABLE
*SystemTable
82 Function for 'time' command.
84 @param[in] ImageHandle Handle to the Image (NULL if Internal).
85 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
90 IN EFI_HANDLE ImageHandle
,
91 IN EFI_SYSTEM_TABLE
*SystemTable
95 Function for 'load' command.
97 @param[in] ImageHandle Handle to the Image (NULL if Internal).
98 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
102 ShellCommandRunLoad (
103 IN EFI_HANDLE ImageHandle
,
104 IN EFI_SYSTEM_TABLE
*SystemTable
108 Function for 'ls' command.
110 @param[in] ImageHandle Handle to the Image (NULL if Internal).
111 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
116 IN EFI_HANDLE ImageHandle
,
117 IN EFI_SYSTEM_TABLE
*SystemTable
121 Function for 'map' command.
123 @param[in] ImageHandle Handle to the Image (NULL if Internal).
124 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
129 IN EFI_HANDLE ImageHandle
,
130 IN EFI_SYSTEM_TABLE
*SystemTable
134 Function for 'reset' command.
136 @param[in] ImageHandle Handle to the Image (NULL if Internal).
137 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
141 ShellCommandRunReset (
142 IN EFI_HANDLE ImageHandle
,
143 IN EFI_SYSTEM_TABLE
*SystemTable
147 Function for 'timezone' command.
149 @param[in] ImageHandle Handle to the Image (NULL if Internal).
150 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
154 ShellCommandRunTimeZone (
155 IN EFI_HANDLE ImageHandle
,
156 IN EFI_SYSTEM_TABLE
*SystemTable
160 Function for 'set' command.
162 @param[in] ImageHandle Handle to the Image (NULL if Internal).
163 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
168 IN EFI_HANDLE ImageHandle
,
169 IN EFI_SYSTEM_TABLE
*SystemTable
173 Function for 'mkdir' command.
175 @param[in] ImageHandle Handle to the Image (NULL if Internal).
176 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
180 ShellCommandRunMkDir (
181 IN EFI_HANDLE ImageHandle
,
182 IN EFI_SYSTEM_TABLE
*SystemTable
186 Function for 'cd' command.
188 @param[in] ImageHandle Handle to the Image (NULL if Internal).
189 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
194 IN EFI_HANDLE ImageHandle
,
195 IN EFI_SYSTEM_TABLE
*SystemTable
199 Function for 'cp' command.
201 @param[in] ImageHandle Handle to the Image (NULL if Internal).
202 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
207 IN EFI_HANDLE ImageHandle
,
208 IN EFI_SYSTEM_TABLE
*SystemTable
212 Function for 'parse' command.
214 @param[in] ImageHandle Handle to the Image (NULL if Internal).
215 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
219 ShellCommandRunParse (
220 IN EFI_HANDLE ImageHandle
,
221 IN EFI_SYSTEM_TABLE
*SystemTable
225 Function for 'rm' command.
227 @param[in] ImageHandle Handle to the Image (NULL if Internal).
228 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
233 IN EFI_HANDLE ImageHandle
,
234 IN EFI_SYSTEM_TABLE
*SystemTable
238 Function for 'mv' command.
240 @param[in] ImageHandle Handle to the Image (NULL if Internal).
241 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
246 IN EFI_HANDLE ImageHandle
,
247 IN EFI_SYSTEM_TABLE
*SystemTable
251 returns a fully qualified directory (contains a map drive at the begining)
252 path from a unknown directory path.
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
258 if the return value is not NULL it must be caller freed.
260 @param[in] Path The unknown Path Value
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.
268 GetFullyQualifiedPath(
269 IN CONST CHAR16
* Path
273 Function to verify all intermediate directories in the path.
275 @param[in] Path The pointer to the path to fix.
277 @retval EFI_SUCCESS The operation was successful.
281 VerifyIntermediateDirectories (
282 IN CONST CHAR16
*Path
286 CaseInsensitive length limited string comparison.
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.
292 @retval 0 The strings are the same.
293 @return non-zero if the strings are different.
298 IN CONST CHAR16
*Source
,
299 IN CONST CHAR16
*Target
,
304 Function for 'Vol' command.
306 @param[in] ImageHandle Handle to the Image (NULL if Internal).
307 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
312 IN EFI_HANDLE ImageHandle
,
313 IN EFI_SYSTEM_TABLE
*SystemTable