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