]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiPrintLib.h
1) Sync EdkCompatibilityPkg with EDK 1.04. The changes includes:
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / Dxe / Include / EfiPrintLib.h
CommitLineData
3eb9473e 1/*++\r
2\r
3Copyright (c) 2004 - 2006, Intel Corporation \r
4All rights reserved. This program and the accompanying materials \r
5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12Module Name:\r
13\r
14 EfiPrintLib.h\r
15\r
16Abstract:\r
17\r
18 Light weight lib to support EFI drivers.\r
19\r
20--*/\r
21\r
22#ifndef _EFI_PRINT_LIB_H_\r
23#define _EFI_PRINT_LIB_H_\r
24\r
25#include EFI_PROTOCOL_DEFINITION(GraphicsOutput)\r
26#include EFI_PROTOCOL_DEFINITION(UgaDraw)\r
27#include EFI_PROTOCOL_DEFINITION(Print)\r
28\r
29UINTN\r
30ErrorPrint (\r
31 IN CONST CHAR16 *ErrorString,\r
32 IN CONST CHAR8 *Format,\r
33 ...\r
34 )\r
35/*++\r
36\r
37Routine Description:\r
38\r
39 Print function for a maximum of EFI_DRIVER_LIB_MAX_PRINT_BUFFER ascii \r
40 characters.\r
41\r
42Arguments:\r
43\r
44 ErrorString - Error message printed first\r
45\r
46 Format - Ascii format string see file header for more details.\r
47\r
48 ... - Vararg list consumed by processing Format.\r
49\r
50Returns: \r
51\r
52 Number of characters printed.\r
53\r
54--*/\r
55;\r
56\r
57VOID\r
58ErrorDumpHex (\r
59 IN UINTN Indent,\r
60 IN UINTN Offset,\r
61 IN UINTN DataSize,\r
62 IN VOID *UserData\r
63 )\r
64/*++\r
65\r
66Routine Description:\r
67\r
68 Dump error info by hex.\r
69\r
70Arguments:\r
71\r
72 Indent - Indent number\r
73 Offset - Offset number\r
74 DataSize - Size of user data\r
75 UserData - User data to dump\r
76\r
77Returns:\r
78\r
79 None\r
80\r
81--*/\r
82;\r
83\r
84UINTN\r
85Print (\r
86 IN CONST CHAR16 *Format,\r
87 ...\r
88 )\r
89/*++\r
90\r
91Routine Description:\r
92\r
93 Prints a formatted unicode string to the default console\r
94\r
95Arguments:\r
96\r
97 fmt - Format string\r
98\r
99Returns:\r
100\r
101 Length of string printed to the console\r
102\r
103--*/\r
104;\r
105\r
106UINTN\r
107PrintXY (\r
108 IN UINTN X,\r
109 IN UINTN Y,\r
110 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Foreground, OPTIONAL\r
111 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Background, OPTIONAL\r
112 IN CHAR16 *Fmt,\r
113 ...\r
114 )\r
115/*++\r
116\r
117Routine Description:\r
118\r
119 Prints a formatted unicode string to the default console\r
120\r
121Arguments:\r
122\r
123 X - X coordinate to start printing\r
124 \r
125 Y - Y coordinate to start printing\r
126 \r
127 ForeGround - Foreground color\r
128 \r
129 BackGround - Background color\r
130\r
131 Fmt - Format string\r
132 \r
133 ... - Print arguments\r
134\r
135Returns:\r
136\r
137 Length of string printed to the console\r
138\r
139--*/\r
140;\r
141\r
142UINTN\r
143Aprint (\r
144 IN CONST CHAR8 *Format,\r
145 ...\r
146 )\r
147/*++\r
148\r
149Routine Description:\r
150\r
151 Print function for a maximum of EFI_DRIVER_LIB_MAX_PRINT_BUFFER ascii \r
152 characters.\r
153\r
154Arguments:\r
155\r
156 Format - Ascii format string see file header for more details.\r
157\r
158 ... - Vararg list consumed by processing Format.\r
159\r
160Returns: \r
161\r
162 Number of characters printed.\r
163\r
164--*/\r
165;\r
166\r
167UINTN\r
168UPrint (\r
169 IN CONST CHAR16 *Format,\r
170 ...\r
171 )\r
172/*++\r
173\r
174Routine Description:\r
175\r
176 Print function for a maximum of EFI_DRIVER_LIB_MAX_PRINT_BUFFER ascii \r
177 characters.\r
178\r
179Arguments:\r
180\r
181 Format - Ascii format string see file header for more details.\r
182\r
183 ... - Vararg list consumed by processing Format.\r
184\r
185Returns: \r
186\r
187 Number of characters printed.\r
188\r
189--*/\r
190;\r
191\r
192UINTN\r
193VSPrint (\r
194 OUT CHAR16 *StartOfBuffer,\r
195 IN UINTN StrLen,\r
196 IN CONST CHAR16 *Format,\r
197 IN VA_LIST Marker\r
198 )\r
199/*++\r
200\r
201Routine Description:\r
202\r
203 Prints a formatted unicode string to a buffer\r
204\r
205Arguments:\r
206\r
207 StartOfBuffer - Output buffer to print the formatted string into\r
208 StrLen - Size of Str. String is truncated to this size.\r
209 A size of 0 means there is no limit\r
210 Format - The format string\r
211 Marker - Vararg list consumed by processing Format.\r
212\r
213Returns:\r
214\r
215 String length returned in buffer\r
216\r
217--*/\r
218;\r
219\r
220UINTN\r
221SPrint (\r
222 OUT CHAR16 *Buffer,\r
223 IN UINTN BufferSize,\r
224 IN CONST CHAR16 *Format,\r
225 ...\r
226 )\r
227/*++\r
228\r
229Routine Description:\r
230\r
231 SPrint function to process format and place the results in Buffer.\r
232\r
233Arguments:\r
234\r
235 Buffer - Wide char buffer to print the results of the parsing of Format into.\r
236\r
237 BufferSize - Maximum number of characters to put into buffer. Zero means no \r
238 limit.\r
239\r
240 Format - Format string see file header for more details.\r
241\r
242 ... - Vararg list consumed by processing Format.\r
243\r
244Returns: \r
245\r
246 Number of characters printed.\r
247\r
248--*/\r
249;\r
250\r
251//\r
252// BoxDraw support\r
253//\r
254BOOLEAN\r
255IsValidEfiCntlChar (\r
256 IN CHAR16 CharC\r
257 )\r
258/*++\r
259\r
260Routine Description:\r
261\r
262 Test whether a wide char is a valid control char.\r
263\r
264Arguments:\r
265\r
266 CharC - A char\r
267\r
268Returns:\r
269\r
270 TRUE - A control char\r
271 \r
272 FALSE - Not a control char\r
273\r
274--*/\r
275;\r
276\r
277BOOLEAN\r
278IsValidAscii (\r
279 IN CHAR16 Ascii\r
280 )\r
281/*++\r
282\r
283Routine Description:\r
284\r
285 Test whether a wide char is a normal printable char\r
286\r
287Arguments:\r
288\r
289 Ascii - A char\r
290\r
291Returns:\r
292\r
293 True - A normal, printable char\r
294 FALSE - Not a normal, printable char\r
295\r
296--*/\r
297;\r
298\r
299BOOLEAN\r
300LibIsValidTextGraphics (\r
301 IN CHAR16 Graphic,\r
302 OUT CHAR8 *PcAnsi, OPTIONAL\r
303 OUT CHAR8 *Ascii OPTIONAL\r
304 )\r
305/*++\r
306\r
307Routine Description:\r
308\r
309 Detects if a Unicode char is for Box Drawing text graphics.\r
310\r
311Arguments:\r
312\r
313 Graphic - Unicode char to test.\r
314\r
315 PcAnsi - Optional pointer to return PCANSI equivalent of Graphic.\r
316\r
317 Ascii - Optional pointer to return Ascii equivalent of Graphic.\r
318\r
319Returns:\r
320\r
321 TRUE if Gpaphic is a supported Unicode Box Drawing character.\r
322\r
323--*/\r
324;\r
325\r
326#endif\r