TianoCore EDK2 master
Loading...
Searching...
No Matches
ShellCommandLib.h
Go to the documentation of this file.
1
14#ifndef _SHELL_COMMAND_LIB_
15#define _SHELL_COMMAND_LIB_
16
17#include <Uefi.h>
18
19#include <Protocol/Shell.h>
23
25
26//
27// The extern global protocol poionters.
28//
29extern EFI_UNICODE_COLLATION_PROTOCOL *gUnicodeCollation;
30extern CONST CHAR16 *SupportLevel[];
31
32//
33// The map list objects.
34//
35typedef struct {
36 LIST_ENTRY Link;
37 EFI_DEVICE_PATH_PROTOCOL *DevicePath;
38 CHAR16 *MapName;
39 CHAR16 *CurrentDirectoryPath;
40 UINT64 Flags;
46
54typedef
55CONST CHAR16 *
57 VOID
58 );
59
76typedef
78(EFIAPI *SHELL_RUN_COMMAND)(
79 IN EFI_HANDLE ImageHandle,
80 IN EFI_SYSTEM_TABLE *SystemTable
81 );
82
130RETURN_STATUS
131EFIAPI
133 IN CONST CHAR16 *CommandString,
134 IN SHELL_RUN_COMMAND CommandHandler,
136 IN UINT32 ShellMinSupportLevel,
137 IN CONST CHAR16 *ProfileName,
138 IN CONST BOOLEAN CanAffectLE,
139 IN CONST EFI_HII_HANDLE HiiHandle,
140 IN CONST EFI_STRING_ID ManFormatHelp
141 );
142
167RETURN_STATUS
168EFIAPI
170 IN CONST CHAR16 *CommandString,
171 IN OUT SHELL_STATUS *RetVal,
172 IN OUT BOOLEAN *CanAffectLE OPTIONAL
173 );
174
188CONST CHAR16 *
189EFIAPI
191 IN CONST CHAR16 *CommandString
192 );
193
194typedef struct {
195 LIST_ENTRY Link;
196 CHAR16 *CommandString;
198
209EFIAPI
211 IN CONST BOOLEAN Sort
212 );
213
214typedef struct {
215 LIST_ENTRY Link;
216 CHAR16 *CommandString;
217 CHAR16 *Alias;
218} ALIAS_LIST;
219
233RETURN_STATUS
234EFIAPI
236 IN CONST CHAR16 *Command,
237 IN CONST CHAR16 *Alias
238 );
239
248EFIAPI
250 VOID
251 );
252
261BOOLEAN
262EFIAPI
264 IN CONST CHAR16 *Alias
265 );
266
275BOOLEAN
276EFIAPI
278 IN CONST CHAR16 *CommandString
279 );
280
289CHAR16 *
290EFIAPI
292 IN CONST CHAR16 *CommandString
293 );
294
299EFIAPI
301 VOID
302 );
303
311BOOLEAN
312EFIAPI
314 VOID
315 );
316
323VOID
324EFIAPI
326 IN BOOLEAN State
327 );
328
335VOID
336EFIAPI
338 IN BOOLEAN ScriptOnly,
339 IN CONST UINT64 ErrorCode
340 );
341
347UINT64
348EFIAPI
350 VOID
351 );
352
359BOOLEAN
360EFIAPI
362 VOID
363 );
364
373BOOLEAN
374EFIAPI
376 VOID
377 );
378
379typedef struct {
382 CHAR16 *Cl;
383 VOID *Data;
384 BOOLEAN Reset;
386
387typedef struct {
388 CHAR16 *ScriptName;
389 CHAR16 **Argv;
395
403EFIAPI
405 VOID
406 );
407
420EFIAPI
422 IN SCRIPT_FILE *Script OPTIONAL
423 );
424
430VOID
431EFIAPI
433 IN SCRIPT_FILE *Script
434 );
435
444CONST CHAR16 *
445EFIAPI
447 VOID
448 );
449
450typedef enum {
451 MappingTypeFileSystem,
452 MappingTypeBlockIo,
453 MappingTypeMax
454} SHELL_MAPPING_TYPE;
455
466CHAR16 *
467EFIAPI
469 IN CONST SHELL_MAPPING_TYPE Type
470 );
471
480EFIAPI
483 );
484
495EFIAPI
498 );
499
513CHAR16 *
514EFIAPI
516 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
518 );
519
529EFIAPI
531 IN CONST CHAR16 *MapKey
532 );
533
552EFIAPI
554 IN CONST CHAR16 *Name,
556 IN CONST UINT64 Flags,
557 IN CONST BOOLEAN Path
558 );
559
573EFIAPI
575 VOID
576 );
577
584EFIAPI
586 VOID
587 );
588
597EFIAPI
599 IN CONST SHELL_FILE_HANDLE Handle
600 );
601
610BOOLEAN
611EFIAPI
613 IN CONST SHELL_FILE_HANDLE Handle
614 );
615
624SHELL_FILE_HANDLE
625EFIAPI
627 IN CONST EFI_FILE_PROTOCOL *Handle,
628 IN CONST CHAR16 *Path
629 );
630
638CONST CHAR16 *
639EFIAPI
641 IN CONST SHELL_FILE_HANDLE Handle
642 );
643
656BOOLEAN
657EFIAPI
659 IN SHELL_FILE_HANDLE Handle
660 );
661
662typedef struct {
663 LIST_ENTRY Link;
664 void *Buffer;
666
672VOID
673EFIAPI
675 IN BUFFER_LIST *List
676 );
677
686VOID
687EFIAPI
688DumpHex (
689 IN UINTN Indent,
690 IN UINTN Offset,
691 IN UINTN DataSize,
692 IN VOID *UserData
693 );
694
704CHAR16 *
705EFIAPI
707 IN CHAR16 *Buffer,
708 IN UINTN Indent,
709 IN UINTN Offset,
710 IN UINTN DataSize,
711 IN VOID *UserData
712 );
713
714//
715// Determines the ordering operation for ShellSortFileList().
716//
717typedef enum {
718 //
719 // Sort the EFI_SHELL_FILE_INFO objects by the FileName field, in increasing
720 // order, using gUnicodeCollation->StriColl().
721 //
722 ShellSortFileListByFileName,
723 //
724 // Sort the EFI_SHELL_FILE_INFO objects by the FullName field, in increasing
725 // order, using gUnicodeCollation->StriColl().
726 //
727 ShellSortFileListByFullName,
728 ShellSortFileListMax
729} SHELL_SORT_FILE_LIST;
730
788EFIAPI
790 IN OUT EFI_SHELL_FILE_INFO **FileList,
791 OUT EFI_SHELL_FILE_INFO **Duplicates OPTIONAL,
792 IN SHELL_SORT_FILE_LIST Order
793 );
794
795#endif //_SHELL_COMMAND_LIB_
UINT64 UINTN
#define CONST
Definition: Base.h:259
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
SHELL_STATUS
Definition: Shell.h:21
CHAR16 *EFIAPI ShellCommandCreateNewMappingName(IN CONST SHELL_MAPPING_TYPE Type)
BOOLEAN EFIAPI ShellCommandGetScriptExit(VOID)
CONST ALIAS_LIST *EFIAPI ShellCommandGetInitAliasList(VOID)
BOOLEAN EFIAPI ShellFileHandleRemove(IN CONST SHELL_FILE_HANDLE Handle)
EFI_STATUS EFIAPI CommandInit(VOID)
SHELL_FILE_HANDLE EFIAPI ConvertEfiFileProtocolToShellHandle(IN CONST EFI_FILE_PROTOCOL *Handle, IN CONST CHAR16 *Path)
VOID EFIAPI FreeBufferList(IN BUFFER_LIST *List)
BOOLEAN EFIAPI ShellFileHandleEof(IN SHELL_FILE_HANDLE Handle)
EFI_STATUS EFIAPI ShellCommandAddMapItemAndUpdatePath(IN CONST CHAR16 *Name, IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN CONST UINT64 Flags, IN CONST BOOLEAN Path)
CONST CHAR16 *EFIAPI ShellCommandGetManFileNameHandler(IN CONST CHAR16 *CommandString)
SHELL_MAP_LIST gShellMapList
List of Mappings - DeviceName and Drive Letter(ism).
BOOLEAN EFIAPI ShellCommandIsCommandOnList(IN CONST CHAR16 *CommandString)
SHELL_STATUS(EFIAPI * SHELL_RUN_COMMAND)(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
CONST CHAR16 *EFIAPI ShellFileHandleGetPath(IN CONST SHELL_FILE_HANDLE Handle)
SHELL_MAP_LIST * gShellCurMapping
Pointer to node of current directory in the mMapList.
CHAR16 *EFIAPI ShellCommandGetCommandHelp(IN CONST CHAR16 *CommandString)
VOID EFIAPI ShellCommandRegisterExit(IN BOOLEAN ScriptOnly, IN CONST UINT64 ErrorCode)
RETURN_STATUS EFIAPI ShellCommandRunCommandHandler(IN CONST CHAR16 *CommandString, IN OUT SHELL_STATUS *RetVal, IN OUT BOOLEAN *CanAffectLE OPTIONAL)
EFI_FILE_PROTOCOL *EFIAPI ConvertShellHandleToEfiFileProtocol(IN CONST SHELL_FILE_HANDLE Handle)
SHELL_MAP_LIST *EFIAPI ShellCommandFindMapItem(IN CONST CHAR16 *MapKey)
RETURN_STATUS EFIAPI ShellCommandRegisterCommandName(IN CONST CHAR16 *CommandString, IN SHELL_RUN_COMMAND CommandHandler, IN SHELL_GET_MAN_FILENAME GetManFileName, IN UINT32 ShellMinSupportLevel, IN CONST CHAR16 *ProfileName, IN CONST BOOLEAN CanAffectLE, IN CONST EFI_HII_HANDLE HiiHandle, IN CONST EFI_STRING_ID ManFormatHelp)
UINT64 EFIAPI ShellCommandGetExitCode(VOID)
VOID EFIAPI DeleteScriptFileStruct(IN SCRIPT_FILE *Script)
CONST CHAR16 *(EFIAPI * SHELL_GET_MAN_FILENAME)(VOID)
SCRIPT_FILE *EFIAPI ShellCommandSetNewScript(IN SCRIPT_FILE *Script OPTIONAL)
BOOLEAN EFIAPI ShellCommandGetEchoState(VOID)
CONST COMMAND_LIST *EFIAPI ShellCommandGetCommandList(IN CONST BOOLEAN Sort)
RETURN_STATUS EFIAPI ShellCommandRegisterAlias(IN CONST CHAR16 *Command, IN CONST CHAR16 *Alias)
EFI_STATUS EFIAPI ShellCommandUpdateMapping(VOID)
EFI_STATUS EFIAPI ShellCommandCreateInitialMappingsAndPaths(VOID)
VOID EFIAPI ShellCommandSetEchoState(IN BOOLEAN State)
CHAR16 *EFIAPI CatSDumpHex(IN CHAR16 *Buffer, IN UINTN Indent, IN UINTN Offset, IN UINTN DataSize, IN VOID *UserData)
EFI_STATUS EFIAPI ShellCommandConsistMappingUnInitialize(EFI_DEVICE_PATH_PROTOCOL **Table)
CHAR16 *EFIAPI ShellCommandConsistMappingGenMappingName(IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN EFI_DEVICE_PATH_PROTOCOL **Table)
EFI_STATUS EFIAPI ShellSortFileList(IN OUT EFI_SHELL_FILE_INFO **FileList, OUT EFI_SHELL_FILE_INFO **Duplicates OPTIONAL, IN SHELL_SORT_FILE_LIST Order)
BOOLEAN EFIAPI ShellCommandGetExit(VOID)
CONST CHAR16 *EFIAPI ShellCommandGetProfileList(VOID)
VOID EFIAPI DumpHex(IN UINTN Indent, IN UINTN Offset, IN UINTN DataSize, IN VOID *UserData)
SCRIPT_FILE *EFIAPI ShellCommandGetCurrentScriptFile(VOID)
BOOLEAN EFIAPI ShellCommandIsOnAliasList(IN CONST CHAR16 *Alias)
EFI_STATUS EFIAPI ShellCommandConsistMappingInitialize(EFI_DEVICE_PATH_PROTOCOL ***Table)
CHAR16 * GetManFileName(IN CONST CHAR16 *ManFileName)
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33
VOID * EFI_HII_HANDLE
LIST_ENTRY Link
List enumerator items.
VOID * Data
The data structure format dependant upon Command. (not always used)
UINTN Line
What line of the script file this was on.
BOOLEAN Reset
Reset the command (it must be treated like a initial run (but it may have data already))
CHAR16 * Cl
The original command line.
CHAR16 * ScriptName
The filename of this script.
UINTN Argc
The count of parameters.
LIST_ENTRY CommandList
The script converted to a list of commands (SCRIPT_COMMAND_LIST objects).
SCRIPT_COMMAND_LIST * CurrentCommand
The command currently being operated. If !=NULL must be a member of CommandList.
CHAR16 ** Argv
The parmameters to the script file.
LIST_ENTRY SubstList
A list of current script loop alias' (ALIAS_LIST objects) (Used for the for %-based replacement).