2 Main file for NULL named library for level 1 shell command functions.
4 Copyright (c) 2009 - 2013, 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_
19 #include <ShellBase.h>
21 #include <Guid/ShellLibHiiGuid.h>
23 #include <Protocol/EfiShell.h>
24 #include <Protocol/EfiShellParameters.h>
25 #include <Protocol/DevicePath.h>
26 #include <Protocol/LoadedImage.h>
27 #include <Protocol/UnicodeCollation.h>
29 #include <Library/BaseLib.h>
30 #include <Library/BaseMemoryLib.h>
31 #include <Library/DebugLib.h>
32 #include <Library/MemoryAllocationLib.h>
33 #include <Library/PcdLib.h>
34 #include <Library/ShellCommandLib.h>
35 #include <Library/ShellLib.h>
36 #include <Library/SortLib.h>
37 #include <Library/UefiLib.h>
38 #include <Library/UefiRuntimeServicesTableLib.h>
39 #include <Library/UefiBootServicesTableLib.h>
40 #include <Library/HiiLib.h>
41 #include <Library/FileHandleLib.h>
43 extern EFI_HANDLE gShellLevel1HiiHandle
;
46 Function for 'stall' command.
48 @param[in] ImageHandle Handle to the Image (NULL if Internal).
49 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
53 ShellCommandRunStall (
54 IN EFI_HANDLE ImageHandle
,
55 IN EFI_SYSTEM_TABLE
*SystemTable
59 Function for 'exit' command.
61 @param[in] ImageHandle Handle to the Image (NULL if Internal).
62 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
67 IN EFI_HANDLE ImageHandle
,
68 IN EFI_SYSTEM_TABLE
*SystemTable
72 Function for 'endif' command.
74 @param[in] ImageHandle Handle to the Image (NULL if Internal).
75 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
79 ShellCommandRunEndIf (
80 IN EFI_HANDLE ImageHandle
,
81 IN EFI_SYSTEM_TABLE
*SystemTable
85 Function for 'for' command.
87 @param[in] ImageHandle Handle to the Image (NULL if Internal).
88 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
93 IN EFI_HANDLE ImageHandle
,
94 IN EFI_SYSTEM_TABLE
*SystemTable
98 Function for 'endfor' command.
100 @param[in] ImageHandle Handle to the Image (NULL if Internal).
101 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
105 ShellCommandRunEndFor (
106 IN EFI_HANDLE ImageHandle
,
107 IN EFI_SYSTEM_TABLE
*SystemTable
111 Function for 'if' command.
113 @param[in] ImageHandle Handle to the Image (NULL if Internal).
114 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
119 IN EFI_HANDLE ImageHandle
,
120 IN EFI_SYSTEM_TABLE
*SystemTable
124 Function for 'goto' command.
126 @param[in] ImageHandle Handle to the Image (NULL if Internal).
127 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
131 ShellCommandRunGoto (
132 IN EFI_HANDLE ImageHandle
,
133 IN EFI_SYSTEM_TABLE
*SystemTable
137 Function for 'shift' command.
139 @param[in] ImageHandle Handle to the Image (NULL if Internal).
140 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
144 ShellCommandRunShift (
145 IN EFI_HANDLE ImageHandle
,
146 IN EFI_SYSTEM_TABLE
*SystemTable
151 Function for 'else' command.
153 @param[in] ImageHandle Handle to the Image (NULL if Internal).
154 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
158 ShellCommandRunElse (
159 IN EFI_HANDLE ImageHandle
,
160 IN EFI_SYSTEM_TABLE
*SystemTable
164 /// Function prototype for BOTH GetNextNode and GetPreviousNode...
165 /// This is used to control the MoveToTag function direction...
169 (EFIAPI
*LIST_MANIP_FUNC
)(
170 IN CONST LIST_ENTRY
*List
,
171 IN CONST LIST_ENTRY
*Node
175 Move the script pointer from 1 tag (line) to another.
177 It functions so that count starts at 1 and it increases or decreases when it
178 hits the specified tags. when it hits zero the location has been found.
180 DecrementerTag and IncrementerTag are used to get around for/endfor and
181 similar paired types where the entire middle should be ignored.
183 If label is used it will be used instead of the count.
185 @param[in] Function The function to use to enumerate through the
186 list. Normally GetNextNode or GetPreviousNode.
187 @param[in] DecrementerTag The tag to decrement the count at.
188 @param[in] IncrementerTag The tag to increment the count at.
189 @param[in] Label A label to look for.
190 @param[in, out] ScriptFile The pointer to the current script file structure.
191 @param[in] MovePast TRUE makes function return 1 past the found
193 @param[in] FindOnly TRUE to not change the ScriptFile.
194 @param[in] WrapAroundScript TRUE to wrap end-to-begining or vise versa in
200 IN CONST LIST_MANIP_FUNC Function
,
201 IN CONST CHAR16
*DecrementerTag
,
202 IN CONST CHAR16
*IncrementerTag
,
203 IN CONST CHAR16
*Label OPTIONAL
,
204 IN OUT SCRIPT_FILE
*ScriptFile
,
205 IN CONST BOOLEAN MovePast
,
206 IN CONST BOOLEAN FindOnly
,
207 IN CONST BOOLEAN WrapAroundScript