2 Main file for NULL named library for level 1 shell command functions.
4 Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #ifndef _UEFI_SHELL_LEVEL1_COMMANDS_LIB_H_
16 #define _UEFI_SHELL_LEVEL1_COMMANDS_LIB_H_
20 #include <Guid/ShellLibHiiGuid.h>
22 #include <Protocol/Shell.h>
23 #include <Protocol/ShellParameters.h>
24 #include <Protocol/DevicePath.h>
25 #include <Protocol/LoadedImage.h>
26 #include <Protocol/UnicodeCollation.h>
28 #include <Library/BaseLib.h>
29 #include <Library/BaseMemoryLib.h>
30 #include <Library/DebugLib.h>
31 #include <Library/MemoryAllocationLib.h>
32 #include <Library/PcdLib.h>
33 #include <Library/ShellCommandLib.h>
34 #include <Library/ShellLib.h>
35 #include <Library/SortLib.h>
36 #include <Library/UefiLib.h>
37 #include <Library/UefiRuntimeServicesTableLib.h>
38 #include <Library/UefiBootServicesTableLib.h>
39 #include <Library/HiiLib.h>
40 #include <Library/FileHandleLib.h>
42 extern EFI_HANDLE gShellLevel1HiiHandle
;
45 Function for 'stall' command.
47 @param[in] ImageHandle Handle to the Image (NULL if Internal).
48 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
52 ShellCommandRunStall (
53 IN EFI_HANDLE ImageHandle
,
54 IN EFI_SYSTEM_TABLE
*SystemTable
58 Function for 'exit' command.
60 @param[in] ImageHandle Handle to the Image (NULL if Internal).
61 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
66 IN EFI_HANDLE ImageHandle
,
67 IN EFI_SYSTEM_TABLE
*SystemTable
71 Function for 'endif' command.
73 @param[in] ImageHandle Handle to the Image (NULL if Internal).
74 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
78 ShellCommandRunEndIf (
79 IN EFI_HANDLE ImageHandle
,
80 IN EFI_SYSTEM_TABLE
*SystemTable
84 Function for 'for' command.
86 @param[in] ImageHandle Handle to the Image (NULL if Internal).
87 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
92 IN EFI_HANDLE ImageHandle
,
93 IN EFI_SYSTEM_TABLE
*SystemTable
97 Function for 'endfor' command.
99 @param[in] ImageHandle Handle to the Image (NULL if Internal).
100 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
104 ShellCommandRunEndFor (
105 IN EFI_HANDLE ImageHandle
,
106 IN EFI_SYSTEM_TABLE
*SystemTable
110 Function for 'if' command.
112 @param[in] ImageHandle Handle to the Image (NULL if Internal).
113 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
118 IN EFI_HANDLE ImageHandle
,
119 IN EFI_SYSTEM_TABLE
*SystemTable
123 Function for 'goto' command.
125 @param[in] ImageHandle Handle to the Image (NULL if Internal).
126 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
130 ShellCommandRunGoto (
131 IN EFI_HANDLE ImageHandle
,
132 IN EFI_SYSTEM_TABLE
*SystemTable
136 Function for 'shift' command.
138 @param[in] ImageHandle Handle to the Image (NULL if Internal).
139 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
143 ShellCommandRunShift (
144 IN EFI_HANDLE ImageHandle
,
145 IN EFI_SYSTEM_TABLE
*SystemTable
150 Function for 'else' command.
152 @param[in] ImageHandle Handle to the Image (NULL if Internal).
153 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
157 ShellCommandRunElse (
158 IN EFI_HANDLE ImageHandle
,
159 IN EFI_SYSTEM_TABLE
*SystemTable
163 /// Function prototype for BOTH GetNextNode and GetPreviousNode...
164 /// This is used to control the MoveToTag function direction...
168 (EFIAPI
*LIST_MANIP_FUNC
)(
169 IN CONST LIST_ENTRY
*List
,
170 IN CONST LIST_ENTRY
*Node
174 Move the script pointer from 1 tag (line) to another.
176 It functions so that count starts at 1 and it increases or decreases when it
177 hits the specified tags. when it hits zero the location has been found.
179 DecrementerTag and IncrementerTag are used to get around for/endfor and
180 similar paired types where the entire middle should be ignored.
182 If label is used it will be used instead of the count.
184 @param[in] Function The function to use to enumerate through the
185 list. Normally GetNextNode or GetPreviousNode.
186 @param[in] DecrementerTag The tag to decrement the count at.
187 @param[in] IncrementerTag The tag to increment the count at.
188 @param[in] Label A label to look for.
189 @param[in, out] ScriptFile The pointer to the current script file structure.
190 @param[in] MovePast TRUE makes function return 1 past the found
192 @param[in] FindOnly TRUE to not change the ScriptFile.
193 @param[in] WrapAroundScript TRUE to wrap end-to-begining or vise versa in
198 IN CONST LIST_MANIP_FUNC Function
,
199 IN CONST CHAR16
*DecrementerTag
,
200 IN CONST CHAR16
*IncrementerTag
,
201 IN CONST CHAR16
*Label OPTIONAL
,
202 IN OUT SCRIPT_FILE
*ScriptFile
,
203 IN CONST BOOLEAN MovePast
,
204 IN CONST BOOLEAN FindOnly
,
205 IN CONST BOOLEAN WrapAroundScript