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