2 Main file for NULL named library for level 1 shell command functions.
4 Copyright (c) 2009 - 2011, 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>
28 #include <Protocol/DevicePathToText.h>
30 #include <Library/BaseLib.h>
31 #include <Library/BaseMemoryLib.h>
32 #include <Library/DebugLib.h>
33 #include <Library/MemoryAllocationLib.h>
34 #include <Library/PcdLib.h>
35 #include <Library/ShellCommandLib.h>
36 #include <Library/ShellLib.h>
37 #include <Library/SortLib.h>
38 #include <Library/UefiLib.h>
39 #include <Library/UefiRuntimeServicesTableLib.h>
40 #include <Library/UefiBootServicesTableLib.h>
41 #include <Library/HiiLib.h>
42 #include <Library/FileHandleLib.h>
44 extern EFI_HANDLE gShellLevel1HiiHandle
;
47 Function for 'stall' command.
49 @param[in] ImageHandle Handle to the Image (NULL if Internal).
50 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
54 ShellCommandRunStall (
55 IN EFI_HANDLE ImageHandle
,
56 IN EFI_SYSTEM_TABLE
*SystemTable
60 Function for 'exit' command.
62 @param[in] ImageHandle Handle to the Image (NULL if Internal).
63 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
68 IN EFI_HANDLE ImageHandle
,
69 IN EFI_SYSTEM_TABLE
*SystemTable
73 Function for 'endif' command.
75 @param[in] ImageHandle Handle to the Image (NULL if Internal).
76 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
80 ShellCommandRunEndIf (
81 IN EFI_HANDLE ImageHandle
,
82 IN EFI_SYSTEM_TABLE
*SystemTable
86 Function for 'for' command.
88 @param[in] ImageHandle Handle to the Image (NULL if Internal).
89 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
94 IN EFI_HANDLE ImageHandle
,
95 IN EFI_SYSTEM_TABLE
*SystemTable
99 Function for 'endfor' command.
101 @param[in] ImageHandle Handle to the Image (NULL if Internal).
102 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
106 ShellCommandRunEndFor (
107 IN EFI_HANDLE ImageHandle
,
108 IN EFI_SYSTEM_TABLE
*SystemTable
112 Function for 'if' command.
114 @param[in] ImageHandle Handle to the Image (NULL if Internal).
115 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
120 IN EFI_HANDLE ImageHandle
,
121 IN EFI_SYSTEM_TABLE
*SystemTable
125 Function for 'goto' command.
127 @param[in] ImageHandle Handle to the Image (NULL if Internal).
128 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
132 ShellCommandRunGoto (
133 IN EFI_HANDLE ImageHandle
,
134 IN EFI_SYSTEM_TABLE
*SystemTable
138 Function for 'shift' command.
140 @param[in] ImageHandle Handle to the Image (NULL if Internal).
141 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
145 ShellCommandRunShift (
146 IN EFI_HANDLE ImageHandle
,
147 IN EFI_SYSTEM_TABLE
*SystemTable
152 Function for 'else' command.
154 @param[in] ImageHandle Handle to the Image (NULL if Internal).
155 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
159 ShellCommandRunElse (
160 IN EFI_HANDLE ImageHandle
,
161 IN EFI_SYSTEM_TABLE
*SystemTable
165 /// Function prototype for BOTH GetNextNode and GetPreviousNode...
166 /// This is used to control the MoveToTag function direction...
170 (EFIAPI
*LIST_MANIP_FUNC
)(
171 IN CONST LIST_ENTRY
*List
,
172 IN CONST LIST_ENTRY
*Node
176 Move the script pointer from 1 tag (line) to another.
178 It functions so that count starts at 1 and it increases or decreases when it
179 hits the specified tags. when it hits zero the location has been found.
181 DecrementerTag and IncrementerTag are used to get around for/endfor and
182 similar paired types where the entire middle should be ignored.
184 If label is used it will be used instead of the count.
186 @param[in] Function The function to use to enumerate through the
187 list. Normally GetNextNode or GetPreviousNode.
188 @param[in] DecrementerTag The tag to decrement the count at.
189 @param[in] IncrementerTag The tag to increment the count at.
190 @param[in] Label A label to look for.
191 @param[in, out] ScriptFile The pointer to the current script file structure.
192 @param[in] MovePast TRUE makes function return 1 past the found
194 @param[in] FindOnly TRUE to not change the ScriptFile.
195 @param[in] WrapAroundScript TRUE to wrap end-to-begining or vise versa in
201 IN CONST LIST_MANIP_FUNC Function
,
202 IN CONST CHAR16
*DecrementerTag
,
203 IN CONST CHAR16
*IncrementerTag
,
204 IN CONST CHAR16
*Label OPTIONAL
,
205 IN OUT SCRIPT_FILE
*ScriptFile
,
206 IN CONST BOOLEAN MovePast
,
207 IN CONST BOOLEAN FindOnly
,
208 IN CONST BOOLEAN WrapAroundScript