]>
Commit | Line | Data |
---|---|---|
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 | |
b54fd049 | 23 | #if !defined (_UEFI_SHELL_LEVEL2_COMMANDS_LIB_H_)\r |
24 | #define _UEFI_SHELL_LEVEL2_COMMANDS_LIB_H_\r | |
25 | \r | |
a405b86d | 26 | #include <Uefi.h>\r |
27 | #include <ShellBase.h>\r | |
28 | \r | |
29 | #include <Protocol/EfiShell.h>\r | |
30 | #include <Protocol/EfiShellParameters.h>\r | |
31 | #include <Protocol/DevicePath.h>\r | |
32 | #include <Protocol/LoadedImage.h>\r | |
33 | #include <Protocol/UnicodeCollation.h>\r | |
34 | #include <Protocol/DevicePathToText.h>\r | |
35 | \r | |
36 | #include <Library/BaseLib.h>\r | |
37 | #include <Library/BaseMemoryLib.h>\r | |
38 | #include <Library/DebugLib.h>\r | |
39 | #include <Library/MemoryAllocationLib.h>\r | |
40 | #include <Library/PcdLib.h>\r | |
41 | #include <Library/ShellCommandLib.h>\r | |
42 | #include <Library/ShellLib.h>\r | |
43 | #include <Library/UefiLib.h>\r | |
44 | #include <Library/UefiRuntimeServicesTableLib.h>\r | |
45 | #include <Library/UefiBootServicesTableLib.h>\r | |
46 | #include <Library/HiiLib.h>\r | |
47 | #include <Library/SortLib.h>\r | |
48 | #include <Library/FileHandleLib.h>\r | |
49 | \r | |
50 | extern CONST CHAR16 mFileName[];\r | |
51 | extern EFI_HANDLE gShellLevel2HiiHandle;\r | |
52 | extern CONST EFI_GUID gShellLevel2HiiGuid;\r | |
53 | \r | |
54 | /**\r | |
55 | Function for 'attrib' command.\r | |
56 | \r | |
57 | @param[in] ImageHandle Handle to the Image (NULL if Internal).\r | |
58 | @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r | |
59 | **/\r | |
60 | SHELL_STATUS\r | |
61 | EFIAPI\r | |
62 | ShellCommandRunAttrib (\r | |
63 | IN EFI_HANDLE ImageHandle,\r | |
64 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
65 | );\r | |
66 | \r | |
67 | /**\r | |
68 | Function for 'date' command.\r | |
69 | \r | |
70 | @param[in] ImageHandle Handle to the Image (NULL if Internal).\r | |
71 | @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r | |
72 | **/\r | |
73 | SHELL_STATUS\r | |
74 | EFIAPI\r | |
75 | ShellCommandRunDate (\r | |
76 | IN EFI_HANDLE ImageHandle,\r | |
77 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
78 | );\r | |
79 | \r | |
80 | /**\r | |
81 | Function for 'time' command.\r | |
82 | \r | |
83 | @param[in] ImageHandle Handle to the Image (NULL if Internal).\r | |
84 | @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r | |
85 | **/\r | |
86 | SHELL_STATUS\r | |
87 | EFIAPI\r | |
88 | ShellCommandRunTime (\r | |
89 | IN EFI_HANDLE ImageHandle,\r | |
90 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
91 | );\r | |
92 | \r | |
93 | /**\r | |
94 | Function for 'load' command.\r | |
95 | \r | |
96 | @param[in] ImageHandle Handle to the Image (NULL if Internal).\r | |
97 | @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r | |
98 | **/\r | |
99 | SHELL_STATUS\r | |
100 | EFIAPI\r | |
101 | ShellCommandRunLoad (\r | |
102 | IN EFI_HANDLE ImageHandle,\r | |
103 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
104 | );\r | |
105 | \r | |
106 | /**\r | |
107 | Function for 'ls' command.\r | |
108 | \r | |
109 | @param[in] ImageHandle Handle to the Image (NULL if Internal).\r | |
110 | @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r | |
111 | **/\r | |
112 | SHELL_STATUS\r | |
113 | EFIAPI\r | |
114 | ShellCommandRunLs (\r | |
115 | IN EFI_HANDLE ImageHandle,\r | |
116 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
117 | );\r | |
118 | \r | |
119 | /**\r | |
120 | Function for 'map' command.\r | |
121 | \r | |
122 | @param[in] ImageHandle Handle to the Image (NULL if Internal).\r | |
123 | @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r | |
124 | **/\r | |
125 | SHELL_STATUS\r | |
126 | EFIAPI\r | |
127 | ShellCommandRunMap (\r | |
128 | IN EFI_HANDLE ImageHandle,\r | |
129 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
130 | );\r | |
131 | \r | |
132 | /**\r | |
133 | Function for 'reset' command.\r | |
134 | \r | |
135 | @param[in] ImageHandle Handle to the Image (NULL if Internal).\r | |
136 | @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r | |
137 | **/\r | |
138 | SHELL_STATUS\r | |
139 | EFIAPI\r | |
140 | ShellCommandRunReset (\r | |
141 | IN EFI_HANDLE ImageHandle,\r | |
142 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
143 | );\r | |
144 | \r | |
145 | /**\r | |
146 | Function for 'timezone' command.\r | |
147 | \r | |
148 | @param[in] ImageHandle Handle to the Image (NULL if Internal).\r | |
149 | @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r | |
150 | **/\r | |
151 | SHELL_STATUS\r | |
152 | EFIAPI\r | |
153 | ShellCommandRunTimeZone (\r | |
154 | IN EFI_HANDLE ImageHandle,\r | |
155 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
156 | );\r | |
157 | \r | |
158 | /**\r | |
159 | Function for 'set' command.\r | |
160 | \r | |
161 | @param[in] ImageHandle Handle to the Image (NULL if Internal).\r | |
162 | @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r | |
163 | **/\r | |
164 | SHELL_STATUS\r | |
165 | EFIAPI\r | |
166 | ShellCommandRunSet (\r | |
167 | IN EFI_HANDLE ImageHandle,\r | |
168 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
169 | );\r | |
170 | \r | |
171 | /**\r | |
172 | Function for 'mkdir' command.\r | |
173 | \r | |
174 | @param[in] ImageHandle Handle to the Image (NULL if Internal).\r | |
175 | @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r | |
176 | **/\r | |
177 | SHELL_STATUS\r | |
178 | EFIAPI\r | |
179 | ShellCommandRunMkDir (\r | |
180 | IN EFI_HANDLE ImageHandle,\r | |
181 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
182 | );\r | |
183 | \r | |
184 | /**\r | |
185 | Function for 'cd' command.\r | |
186 | \r | |
187 | @param[in] ImageHandle Handle to the Image (NULL if Internal).\r | |
188 | @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r | |
189 | **/\r | |
190 | SHELL_STATUS\r | |
191 | EFIAPI\r | |
192 | ShellCommandRunCd (\r | |
193 | IN EFI_HANDLE ImageHandle,\r | |
194 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
195 | );\r | |
196 | \r | |
197 | /**\r | |
198 | Function for 'cp' command.\r | |
199 | \r | |
200 | @param[in] ImageHandle Handle to the Image (NULL if Internal).\r | |
201 | @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r | |
202 | **/\r | |
203 | SHELL_STATUS\r | |
204 | EFIAPI\r | |
205 | ShellCommandRunCp (\r | |
206 | IN EFI_HANDLE ImageHandle,\r | |
207 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
208 | );\r | |
209 | \r | |
210 | /**\r | |
211 | Function for 'parse' command.\r | |
212 | \r | |
213 | @param[in] ImageHandle Handle to the Image (NULL if Internal).\r | |
214 | @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r | |
215 | **/\r | |
216 | SHELL_STATUS\r | |
217 | EFIAPI\r | |
218 | ShellCommandRunParse (\r | |
219 | IN EFI_HANDLE ImageHandle,\r | |
220 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
221 | );\r | |
222 | \r | |
223 | /**\r | |
224 | Function for 'rm' command.\r | |
225 | \r | |
226 | @param[in] ImageHandle Handle to the Image (NULL if Internal).\r | |
227 | @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r | |
228 | **/\r | |
229 | SHELL_STATUS\r | |
230 | EFIAPI\r | |
231 | ShellCommandRunRm (\r | |
232 | IN EFI_HANDLE ImageHandle,\r | |
233 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
234 | );\r | |
235 | \r | |
236 | /**\r | |
237 | Function for 'mv' command.\r | |
238 | \r | |
239 | @param[in] ImageHandle Handle to the Image (NULL if Internal).\r | |
240 | @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r | |
241 | **/\r | |
242 | SHELL_STATUS\r | |
243 | EFIAPI\r | |
244 | ShellCommandRunMv (\r | |
245 | IN EFI_HANDLE ImageHandle,\r | |
246 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
247 | );\r | |
248 | \r | |
249 | /**\r | |
250 | returns a fully qualified directory (contains a map drive at the begining)\r | |
251 | path from a unknown directory path.\r | |
252 | \r | |
253 | If Path is already fully qualified this will return a duplicat otherwise this\r | |
254 | will use get the current directory and use that to build the fully qualified\r | |
255 | version.\r | |
256 | \r | |
257 | if the return value is not NULL it must be caller freed.\r | |
258 | \r | |
259 | @param[in] Path The unknown Path Value\r | |
260 | \r | |
261 | @retval NULL A memory allocation failed\r | |
262 | @retval NULL a fully qualified path could not be discovered.\r | |
263 | @retval other pointer to a fuly qualified path.\r | |
264 | **/\r | |
265 | CHAR16*\r | |
266 | EFIAPI\r | |
267 | GetFullyQualifiedPath(\r | |
268 | IN CONST CHAR16* Path\r | |
269 | );\r | |
270 | \r | |
271 | /**\r | |
272 | Function to verify all intermediate directories in the path.\r | |
273 | \r | |
274 | @param[in] Path The pointer to the path to fix.\r | |
275 | \r | |
276 | @retval EFI_SUCCESS The operation was successful.\r | |
277 | **/\r | |
278 | EFI_STATUS\r | |
279 | EFIAPI\r | |
280 | VerifyIntermediateDirectories (\r | |
281 | IN CONST CHAR16 *Path\r | |
282 | );\r | |
283 | \r | |
284 | /**\r | |
285 | CaseInsensitive length limited string comparison.\r | |
286 | \r | |
287 | @param[in] Source Pointer to first string.\r | |
288 | @param[in] Target Pointer to second string.\r | |
289 | @param[in] Count Number of characters to compare.\r | |
290 | \r | |
291 | @retval 0 The strings are the same.\r | |
292 | @return non-zero if the strings are different.\r | |
293 | **/\r | |
294 | CONST CHAR16*\r | |
295 | EFIAPI\r | |
296 | StrniCmp(\r | |
297 | IN CONST CHAR16 *Source,\r | |
298 | IN CONST CHAR16 *Target,\r | |
299 | IN CONST UINTN Count\r | |
300 | );\r | |
b54fd049 | 301 | \r |
302 | /**\r | |
303 | Function for 'Vol' command.\r | |
304 | \r | |
305 | @param[in] ImageHandle Handle to the Image (NULL if Internal).\r | |
306 | @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r | |
307 | **/\r | |
308 | SHELL_STATUS\r | |
309 | EFIAPI\r | |
310 | ShellCommandRunVol (\r | |
311 | IN EFI_HANDLE ImageHandle,\r | |
312 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
313 | );\r | |
314 | \r | |
315 | #endif\r | |
316 | \r |