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