]> git.proxmox.com Git - mirror_edk2.git/blob - ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.h
Clean up the private GUID definition in module Level.
[mirror_edk2.git] / ShellPkg / Library / UefiShellLevel1CommandsLib / UefiShellLevel1CommandsLib.h
1 /** @file
2 Main file for NULL named library for level 1 shell command functions.
3
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
9
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.
12
13 **/
14
15 #ifndef _UEFI_SHELL_LEVEL1_COMMANDS_LIB_H_
16 #define _UEFI_SHELL_LEVEL1_COMMANDS_LIB_H_
17
18 #include <Uefi.h>
19 #include <ShellBase.h>
20
21 #include <Guid/ShellLibHiiGuid.h>
22
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>
29
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>
43
44 extern EFI_HANDLE gShellLevel1HiiHandle;
45
46 /**
47 Function for 'stall' command.
48
49 @param[in] ImageHandle Handle to the Image (NULL if Internal).
50 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
51 **/
52 SHELL_STATUS
53 EFIAPI
54 ShellCommandRunStall (
55 IN EFI_HANDLE ImageHandle,
56 IN EFI_SYSTEM_TABLE *SystemTable
57 );
58
59 /**
60 Function for 'exit' command.
61
62 @param[in] ImageHandle Handle to the Image (NULL if Internal).
63 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
64 **/
65 SHELL_STATUS
66 EFIAPI
67 ShellCommandRunExit (
68 IN EFI_HANDLE ImageHandle,
69 IN EFI_SYSTEM_TABLE *SystemTable
70 );
71
72 /**
73 Function for 'endif' command.
74
75 @param[in] ImageHandle Handle to the Image (NULL if Internal).
76 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
77 **/
78 SHELL_STATUS
79 EFIAPI
80 ShellCommandRunEndIf (
81 IN EFI_HANDLE ImageHandle,
82 IN EFI_SYSTEM_TABLE *SystemTable
83 );
84
85 /**
86 Function for 'for' command.
87
88 @param[in] ImageHandle Handle to the Image (NULL if Internal).
89 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
90 **/
91 SHELL_STATUS
92 EFIAPI
93 ShellCommandRunFor (
94 IN EFI_HANDLE ImageHandle,
95 IN EFI_SYSTEM_TABLE *SystemTable
96 );
97
98 /**
99 Function for 'endfor' command.
100
101 @param[in] ImageHandle Handle to the Image (NULL if Internal).
102 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
103 **/
104 SHELL_STATUS
105 EFIAPI
106 ShellCommandRunEndFor (
107 IN EFI_HANDLE ImageHandle,
108 IN EFI_SYSTEM_TABLE *SystemTable
109 );
110
111 /**
112 Function for 'if' command.
113
114 @param[in] ImageHandle Handle to the Image (NULL if Internal).
115 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
116 **/
117 SHELL_STATUS
118 EFIAPI
119 ShellCommandRunIf (
120 IN EFI_HANDLE ImageHandle,
121 IN EFI_SYSTEM_TABLE *SystemTable
122 );
123
124 /**
125 Function for 'goto' command.
126
127 @param[in] ImageHandle Handle to the Image (NULL if Internal).
128 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
129 **/
130 SHELL_STATUS
131 EFIAPI
132 ShellCommandRunGoto (
133 IN EFI_HANDLE ImageHandle,
134 IN EFI_SYSTEM_TABLE *SystemTable
135 );
136
137 /**
138 Function for 'shift' command.
139
140 @param[in] ImageHandle Handle to the Image (NULL if Internal).
141 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
142 **/
143 SHELL_STATUS
144 EFIAPI
145 ShellCommandRunShift (
146 IN EFI_HANDLE ImageHandle,
147 IN EFI_SYSTEM_TABLE *SystemTable
148 );
149
150
151 /**
152 Function for 'else' command.
153
154 @param[in] ImageHandle Handle to the Image (NULL if Internal).
155 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
156 **/
157 SHELL_STATUS
158 EFIAPI
159 ShellCommandRunElse (
160 IN EFI_HANDLE ImageHandle,
161 IN EFI_SYSTEM_TABLE *SystemTable
162 );
163
164 ///
165 /// Function prototype for BOTH GetNextNode and GetPreviousNode...
166 /// This is used to control the MoveToTag function direction...
167 ///
168 typedef
169 LIST_ENTRY *
170 (EFIAPI *LIST_MANIP_FUNC)(
171 IN CONST LIST_ENTRY *List,
172 IN CONST LIST_ENTRY *Node
173 );
174
175 /**
176 Move the script pointer from 1 tag (line) to another.
177
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.
180
181 DecrementerTag and IncrementerTag are used to get around for/endfor and
182 similar paired types where the entire middle should be ignored.
183
184 If label is used it will be used instead of the count.
185
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
193 location.
194 @param[in] FindOnly TRUE to not change the ScriptFile.
195 @param[in] WrapAroundScript TRUE to wrap end-to-begining or vise versa in
196 searching.
197 **/
198 BOOLEAN
199 EFIAPI
200 MoveToTag (
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
209 );
210
211 #endif
212