]> git.proxmox.com Git - mirror_edk2.git/blame - ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.h
udk2010.up2.shell initial release.
[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
4 Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
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
15#include <Uefi.h>\r
16#include <ShellBase.h>\r
17\r
18#include <Protocol/EfiShell.h>\r
19#include <Protocol/EfiShellParameters.h>\r
20#include <Protocol/DevicePath.h>\r
21#include <Protocol/LoadedImage.h>\r
22#include <Protocol/UnicodeCollation.h>\r
23#include <Protocol/DevicePathToText.h>\r
24\r
25#include <Library/BaseLib.h>\r
26#include <Library/BaseMemoryLib.h>\r
27#include <Library/DebugLib.h>\r
28#include <Library/MemoryAllocationLib.h>\r
29#include <Library/PcdLib.h>\r
30#include <Library/ShellCommandLib.h>\r
31#include <Library/ShellLib.h>\r
32#include <Library/SortLib.h>\r
33#include <Library/UefiLib.h>\r
34#include <Library/UefiRuntimeServicesTableLib.h>\r
35#include <Library/UefiBootServicesTableLib.h>\r
36#include <Library/HiiLib.h>\r
37#include <Library/FileHandleLib.h>\r
38\r
39extern EFI_HANDLE gShellLevel1HiiHandle;\r
40extern CONST EFI_GUID gShellLevel1HiiGuid;\r
41\r
42/**\r
43 Function for 'exit' command.\r
44\r
45 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
46 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
47**/\r
48SHELL_STATUS\r
49EFIAPI\r
50ShellCommandRunExit (\r
51 IN EFI_HANDLE ImageHandle,\r
52 IN EFI_SYSTEM_TABLE *SystemTable\r
53 );\r
54\r
55/**\r
56 Function for 'endif' command.\r
57\r
58 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
59 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
60**/\r
61SHELL_STATUS\r
62EFIAPI\r
63ShellCommandRunEndIf (\r
64 IN EFI_HANDLE ImageHandle,\r
65 IN EFI_SYSTEM_TABLE *SystemTable\r
66 );\r
67\r
68/**\r
69 Function for 'for' command.\r
70\r
71 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
72 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
73**/\r
74SHELL_STATUS\r
75EFIAPI\r
76ShellCommandRunFor (\r
77 IN EFI_HANDLE ImageHandle,\r
78 IN EFI_SYSTEM_TABLE *SystemTable\r
79 );\r
80\r
81/**\r
82 Function for 'endfor' command.\r
83\r
84 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
85 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
86**/\r
87SHELL_STATUS\r
88EFIAPI\r
89ShellCommandRunEndFor (\r
90 IN EFI_HANDLE ImageHandle,\r
91 IN EFI_SYSTEM_TABLE *SystemTable\r
92 );\r
93\r
94/**\r
95 Function for 'if' command.\r
96\r
97 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
98 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
99**/\r
100SHELL_STATUS\r
101EFIAPI\r
102ShellCommandRunIf (\r
103 IN EFI_HANDLE ImageHandle,\r
104 IN EFI_SYSTEM_TABLE *SystemTable\r
105 );\r
106\r
107/**\r
108 Function for 'goto' command.\r
109\r
110 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
111 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
112**/\r
113SHELL_STATUS\r
114EFIAPI\r
115ShellCommandRunGoto (\r
116 IN EFI_HANDLE ImageHandle,\r
117 IN EFI_SYSTEM_TABLE *SystemTable\r
118 );\r
119\r
120/**\r
121 Function for 'shift' command.\r
122\r
123 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
124 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
125**/\r
126SHELL_STATUS\r
127EFIAPI\r
128ShellCommandRunShift (\r
129 IN EFI_HANDLE ImageHandle,\r
130 IN EFI_SYSTEM_TABLE *SystemTable\r
131 );\r
132\r
133\r
134/**\r
135 Function for 'else' command.\r
136\r
137 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
138 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
139**/\r
140SHELL_STATUS\r
141EFIAPI\r
142ShellCommandRunElse (\r
143 IN EFI_HANDLE ImageHandle,\r
144 IN EFI_SYSTEM_TABLE *SystemTable\r
145 );\r
146\r
147///\r
148/// Function prototype for BOTH GetNextNode and GetPreviousNode...\r
149/// This is used to control the MoveToTag function direction...\r
150///\r
151typedef\r
152LIST_ENTRY *\r
153(EFIAPI *LIST_MANIP_FUNC)(\r
154 IN CONST LIST_ENTRY *List,\r
155 IN CONST LIST_ENTRY *Node\r
156 );\r
157\r
158/**\r
159 Function to move to a spacified tag in a script file structure.\r
160\r
161 @param[in] Function The pointer to the function to move with.\r
162 @param[in] DecrementerTag The pointer to a string to decrement upon finding.\r
163 @param[in] IncrementerTag The pointer to a string to increment upon finding.\r
164 @param[in] Label A Label to look for.\r
165 @param[in] ScriptFile The script file structure to look in.\r
166 @param[in] MovePast TRUE to go to the element just after the found one. FALSE otherwise.\r
167 @param[in] FindOnly FALSE to change the execution point in the script file structure. TRUE otherwise.\r
168 @param[in] WrapAroundScript TRUE to go to begining when end is hit, or vise versa. FALSE otherwise.\r
169**/\r
170BOOLEAN\r
171EFIAPI\r
172MoveToTag (\r
173 IN CONST LIST_MANIP_FUNC Function,\r
174 IN CONST CHAR16 *DecrementerTag,\r
175 IN CONST CHAR16 *IncrementerTag,\r
176 IN CONST CHAR16 *Label OPTIONAL,\r
177 IN SCRIPT_FILE *ScriptFile,\r
178 IN CONST BOOLEAN MovePast,\r
179 IN CONST BOOLEAN FindOnly,\r
180 IN CONST BOOLEAN WrapAroundScript\r
181 );\r
182\r