]> git.proxmox.com Git - mirror_edk2.git/blame - ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.h
Update all the code to consume the ConvertDevicePathToText, ConvertDevicePathNodeToTe...
[mirror_edk2.git] / ShellPkg / Library / UefiShellLevel1CommandsLib / UefiShellLevel1CommandsLib.h
CommitLineData
a405b86d 1/** @file\r
2 Main file for NULL named library for level 1 shell command functions.\r
3\r
863986b3 4 Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>\r
a405b86d 5 This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
a1d4bfcc 15#ifndef _UEFI_SHELL_LEVEL1_COMMANDS_LIB_H_\r
77dcec12 16#define _UEFI_SHELL_LEVEL1_COMMANDS_LIB_H_\r
17\r
a405b86d 18#include <Uefi.h>\r
19#include <ShellBase.h>\r
20\r
bca163ff
LG
21#include <Guid/ShellLibHiiGuid.h>\r
22\r
a405b86d 23#include <Protocol/EfiShell.h>\r
24#include <Protocol/EfiShellParameters.h>\r
25#include <Protocol/DevicePath.h>\r
26#include <Protocol/LoadedImage.h>\r
27#include <Protocol/UnicodeCollation.h>\r
a405b86d 28\r
29#include <Library/BaseLib.h>\r
30#include <Library/BaseMemoryLib.h>\r
31#include <Library/DebugLib.h>\r
32#include <Library/MemoryAllocationLib.h>\r
33#include <Library/PcdLib.h>\r
34#include <Library/ShellCommandLib.h>\r
35#include <Library/ShellLib.h>\r
36#include <Library/SortLib.h>\r
37#include <Library/UefiLib.h>\r
38#include <Library/UefiRuntimeServicesTableLib.h>\r
39#include <Library/UefiBootServicesTableLib.h>\r
40#include <Library/HiiLib.h>\r
41#include <Library/FileHandleLib.h>\r
42\r
43extern EFI_HANDLE gShellLevel1HiiHandle;\r
a405b86d 44\r
77dcec12 45/**\r
46 Function for 'stall' command.\r
47\r
48 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
49 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
50**/\r
51SHELL_STATUS\r
52EFIAPI\r
53ShellCommandRunStall (\r
54 IN EFI_HANDLE ImageHandle,\r
55 IN EFI_SYSTEM_TABLE *SystemTable\r
56 );\r
57\r
a405b86d 58/**\r
59 Function for 'exit' command.\r
60\r
61 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
62 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
63**/\r
64SHELL_STATUS\r
65EFIAPI\r
66ShellCommandRunExit (\r
67 IN EFI_HANDLE ImageHandle,\r
68 IN EFI_SYSTEM_TABLE *SystemTable\r
69 );\r
70\r
71/**\r
72 Function for 'endif' command.\r
73\r
74 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
75 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
76**/\r
77SHELL_STATUS\r
78EFIAPI\r
79ShellCommandRunEndIf (\r
80 IN EFI_HANDLE ImageHandle,\r
81 IN EFI_SYSTEM_TABLE *SystemTable\r
82 );\r
83\r
84/**\r
85 Function for 'for' command.\r
86\r
87 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
88 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
89**/\r
90SHELL_STATUS\r
91EFIAPI\r
92ShellCommandRunFor (\r
93 IN EFI_HANDLE ImageHandle,\r
94 IN EFI_SYSTEM_TABLE *SystemTable\r
95 );\r
96\r
97/**\r
98 Function for 'endfor' command.\r
99\r
100 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
101 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
102**/\r
103SHELL_STATUS\r
104EFIAPI\r
105ShellCommandRunEndFor (\r
106 IN EFI_HANDLE ImageHandle,\r
107 IN EFI_SYSTEM_TABLE *SystemTable\r
108 );\r
109\r
110/**\r
111 Function for 'if' command.\r
112\r
113 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
114 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
115**/\r
116SHELL_STATUS\r
117EFIAPI\r
118ShellCommandRunIf (\r
119 IN EFI_HANDLE ImageHandle,\r
120 IN EFI_SYSTEM_TABLE *SystemTable\r
121 );\r
122\r
123/**\r
124 Function for 'goto' command.\r
125\r
126 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
127 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
128**/\r
129SHELL_STATUS\r
130EFIAPI\r
131ShellCommandRunGoto (\r
132 IN EFI_HANDLE ImageHandle,\r
133 IN EFI_SYSTEM_TABLE *SystemTable\r
134 );\r
135\r
136/**\r
137 Function for 'shift' command.\r
138\r
139 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
140 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
141**/\r
142SHELL_STATUS\r
143EFIAPI\r
144ShellCommandRunShift (\r
145 IN EFI_HANDLE ImageHandle,\r
146 IN EFI_SYSTEM_TABLE *SystemTable\r
147 );\r
148\r
149\r
150/**\r
151 Function for 'else' command.\r
152\r
153 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
154 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
155**/\r
156SHELL_STATUS\r
157EFIAPI\r
158ShellCommandRunElse (\r
159 IN EFI_HANDLE ImageHandle,\r
160 IN EFI_SYSTEM_TABLE *SystemTable\r
161 );\r
162\r
163///\r
164/// Function prototype for BOTH GetNextNode and GetPreviousNode...\r
165/// This is used to control the MoveToTag function direction...\r
166///\r
167typedef\r
168LIST_ENTRY *\r
169(EFIAPI *LIST_MANIP_FUNC)(\r
170 IN CONST LIST_ENTRY *List,\r
171 IN CONST LIST_ENTRY *Node\r
172 );\r
173\r
174/**\r
77dcec12 175 Move the script pointer from 1 tag (line) to another.\r
176\r
177 It functions so that count starts at 1 and it increases or decreases when it\r
178 hits the specified tags. when it hits zero the location has been found.\r
179\r
180 DecrementerTag and IncrementerTag are used to get around for/endfor and \r
181 similar paired types where the entire middle should be ignored.\r
182\r
183 If label is used it will be used instead of the count.\r
184\r
4ff7e37b
ED
185 @param[in] Function The function to use to enumerate through the \r
186 list. Normally GetNextNode or GetPreviousNode.\r
187 @param[in] DecrementerTag The tag to decrement the count at.\r
188 @param[in] IncrementerTag The tag to increment the count at.\r
189 @param[in] Label A label to look for.\r
190 @param[in, out] ScriptFile The pointer to the current script file structure.\r
191 @param[in] MovePast TRUE makes function return 1 past the found \r
192 location.\r
193 @param[in] FindOnly TRUE to not change the ScriptFile.\r
194 @param[in] WrapAroundScript TRUE to wrap end-to-begining or vise versa in \r
195 searching.\r
a405b86d 196**/\r
197BOOLEAN\r
198EFIAPI\r
199MoveToTag (\r
200 IN CONST LIST_MANIP_FUNC Function,\r
201 IN CONST CHAR16 *DecrementerTag,\r
202 IN CONST CHAR16 *IncrementerTag,\r
203 IN CONST CHAR16 *Label OPTIONAL,\r
77dcec12 204 IN OUT SCRIPT_FILE *ScriptFile,\r
a405b86d 205 IN CONST BOOLEAN MovePast,\r
206 IN CONST BOOLEAN FindOnly,\r
207 IN CONST BOOLEAN WrapAroundScript\r
208 );\r
209\r
77dcec12 210#endif\r
211\r