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 <Protocol/EfiShell.h>
30 #include <Protocol/EfiShellParameters.h>
31 #include <Protocol/DevicePath.h>
32 #include <Protocol/LoadedImage.h>
33 #include <Protocol/UnicodeCollation.h>
34 #include <Protocol/DevicePathToText.h>
36 #include <Library/BaseLib.h>
37 #include <Library/BaseMemoryLib.h>
38 #include <Library/DebugLib.h>
39 #include <Library/MemoryAllocationLib.h>
40 #include <Library/PcdLib.h>
41 #include <Library/ShellCommandLib.h>
42 #include <Library/ShellLib.h>
43 #include <Library/UefiLib.h>
44 #include <Library/UefiRuntimeServicesTableLib.h>
45 #include <Library/UefiBootServicesTableLib.h>
46 #include <Library/HiiLib.h>
47 #include <Library/SortLib.h>
48 #include <Library/FileHandleLib.h>
50 extern CONST CHAR16 mFileName
[];
51 extern EFI_HANDLE gShellLevel2HiiHandle
;
52 extern CONST EFI_GUID gShellLevel2HiiGuid
;
55 Function for 'attrib' command.
57 @param[in] ImageHandle Handle to the Image (NULL if Internal).
58 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
62 ShellCommandRunAttrib (
63 IN EFI_HANDLE ImageHandle
,
64 IN EFI_SYSTEM_TABLE
*SystemTable
68 Function for 'date' command.
70 @param[in] ImageHandle Handle to the Image (NULL if Internal).
71 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
76 IN EFI_HANDLE ImageHandle
,
77 IN EFI_SYSTEM_TABLE
*SystemTable
81 Function for 'time' command.
83 @param[in] ImageHandle Handle to the Image (NULL if Internal).
84 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
89 IN EFI_HANDLE ImageHandle
,
90 IN EFI_SYSTEM_TABLE
*SystemTable
94 Function for 'load' command.
96 @param[in] ImageHandle Handle to the Image (NULL if Internal).
97 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
101 ShellCommandRunLoad (
102 IN EFI_HANDLE ImageHandle
,
103 IN EFI_SYSTEM_TABLE
*SystemTable
107 Function for 'ls' command.
109 @param[in] ImageHandle Handle to the Image (NULL if Internal).
110 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
115 IN EFI_HANDLE ImageHandle
,
116 IN EFI_SYSTEM_TABLE
*SystemTable
120 Function for 'map' command.
122 @param[in] ImageHandle Handle to the Image (NULL if Internal).
123 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
128 IN EFI_HANDLE ImageHandle
,
129 IN EFI_SYSTEM_TABLE
*SystemTable
133 Function for 'reset' command.
135 @param[in] ImageHandle Handle to the Image (NULL if Internal).
136 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
140 ShellCommandRunReset (
141 IN EFI_HANDLE ImageHandle
,
142 IN EFI_SYSTEM_TABLE
*SystemTable
146 Function for 'timezone' command.
148 @param[in] ImageHandle Handle to the Image (NULL if Internal).
149 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
153 ShellCommandRunTimeZone (
154 IN EFI_HANDLE ImageHandle
,
155 IN EFI_SYSTEM_TABLE
*SystemTable
159 Function for 'set' command.
161 @param[in] ImageHandle Handle to the Image (NULL if Internal).
162 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
167 IN EFI_HANDLE ImageHandle
,
168 IN EFI_SYSTEM_TABLE
*SystemTable
172 Function for 'mkdir' command.
174 @param[in] ImageHandle Handle to the Image (NULL if Internal).
175 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
179 ShellCommandRunMkDir (
180 IN EFI_HANDLE ImageHandle
,
181 IN EFI_SYSTEM_TABLE
*SystemTable
185 Function for 'cd' command.
187 @param[in] ImageHandle Handle to the Image (NULL if Internal).
188 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
193 IN EFI_HANDLE ImageHandle
,
194 IN EFI_SYSTEM_TABLE
*SystemTable
198 Function for 'cp' command.
200 @param[in] ImageHandle Handle to the Image (NULL if Internal).
201 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
206 IN EFI_HANDLE ImageHandle
,
207 IN EFI_SYSTEM_TABLE
*SystemTable
211 Function for 'parse' command.
213 @param[in] ImageHandle Handle to the Image (NULL if Internal).
214 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
218 ShellCommandRunParse (
219 IN EFI_HANDLE ImageHandle
,
220 IN EFI_SYSTEM_TABLE
*SystemTable
224 Function for 'rm' command.
226 @param[in] ImageHandle Handle to the Image (NULL if Internal).
227 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
232 IN EFI_HANDLE ImageHandle
,
233 IN EFI_SYSTEM_TABLE
*SystemTable
237 Function for 'mv' command.
239 @param[in] ImageHandle Handle to the Image (NULL if Internal).
240 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
245 IN EFI_HANDLE ImageHandle
,
246 IN EFI_SYSTEM_TABLE
*SystemTable
250 returns a fully qualified directory (contains a map drive at the begining)
251 path from a unknown directory path.
253 If Path is already fully qualified this will return a duplicat otherwise this
254 will use get the current directory and use that to build the fully qualified
257 if the return value is not NULL it must be caller freed.
259 @param[in] Path The unknown Path Value
261 @retval NULL A memory allocation failed
262 @retval NULL a fully qualified path could not be discovered.
263 @retval other pointer to a fuly qualified path.
267 GetFullyQualifiedPath(
268 IN CONST CHAR16
* Path
272 Function to verify all intermediate directories in the path.
274 @param[in] Path The pointer to the path to fix.
276 @retval EFI_SUCCESS The operation was successful.
280 VerifyIntermediateDirectories (
281 IN CONST CHAR16
*Path
285 CaseInsensitive length limited string comparison.
287 @param[in] Source Pointer to first string.
288 @param[in] Target Pointer to second string.
289 @param[in] Count Number of characters to compare.
291 @retval 0 The strings are the same.
292 @return non-zero if the strings are different.
297 IN CONST CHAR16
*Source
,
298 IN CONST CHAR16
*Target
,
303 Function for 'Vol' command.
305 @param[in] ImageHandle Handle to the Image (NULL if Internal).
306 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
311 IN EFI_HANDLE ImageHandle
,
312 IN EFI_SYSTEM_TABLE
*SystemTable