]> git.proxmox.com Git - mirror_edk2.git/blame - ShellPkg/Include/Library/ShellCommandLib.h
ShellPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / ShellPkg / Include / Library / ShellCommandLib.h
CommitLineData
a405b86d 1/** @file\r
2 Provides interface to shell internal functions for shell commands.\r
3\r
4 This library is for use ONLY by shell commands linked into the shell application.\r
268d3445 5 This library will not function if it is used for UEFI Shell 2.0 Applications.\r
a405b86d 6\r
ba0014b9 7 Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
b464d7ed
RN
8 (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
9 (C) Copyright 2013-2014 Hewlett-Packard Development Company, L.P.<BR>\r
56ba3746 10 SPDX-License-Identifier: BSD-2-Clause-Patent\r
a405b86d 11\r
12**/\r
13\r
14#ifndef _SHELL_COMMAND_LIB_\r
15#define _SHELL_COMMAND_LIB_\r
16\r
17#include <Uefi.h>\r
a405b86d 18\r
28165f24
RN
19#include <Protocol/Shell.h>\r
20#include <Protocol/ShellParameters.h>\r
a405b86d 21#include <Protocol/UnicodeCollation.h>\r
a405b86d 22#include <Protocol/SimpleFileSystem.h>\r
23\r
24#include <Library/UefiBootServicesTableLib.h>\r
25\r
26//\r
27// The extern global protocol poionters.\r
28//\r
a405b86d 29extern EFI_UNICODE_COLLATION_PROTOCOL *gUnicodeCollation;\r
a405b86d 30extern CONST CHAR16* SupportLevel[];\r
31\r
32//\r
33// The map list objects.\r
34//\r
35typedef struct {\r
36 LIST_ENTRY Link;\r
37 EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
38 CHAR16 *MapName;\r
39 CHAR16 *CurrentDirectoryPath;\r
40 UINT64 Flags;\r
41} SHELL_MAP_LIST;\r
42/// List of Mappings - DeviceName and Drive Letter(ism).\r
43extern SHELL_MAP_LIST gShellMapList;\r
44/// Pointer to node of current directory in the mMapList.\r
9cf45187 45extern SHELL_MAP_LIST *gShellCurMapping;\r
a405b86d 46\r
47/**\r
48 Returns the help MAN fileName for a given shell command.\r
49\r
50 @retval !NULL The unicode string of the MAN filename.\r
51 @retval NULL An error ocurred.\r
52\r
53**/\r
54typedef\r
55CONST CHAR16 *\r
56(EFIAPI *SHELL_GET_MAN_FILENAME)(\r
57 VOID\r
58 );\r
59\r
60/**\r
61 Runs a shell command on a given command line.\r
62\r
63 The specific operation of a given shell command is specified in the UEFI Shell\r
64 Specification 2.0, or in the source of the given command.\r
65\r
66 Upon completion of the command run the shell protocol and environment variables\r
67 may have been updated due to the operation.\r
68\r
69 @param[in] ImageHandle The ImageHandle to the app, or NULL if\r
70 the command built into shell.\r
71 @param[in] SystemTable The pointer to the system table.\r
72\r
73 @retval RETURN_SUCCESS The shell command was sucessful.\r
74 @retval RETURN_UNSUPPORTED The command is not supported.\r
75**/\r
76typedef\r
77SHELL_STATUS\r
78(EFIAPI *SHELL_RUN_COMMAND)(\r
79 IN EFI_HANDLE ImageHandle,\r
80 IN EFI_SYSTEM_TABLE *SystemTable\r
81 );\r
82\r
83/**\r
84 Registers the handlers of type SHELL_RUN_COMMAND and\r
85 SHELL_GET_MAN_FILENAME for each shell command.\r
86\r
87 If the ShellSupportLevel is greater than the value of\r
88 PcdShellSupportLevel, then return RETURN_UNSUPPORTED.\r
89\r
90 Registers the the handlers specified by GetHelpInfoHandler and CommandHandler\r
91 with the command specified by CommandString. If the command named by\r
92 CommandString has already been registered, then return\r
93 RETURN_ALREADY_STARTED.\r
94\r
95 If there are not enough resources available to register the handlers, then\r
96 RETURN_OUT_OF_RESOURCES is returned.\r
97\r
98 If CommandString is NULL, then ASSERT().\r
99 If GetHelpInfoHandler is NULL, then ASSERT().\r
100 If CommandHandler is NULL, then ASSERT().\r
101 If ProfileName is NULL, then ASSERT().\r
102\r
103 @param[in] CommandString The pointer to the command name. This is the\r
104 name to look for on the command line in\r
105 the shell.\r
106 @param[in] CommandHandler The pointer to a function that runs the\r
107 specified command.\r
108 @param[in] GetManFileName The pointer to a function that provides man\r
109 filename.\r
110 @param[in] ShellMinSupportLevel The minimum Shell Support Level which has this\r
111 function.\r
112 @param[in] ProfileName The profile name to require for support of this\r
113 function.\r
114 @param[in] CanAffectLE Indicates whether this command's return value\r
115 can change the LASTERROR environment variable.\r
116 @param[in] HiiHandle The handle of this command's HII entry.\r
117 @param[in] ManFormatHelp The HII locator for the help text.\r
118\r
119 @retval RETURN_SUCCESS The handlers were registered.\r
120 @retval RETURN_OUT_OF_RESOURCES There are not enough resources available to\r
121 register the shell command.\r
122 @retval RETURN_UNSUPPORTED The ShellMinSupportLevel was higher than the\r
123 currently allowed support level.\r
124 @retval RETURN_ALREADY_STARTED The CommandString represents a command that\r
125 is already registered. Only one handler set for\r
126 a given command is allowed.\r
127 @sa SHELL_GET_MAN_FILENAME\r
128 @sa SHELL_RUN_COMMAND\r
129**/\r
130RETURN_STATUS\r
131EFIAPI\r
132ShellCommandRegisterCommandName (\r
133 IN CONST CHAR16 *CommandString,\r
134 IN SHELL_RUN_COMMAND CommandHandler,\r
135 IN SHELL_GET_MAN_FILENAME GetManFileName,\r
136 IN UINT32 ShellMinSupportLevel,\r
137 IN CONST CHAR16 *ProfileName,\r
138 IN CONST BOOLEAN CanAffectLE,\r
139 IN CONST EFI_HANDLE HiiHandle,\r
140 IN CONST EFI_STRING_ID ManFormatHelp\r
141 );\r
142\r
143/**\r
144 Checks if a command string has been registered for CommandString, and if so, it runs\r
145 the previously registered handler for that command with the command line.\r
146\r
147 If CommandString is NULL, then ASSERT().\r
148\r
149 If Sections is specified, then each section name listed will be compared in a case sensitive\r
150 manner to the section names described in Appendix B UEFI Shell 2.0 Specification. If the section exists,\r
151 it is appended to the returned help text. If the section does not exist, no\r
152 information is returned. If Sections is NULL, then all help text information\r
153 available is returned.\r
154\r
4ff7e37b
ED
155 @param[in] CommandString The pointer to the command name. This is the name\r
156 found on the command line in the shell.\r
157 @param[in, out] RetVal The pointer to the return value from the command handler.\r
a405b86d 158\r
4ff7e37b
ED
159 @param[in, out] CanAffectLE Indicates whether this command's return value\r
160 needs to be placed into LASTERROR environment variable.\r
a405b86d 161\r
162 @retval RETURN_SUCCESS The handler was run.\r
163 @retval RETURN_NOT_FOUND The CommandString did not match a registered\r
164 command name.\r
165 @sa SHELL_RUN_COMMAND\r
166**/\r
167RETURN_STATUS\r
168EFIAPI\r
169ShellCommandRunCommandHandler (\r
170 IN CONST CHAR16 *CommandString,\r
171 IN OUT SHELL_STATUS *RetVal,\r
172 IN OUT BOOLEAN *CanAffectLE OPTIONAL\r
173 );\r
174\r
175/**\r
176 Checks if a command string has been registered for CommandString, and if so, it\r
177 returns the MAN filename specified for that command.\r
178\r
179 If CommandString is NULL, then ASSERT().\r
180\r
181 @param[in] CommandString The pointer to the command name. This is the name\r
182 found on the command line in the shell.\r
183\r
184 @retval NULL The CommandString was not a registered command.\r
185 @retval other The name of the MAN file.\r
186 @sa SHELL_GET_MAN_FILENAME\r
187**/\r
188CONST CHAR16*\r
189EFIAPI\r
190ShellCommandGetManFileNameHandler (\r
191 IN CONST CHAR16 *CommandString\r
192 );\r
193\r
194\r
195typedef struct {\r
196 LIST_ENTRY Link;\r
197 CHAR16 *CommandString;\r
198} COMMAND_LIST;\r
199\r
200/**\r
201 Get the list of all available shell internal commands. This is a linked list,\r
202 via the LIST_ENTRY structure. Enumerate through it using the BaseLib linked\r
203 list functions. Do not modify the values.\r
204\r
4bbdc0e1 205 @param[in] Sort TRUE to alphabetically sort the values first. FALSE otherwise.\r
206\r
a405b86d 207 @return A linked list of all available shell commands.\r
208**/\r
209CONST COMMAND_LIST*\r
210EFIAPI\r
211ShellCommandGetCommandList (\r
4bbdc0e1 212 IN CONST BOOLEAN Sort\r
a405b86d 213 );\r
214\r
215typedef struct {\r
216 LIST_ENTRY Link;\r
217 CHAR16 *CommandString;\r
218 CHAR16 *Alias;\r
219} ALIAS_LIST;\r
220\r
221/**\r
222 Registers aliases to be set as part of the initialization of the shell application.\r
223\r
224 If Command is NULL, then ASSERT().\r
225 If Alias is NULL, then ASSERT().\r
226\r
227 @param[in] Command The pointer to the Command.\r
228 @param[in] Alias The pointer to Alias.\r
229\r
230 @retval RETURN_SUCCESS The handlers were registered.\r
231 @retval RETURN_OUT_OF_RESOURCES There are not enough resources available to\r
232 register the shell command.\r
233**/\r
234RETURN_STATUS\r
235EFIAPI\r
236ShellCommandRegisterAlias (\r
237 IN CONST CHAR16 *Command,\r
238 IN CONST CHAR16 *Alias\r
239 );\r
240\r
241/**\r
242 Get the list of all shell alias commands. This is a linked list,\r
243 via LIST_ENTRY structure. Enumerate through it using the BaseLib linked\r
244 list functions. Do not modify the values.\r
245\r
246 @return A linked list of all requested shell aliases.\r
247**/\r
248CONST ALIAS_LIST*\r
249EFIAPI\r
250ShellCommandGetInitAliasList (\r
251 VOID\r
252 );\r
253\r
254/**\r
255 Determine if a given alias is on the list of built in aliases.\r
256\r
257 @param[in] Alias The alias to test for.\r
258\r
259 @retval TRUE The alias is a built in alias.\r
260 @retval FALSE The alias is not a built in alias.\r
261**/\r
262BOOLEAN\r
263EFIAPI\r
264ShellCommandIsOnAliasList (\r
265 IN CONST CHAR16 *Alias\r
266 );\r
267\r
268/**\r
269 Checks if a command is already on the list.\r
270\r
271 @param[in] CommandString The command string to check for on the list.\r
272\r
273 @retval TRUE CommandString represents a registered command.\r
274 @retval FALSE CommandString does not represent a registered command.\r
275**/\r
276BOOLEAN\r
277EFIAPI\r
278ShellCommandIsCommandOnList (\r
279 IN CONST CHAR16 *CommandString\r
280 );\r
281\r
282/**\r
283 Get the help text for a command.\r
284\r
285 @param[in] CommandString The command name.\r
286\r
287 @retval NULL No help text was found.\r
288 @return The string of the help text. The caller required to free.\r
289**/\r
290CHAR16*\r
291EFIAPI\r
292ShellCommandGetCommandHelp (\r
293 IN CONST CHAR16 *CommandString\r
294 );\r
295\r
296/**\r
297 Function to make sure that the above pointers are valid.\r
298**/\r
299EFI_STATUS\r
300EFIAPI\r
301CommandInit (\r
302 VOID\r
303 );\r
304\r
305/**\r
306 Function to determine current state of ECHO. Echo determines if lines from scripts\r
307 and ECHO commands are enabled.\r
308\r
309 @retval TRUE Echo is currently enabled.\r
310 @retval FALSE Echo is currently disabled.\r
311**/\r
312BOOLEAN\r
313EFIAPI\r
314ShellCommandGetEchoState (\r
315 VOID\r
316 );\r
317\r
318/**\r
319 Function to set current state of ECHO. Echo determines if lines from scripts\r
320 and ECHO commands are enabled.\r
321\r
322 @param[in] State TRUE to enable Echo, FALSE otherwise.\r
323**/\r
324VOID\r
325EFIAPI\r
326ShellCommandSetEchoState (\r
327 IN BOOLEAN State\r
328 );\r
329\r
330\r
331\r
332/**\r
333 Indicate that the current shell or script should exit.\r
334\r
335 @param[in] ScriptOnly TRUE if exiting a script; FALSE otherwise.\r
b6b22b13 336 @param[in] ErrorCode The 64 bit error code to return.\r
a405b86d 337**/\r
338VOID\r
339EFIAPI\r
340ShellCommandRegisterExit (\r
b6b22b13 341 IN BOOLEAN ScriptOnly,\r
342 IN CONST UINT64 ErrorCode\r
343 );\r
344\r
345/**\r
346 Retrieve the Exit code.\r
347\r
348 @return the value passed into RegisterExit.\r
349**/\r
350UINT64\r
351EFIAPI\r
352ShellCommandGetExitCode (\r
353 VOID\r
a405b86d 354 );\r
355\r
356/**\r
357 Retrieve the Exit indicator.\r
358\r
359 @retval TRUE Exit was indicated.\r
360 @retval FALSE Exit was not indicated.\r
361**/\r
362BOOLEAN\r
363EFIAPI\r
364ShellCommandGetExit (\r
365 VOID\r
366 );\r
367\r
368/**\r
369 Retrieve the Exit script indicator.\r
370\r
371 If ShellCommandGetExit returns FALSE, then the return from this is undefined.\r
372\r
373 @retval TRUE ScriptOnly was indicated.\r
374 @retval FALSE ScriptOnly was not indicated.\r
375**/\r
376BOOLEAN\r
377EFIAPI\r
378ShellCommandGetScriptExit (\r
379 VOID\r
380 );\r
381\r
382typedef struct {\r
383 LIST_ENTRY Link; ///< List enumerator items.\r
384 UINTN Line; ///< What line of the script file this was on.\r
385 CHAR16 *Cl; ///< The original command line.\r
386 VOID *Data; ///< The data structure format dependant upon Command. (not always used)\r
387 BOOLEAN Reset; ///< Reset the command (it must be treated like a initial run (but it may have data already))\r
388} SCRIPT_COMMAND_LIST;\r
389\r
390typedef struct {\r
391 CHAR16 *ScriptName; ///< The filename of this script.\r
392 CHAR16 **Argv; ///< The parmameters to the script file.\r
393 UINTN Argc; ///< The count of parameters.\r
394 LIST_ENTRY CommandList; ///< The script converted to a list of commands (SCRIPT_COMMAND_LIST objects).\r
395 SCRIPT_COMMAND_LIST *CurrentCommand; ///< The command currently being operated. If !=NULL must be a member of CommandList.\r
396 LIST_ENTRY SubstList; ///< A list of current script loop alias' (ALIAS_LIST objects) (Used for the for %-based replacement).\r
397} SCRIPT_FILE;\r
398\r
399/**\r
400 Function to return a pointer to the currently running script file object.\r
401\r
402 @retval NULL A script file is not currently running.\r
403 @return A pointer to the current script file object.\r
404**/\r
405SCRIPT_FILE*\r
406EFIAPI\r
407ShellCommandGetCurrentScriptFile (\r
408 VOID\r
409 );\r
410\r
411/**\r
412 Function to set a new script as the currently running one.\r
413\r
414 This function will correctly stack and unstack nested scripts.\r
415\r
416 @param[in] Script The pointer to new script information structure. If NULL,\r
417 it removes and de-allocates the topmost Script structure.\r
418\r
419 @return A pointer to the current running script file after this\r
420 change. It is NULL if removing the final script.\r
421**/\r
422SCRIPT_FILE*\r
423EFIAPI\r
424ShellCommandSetNewScript (\r
425 IN SCRIPT_FILE *Script OPTIONAL\r
426 );\r
427\r
0ab85bef 428/**\r
429 Function to cleanup all memory from a SCRIPT_FILE structure.\r
430\r
431 @param[in] Script The pointer to the structure to cleanup.\r
432**/\r
433VOID\r
434EFIAPI\r
435DeleteScriptFileStruct (\r
436 IN SCRIPT_FILE *Script\r
437 );\r
438\r
a405b86d 439/**\r
440 Function to get the current Profile string.\r
441\r
442 This is used to retrieve what profiles were installed.\r
443\r
444 @retval NULL There are no installed profiles.\r
445 @return A semicolon-delimited list of profiles.\r
446**/\r
447CONST CHAR16 *\r
448EFIAPI\r
449ShellCommandGetProfileList (\r
450 VOID\r
451 );\r
452\r
453typedef enum {\r
454 MappingTypeFileSystem,\r
455 MappingTypeBlockIo,\r
456 MappingTypeMax\r
457} SHELL_MAPPING_TYPE;\r
458\r
459/**\r
460 Function to generate the next default mapping name.\r
461\r
462 If the return value is not NULL then it must be callee freed.\r
463\r
464 @param Type What kind of mapping name to make.\r
465\r
466 @retval NULL a memory allocation failed.\r
467 @return a new map name string\r
468**/\r
469CHAR16*\r
470EFIAPI\r
471ShellCommandCreateNewMappingName(\r
472 IN CONST SHELL_MAPPING_TYPE Type\r
473 );\r
474\r
475/**\r
476 Function to initialize the table for creating consistent map names.\r
477\r
478 @param[out] Table The pointer to pointer to pointer to DevicePathProtocol object.\r
479\r
480 @retval EFI_SUCCESS The table was created successfully.\r
481**/\r
482EFI_STATUS\r
483EFIAPI\r
484ShellCommandConsistMappingInitialize (\r
485 EFI_DEVICE_PATH_PROTOCOL ***Table\r
486 );\r
487\r
488/**\r
489 Function to uninitialize the table for creating consistent map names.\r
490\r
491 The parameter must have been received from ShellCommandConsistMappingInitialize.\r
492\r
493 @param[out] Table The pointer to pointer to DevicePathProtocol object.\r
494\r
495 @retval EFI_SUCCESS The table was deleted successfully.\r
496**/\r
497EFI_STATUS\r
498EFIAPI\r
499ShellCommandConsistMappingUnInitialize (\r
500 EFI_DEVICE_PATH_PROTOCOL **Table\r
501 );\r
502\r
503/**\r
ba0014b9 504 Create a consistent mapped name for the device specified by DevicePath\r
a405b86d 505 based on the Table.\r
506\r
ba0014b9 507 This must be called after ShellCommandConsistMappingInitialize() and\r
a405b86d 508 before ShellCommandConsistMappingUnInitialize() is called.\r
509\r
4bbdc0e1 510 @param[in] DevicePath The pointer to the dev path for the device.\r
a405b86d 511 @param[in] Table The Table of mapping information.\r
512\r
513 @retval NULL A consistent mapped name could not be created.\r
514 @return A pointer to a string allocated from pool with the device name.\r
515**/\r
516CHAR16*\r
517EFIAPI\r
518ShellCommandConsistMappingGenMappingName (\r
519 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,\r
520 IN EFI_DEVICE_PATH_PROTOCOL **Table\r
521 );\r
522\r
523/**\r
524 Function to search the list of mappings for the first matching node on the\r
525 list based on the MapKey.\r
526\r
527 @param[in] MapKey The pointer to the string key to search for in the map.\r
528\r
529 @return the node on the list.\r
530**/\r
531SHELL_MAP_LIST*\r
532EFIAPI\r
533ShellCommandFindMapItem (\r
534 IN CONST CHAR16 *MapKey\r
535 );\r
536\r
537/**\r
538 Function to add a map node to the list of map items and update the "path" environment variable (optionally).\r
539\r
540 If Path is TRUE (during initialization only), the path environment variable will also be updated to include\r
541 default paths on the new map name...\r
542\r
543 Path should be FALSE when this function is called from the protocol SetMap function.\r
544\r
545 @param[in] Name The human readable mapped name.\r
546 @param[in] DevicePath The Device Path for this map.\r
547 @param[in] Flags The Flags attribute for this map item.\r
548 @param[in] Path TRUE to update path, FALSE to skip this step (should only be TRUE during initialization).\r
549\r
550 @retval EFI_SUCCESS The addition was sucessful.\r
551 @retval EFI_OUT_OF_RESOURCES A memory allocation failed.\r
552 @retval EFI_INVALID_PARAMETER A parameter was invalid.\r
553**/\r
554EFI_STATUS\r
555EFIAPI\r
556ShellCommandAddMapItemAndUpdatePath(\r
557 IN CONST CHAR16 *Name,\r
558 IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,\r
559 IN CONST UINT64 Flags,\r
560 IN CONST BOOLEAN Path\r
561 );\r
562\r
563/**\r
564 Creates the default map names for each device path in the system with\r
565 a protocol depending on the Type.\r
566\r
567 Also sets up the default path environment variable if Type is FileSystem.\r
568\r
569 @retval EFI_SUCCESS All map names were created sucessfully.\r
570 @retval EFI_NOT_FOUND No protocols were found in the system.\r
571 @return Error returned from gBS->LocateHandle().\r
572\r
573 @sa LocateHandle\r
574**/\r
575EFI_STATUS\r
576EFIAPI\r
577ShellCommandCreateInitialMappingsAndPaths(\r
578 VOID\r
579 );\r
580\r
e71cb452
TS
581/**\r
582 Add mappings for any devices without one. Do not change any existing maps.\r
583\r
584 @retval EFI_SUCCESS The operation was successful.\r
585**/\r
586EFI_STATUS\r
587EFIAPI\r
588ShellCommandUpdateMapping (\r
589 VOID\r
590 );\r
591\r
a405b86d 592/**\r
593 Converts a SHELL_FILE_HANDLE to an EFI_FILE_PROTOCOL*.\r
594\r
595 @param[in] Handle The SHELL_FILE_HANDLE to convert.\r
596\r
597 @return a EFI_FILE_PROTOCOL* representing the same file.\r
598**/\r
599EFI_FILE_PROTOCOL*\r
600EFIAPI\r
601ConvertShellHandleToEfiFileProtocol(\r
602 IN CONST SHELL_FILE_HANDLE Handle\r
603 );\r
604\r
605/**\r
606 Remove a SHELL_FILE_HANDLE frmo the list of SHELL_FILE_HANDLES.\r
607\r
608 @param[in] Handle The SHELL_FILE_HANDLE to remove.\r
609\r
610 @retval TRUE The item was removed.\r
611 @retval FALSE The item was not found.\r
612**/\r
613BOOLEAN\r
614EFIAPI\r
615ShellFileHandleRemove(\r
616 IN CONST SHELL_FILE_HANDLE Handle\r
617 );\r
618\r
619/**\r
620 Converts a EFI_FILE_PROTOCOL* to an SHELL_FILE_HANDLE.\r
621\r
622 @param[in] Handle The pointer to EFI_FILE_PROTOCOL to convert.\r
623 @param[in] Path The path to the file for verification.\r
624\r
625 @return a SHELL_FILE_HANDLE representing the same file.\r
626**/\r
627SHELL_FILE_HANDLE\r
628EFIAPI\r
629ConvertEfiFileProtocolToShellHandle(\r
630 IN CONST EFI_FILE_PROTOCOL *Handle,\r
631 IN CONST CHAR16 *Path\r
632 );\r
633\r
634/**\r
635 Find the path that was logged with the specified SHELL_FILE_HANDLE.\r
636\r
637 @param[in] Handle The SHELL_FILE_HANDLE to query on.\r
638\r
639 @return A pointer to the path for the file.\r
640**/\r
641CONST CHAR16*\r
642EFIAPI\r
643ShellFileHandleGetPath(\r
644 IN CONST SHELL_FILE_HANDLE Handle\r
645 );\r
646\r
647\r
648/**\r
649 Function to determine if a SHELL_FILE_HANDLE is at the end of the file.\r
650\r
651 This will NOT work on directories.\r
652\r
653 If Handle is NULL, then ASSERT.\r
654\r
655 @param[in] Handle the file handle\r
656\r
657 @retval TRUE the position is at the end of the file\r
658 @retval FALSE the position is not at the end of the file\r
659**/\r
660BOOLEAN\r
661EFIAPI\r
662ShellFileHandleEof(\r
663 IN SHELL_FILE_HANDLE Handle\r
664 );\r
665\r
a405b86d 666typedef struct {\r
667 LIST_ENTRY Link;\r
668 void *Buffer;\r
669} BUFFER_LIST;\r
670\r
671/**\r
672 Frees any BUFFER_LIST defined type.\r
673\r
674 @param[in] List The pointer to the list head.\r
675**/\r
676VOID\r
677EFIAPI\r
678FreeBufferList (\r
679 IN BUFFER_LIST *List\r
680 );\r
681\r
3bd89603
LE
682/**\r
683 Function printing hex output to the console.\r
684\r
685 @param[in] Indent Number of spaces to indent.\r
686 @param[in] Offset Offset to start with.\r
687 @param[in] DataSize Length of data.\r
688 @param[in] UserData Pointer to some data.\r
689**/\r
690VOID\r
667d7146 691EFIAPI\r
3bd89603
LE
692DumpHex (\r
693 IN UINTN Indent,\r
694 IN UINTN Offset,\r
695 IN UINTN DataSize,\r
696 IN VOID *UserData\r
697 );\r
698\r
b464d7ed
RN
699/**\r
700 Dump HEX data into buffer.\r
701\r
702 @param[in] Buffer HEX data to be dumped in Buffer.\r
703 @param[in] Indent How many spaces to indent the output.\r
704 @param[in] Offset The offset of the printing.\r
705 @param[in] DataSize The size in bytes of UserData.\r
706 @param[in] UserData The data to print out.\r
707**/\r
708CHAR16*\r
667d7146 709EFIAPI\r
b464d7ed
RN
710CatSDumpHex (\r
711 IN CHAR16 *Buffer,\r
712 IN UINTN Indent,\r
713 IN UINTN Offset,\r
714 IN UINTN DataSize,\r
715 IN VOID *UserData\r
716 );\r
a405b86d 717#endif //_SHELL_COMMAND_LIB_\r