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 - 2011, 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>
36 #include <Protocol/DevicePathToText.h>
38 #include <Library/BaseLib.h>
39 #include <Library/BaseMemoryLib.h>
40 #include <Library/DebugLib.h>
41 #include <Library/MemoryAllocationLib.h>
42 #include <Library/PcdLib.h>
43 #include <Library/ShellCommandLib.h>
44 #include <Library/ShellLib.h>
45 #include <Library/UefiLib.h>
46 #include <Library/UefiRuntimeServicesTableLib.h>
47 #include <Library/UefiBootServicesTableLib.h>
48 #include <Library/HiiLib.h>
49 #include <Library/SortLib.h>
50 #include <Library/FileHandleLib.h>
51 #include <Library/PathLib.h>
53 extern CONST CHAR16 mFileName
[];
54 extern EFI_HANDLE gShellLevel2HiiHandle
;
57 Function for 'attrib' command.
59 @param[in] ImageHandle Handle to the Image (NULL if Internal).
60 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
64 ShellCommandRunAttrib (
65 IN EFI_HANDLE ImageHandle
,
66 IN EFI_SYSTEM_TABLE
*SystemTable
70 Function for 'date' command.
72 @param[in] ImageHandle Handle to the Image (NULL if Internal).
73 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
78 IN EFI_HANDLE ImageHandle
,
79 IN EFI_SYSTEM_TABLE
*SystemTable
83 Function for 'time' command.
85 @param[in] ImageHandle Handle to the Image (NULL if Internal).
86 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
91 IN EFI_HANDLE ImageHandle
,
92 IN EFI_SYSTEM_TABLE
*SystemTable
96 Function for 'load' command.
98 @param[in] ImageHandle Handle to the Image (NULL if Internal).
99 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
103 ShellCommandRunLoad (
104 IN EFI_HANDLE ImageHandle
,
105 IN EFI_SYSTEM_TABLE
*SystemTable
109 Function for 'ls' command.
111 @param[in] ImageHandle Handle to the Image (NULL if Internal).
112 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
117 IN EFI_HANDLE ImageHandle
,
118 IN EFI_SYSTEM_TABLE
*SystemTable
122 Function for 'map' command.
124 @param[in] ImageHandle Handle to the Image (NULL if Internal).
125 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
130 IN EFI_HANDLE ImageHandle
,
131 IN EFI_SYSTEM_TABLE
*SystemTable
135 Function for 'reset' command.
137 @param[in] ImageHandle Handle to the Image (NULL if Internal).
138 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
142 ShellCommandRunReset (
143 IN EFI_HANDLE ImageHandle
,
144 IN EFI_SYSTEM_TABLE
*SystemTable
148 Function for 'timezone' command.
150 @param[in] ImageHandle Handle to the Image (NULL if Internal).
151 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
155 ShellCommandRunTimeZone (
156 IN EFI_HANDLE ImageHandle
,
157 IN EFI_SYSTEM_TABLE
*SystemTable
161 Function for 'set' command.
163 @param[in] ImageHandle Handle to the Image (NULL if Internal).
164 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
169 IN EFI_HANDLE ImageHandle
,
170 IN EFI_SYSTEM_TABLE
*SystemTable
174 Function for 'mkdir' command.
176 @param[in] ImageHandle Handle to the Image (NULL if Internal).
177 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
181 ShellCommandRunMkDir (
182 IN EFI_HANDLE ImageHandle
,
183 IN EFI_SYSTEM_TABLE
*SystemTable
187 Function for 'cd' command.
189 @param[in] ImageHandle Handle to the Image (NULL if Internal).
190 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
195 IN EFI_HANDLE ImageHandle
,
196 IN EFI_SYSTEM_TABLE
*SystemTable
200 Function for 'cp' command.
202 @param[in] ImageHandle Handle to the Image (NULL if Internal).
203 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
208 IN EFI_HANDLE ImageHandle
,
209 IN EFI_SYSTEM_TABLE
*SystemTable
213 Function for 'parse' command.
215 @param[in] ImageHandle Handle to the Image (NULL if Internal).
216 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
220 ShellCommandRunParse (
221 IN EFI_HANDLE ImageHandle
,
222 IN EFI_SYSTEM_TABLE
*SystemTable
226 Function for 'rm' command.
228 @param[in] ImageHandle Handle to the Image (NULL if Internal).
229 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
234 IN EFI_HANDLE ImageHandle
,
235 IN EFI_SYSTEM_TABLE
*SystemTable
239 Function for 'mv' command.
241 @param[in] ImageHandle Handle to the Image (NULL if Internal).
242 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
247 IN EFI_HANDLE ImageHandle
,
248 IN EFI_SYSTEM_TABLE
*SystemTable
252 returns a fully qualified directory (contains a map drive at the begining)
253 path from a unknown directory path.
255 If Path is already fully qualified this will return a duplicat otherwise this
256 will use get the current directory and use that to build the fully qualified
259 if the return value is not NULL it must be caller freed.
261 @param[in] Path The unknown Path Value
263 @retval NULL A memory allocation failed
264 @retval NULL a fully qualified path could not be discovered.
265 @retval other pointer to a fuly qualified path.
269 GetFullyQualifiedPath(
270 IN CONST CHAR16
* Path
274 Function to verify all intermediate directories in the path.
276 @param[in] Path The pointer to the path to fix.
278 @retval EFI_SUCCESS The operation was successful.
282 VerifyIntermediateDirectories (
283 IN CONST CHAR16
*Path
287 CaseInsensitive length limited string comparison.
289 @param[in] Source Pointer to first string.
290 @param[in] Target Pointer to second string.
291 @param[in] Count Number of characters to compare.
293 @retval 0 The strings are the same.
294 @return non-zero if the strings are different.
299 IN CONST CHAR16
*Source
,
300 IN CONST CHAR16
*Target
,
305 Function for 'Vol' command.
307 @param[in] ImageHandle Handle to the Image (NULL if Internal).
308 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
313 IN EFI_HANDLE ImageHandle
,
314 IN EFI_SYSTEM_TABLE
*SystemTable