]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | \r | |
3 | This print protocol defines six basic print functions to \r | |
4 | print the format unicode and ascii string.\r | |
5 | \r | |
6 | Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>\r | |
7 | This program and the accompanying materials are licensed and made available under \r | |
8 | the terms and conditions of the BSD License that accompanies this distribution. \r | |
9 | The full text of the license may be found at\r | |
10 | http://opensource.org/licenses/bsd-license.php. \r | |
11 | \r | |
12 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
13 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
14 | \r | |
15 | **/\r | |
16 | \r | |
17 | #ifndef __PPRINT2_H__\r | |
18 | #define __PPRINT2_H__\r | |
19 | \r | |
20 | #define EFI_PRINT2_PROTOCOL_GUID \\r | |
21 | { 0xf05976ef, 0x83f1, 0x4f3d, { 0x86, 0x19, 0xf7, 0x59, 0x5d, 0x41, 0xe5, 0x38 } }\r | |
22 | \r | |
23 | //\r | |
24 | // Forward reference for pure ANSI compatability\r | |
25 | //\r | |
26 | typedef struct _EFI_PRINT2_PROTOCOL EFI_PRINT2_PROTOCOL;\r | |
27 | \r | |
28 | /**\r | |
29 | Produces a Null-terminated Unicode string in an output buffer based on\r | |
30 | a Null-terminated Unicode format string and a BASE_LIST argument list.\r | |
31 | \r | |
32 | Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer\r | |
33 | and BufferSize.\r | |
34 | The Unicode string is produced by parsing the format string specified by FormatString.\r | |
35 | Arguments are pulled from the variable argument list specified by Marker based on the\r | |
36 | contents of the format string.\r | |
37 | The number of Unicode characters in the produced output buffer is returned not including\r | |
38 | the Null-terminator.\r | |
39 | \r | |
40 | If StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().\r | |
41 | If FormatString is not aligned on a 16-bit boundary, then ASSERT().\r | |
42 | \r | |
43 | If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is\r | |
44 | unmodified and 0 is returned.\r | |
45 | If BufferSize > 1 and FormatString is NULL, then ASSERT(). Also, the output buffer is\r | |
46 | unmodified and 0 is returned.\r | |
47 | If PcdMaximumUnicodeStringLength is not zero, and BufferSize >\r | |
48 | (PcdMaximumUnicodeStringLength * sizeof (CHAR16) + 1), then ASSERT(). Also, the output\r | |
49 | buffer is unmodified and 0 is returned.\r | |
50 | If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than\r | |
51 | PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then\r | |
52 | ASSERT(). Also, the output buffer is unmodified and 0 is returned.\r | |
53 | \r | |
54 | If BufferSize is 0 or 1, then the output buffer is unmodified and 0 is returned.\r | |
55 | \r | |
56 | @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated\r | |
57 | Unicode string.\r | |
58 | @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.\r | |
59 | @param FormatString A Null-terminated Unicode format string.\r | |
60 | @param Marker BASE_LIST marker for the variable argument list.\r | |
61 | \r | |
62 | @return The number of Unicode characters in the produced output buffer not including the\r | |
63 | Null-terminator.\r | |
64 | \r | |
65 | **/\r | |
66 | typedef\r | |
67 | UINTN\r | |
68 | (EFIAPI *UNICODE_BS_PRINT)(\r | |
69 | OUT CHAR16 *StartOfBuffer,\r | |
70 | IN UINTN BufferSize,\r | |
71 | IN CONST CHAR16 *FormatString,\r | |
72 | IN BASE_LIST Marker\r | |
73 | );\r | |
74 | \r | |
75 | /**\r | |
76 | Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated\r | |
77 | Unicode format string and variable argument list.\r | |
78 | \r | |
79 | This function is similar as snprintf_s defined in C11.\r | |
80 | \r | |
81 | Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer\r | |
82 | and BufferSize.\r | |
83 | The Unicode string is produced by parsing the format string specified by FormatString.\r | |
84 | Arguments are pulled from the variable argument list based on the contents of the format string.\r | |
85 | The number of Unicode characters in the produced output buffer is returned not including\r | |
86 | the Null-terminator.\r | |
87 | \r | |
88 | If StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().\r | |
89 | If FormatString is not aligned on a 16-bit boundary, then ASSERT().\r | |
90 | \r | |
91 | If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is\r | |
92 | unmodified and 0 is returned.\r | |
93 | If BufferSize > 1 and FormatString is NULL, then ASSERT(). Also, the output buffer is\r | |
94 | unmodified and 0 is returned.\r | |
95 | If PcdMaximumUnicodeStringLength is not zero, and BufferSize >\r | |
96 | (PcdMaximumUnicodeStringLength * sizeof (CHAR16) + 1), then ASSERT(). Also, the output\r | |
97 | buffer is unmodified and 0 is returned.\r | |
98 | If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than\r | |
99 | PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then\r | |
100 | ASSERT(). Also, the output buffer is unmodified and 0 is returned.\r | |
101 | \r | |
102 | If BufferSize is 0 or 1, then the output buffer is unmodified and 0 is returned.\r | |
103 | \r | |
104 | @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated\r | |
105 | Unicode string.\r | |
106 | @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.\r | |
107 | @param FormatString A Null-terminated Unicode format string.\r | |
108 | @param ... Variable argument list whose contents are accessed based on the\r | |
109 | format string specified by FormatString.\r | |
110 | \r | |
111 | @return The number of Unicode characters in the produced output buffer not including the\r | |
112 | Null-terminator.\r | |
113 | \r | |
114 | **/\r | |
115 | typedef\r | |
116 | UINTN\r | |
117 | (EFIAPI *UNICODE_S_PRINT)(\r | |
118 | OUT CHAR16 *StartOfBuffer,\r | |
119 | IN UINTN BufferSize,\r | |
120 | IN CONST CHAR16 *FormatString,\r | |
121 | ...\r | |
122 | );\r | |
123 | \r | |
124 | /**\r | |
125 | Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated\r | |
126 | ASCII format string and a BASE_LIST argument list.\r | |
127 | \r | |
128 | Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer\r | |
129 | and BufferSize.\r | |
130 | The Unicode string is produced by parsing the format string specified by FormatString.\r | |
131 | Arguments are pulled from the variable argument list specified by Marker based on the\r | |
132 | contents of the format string.\r | |
133 | The number of Unicode characters in the produced output buffer is returned not including\r | |
134 | the Null-terminator.\r | |
135 | \r | |
136 | If StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().\r | |
137 | \r | |
138 | If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is\r | |
139 | unmodified and 0 is returned.\r | |
140 | If BufferSize > 1 and FormatString is NULL, then ASSERT(). Also, the output buffer is\r | |
141 | unmodified and 0 is returned.\r | |
142 | If PcdMaximumUnicodeStringLength is not zero, and BufferSize >\r | |
143 | (PcdMaximumUnicodeStringLength * sizeof (CHAR16) + 1), then ASSERT(). Also, the output\r | |
144 | buffer is unmodified and 0 is returned.\r | |
145 | If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than\r | |
146 | PcdMaximumAsciiStringLength Ascii characters not including the Null-terminator, then\r | |
147 | ASSERT(). Also, the output buffer is unmodified and 0 is returned.\r | |
148 | \r | |
149 | If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.\r | |
150 | \r | |
151 | @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated\r | |
152 | Unicode string.\r | |
153 | @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.\r | |
154 | @param FormatString A Null-terminated ASCII format string.\r | |
155 | @param Marker BASE_LIST marker for the variable argument list.\r | |
156 | \r | |
157 | @return The number of Unicode characters in the produced output buffer not including the\r | |
158 | Null-terminator.\r | |
159 | \r | |
160 | **/\r | |
161 | typedef\r | |
162 | UINTN\r | |
163 | (EFIAPI *UNICODE_BS_PRINT_ASCII_FORMAT)(\r | |
164 | OUT CHAR16 *StartOfBuffer,\r | |
165 | IN UINTN BufferSize,\r | |
166 | IN CONST CHAR8 *FormatString,\r | |
167 | IN BASE_LIST Marker\r | |
168 | );\r | |
169 | \r | |
170 | /**\r | |
171 | Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated\r | |
172 | ASCII format string and variable argument list.\r | |
173 | \r | |
174 | This function is similar as snprintf_s defined in C11.\r | |
175 | \r | |
176 | Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer\r | |
177 | and BufferSize.\r | |
178 | The Unicode string is produced by parsing the format string specified by FormatString.\r | |
179 | Arguments are pulled from the variable argument list based on the contents of the\r | |
180 | format string.\r | |
181 | The number of Unicode characters in the produced output buffer is returned not including\r | |
182 | the Null-terminator.\r | |
183 | \r | |
184 | If StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().\r | |
185 | \r | |
186 | If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is\r | |
187 | unmodified and 0 is returned.\r | |
188 | If BufferSize > 1 and FormatString is NULL, then ASSERT(). Also, the output buffer is\r | |
189 | unmodified and 0 is returned.\r | |
190 | If PcdMaximumUnicodeStringLength is not zero, and BufferSize >\r | |
191 | (PcdMaximumUnicodeStringLength * sizeof (CHAR16) + 1), then ASSERT(). Also, the output\r | |
192 | buffer is unmodified and 0 is returned.\r | |
193 | If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than\r | |
194 | PcdMaximumAsciiStringLength Ascii characters not including the Null-terminator, then\r | |
195 | ASSERT(). Also, the output buffer is unmodified and 0 is returned.\r | |
196 | \r | |
197 | If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.\r | |
198 | \r | |
199 | @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated\r | |
200 | Unicode string.\r | |
201 | @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.\r | |
202 | @param FormatString A Null-terminated ASCII format string.\r | |
203 | @param ... Variable argument list whose contents are accessed based on the\r | |
204 | format string specified by FormatString.\r | |
205 | \r | |
206 | @return The number of Unicode characters in the produced output buffer not including the\r | |
207 | Null-terminator.\r | |
208 | \r | |
209 | **/\r | |
210 | typedef\r | |
211 | UINTN\r | |
212 | (EFIAPI *UNICODE_S_PRINT_ASCII_FORMAT)(\r | |
213 | OUT CHAR16 *StartOfBuffer,\r | |
214 | IN UINTN BufferSize,\r | |
215 | IN CONST CHAR8 *FormatString,\r | |
216 | ...\r | |
217 | );\r | |
218 | \r | |
219 | /**\r | |
220 | Converts a decimal value to a Null-terminated Unicode string.\r | |
221 | \r | |
222 | Converts the decimal number specified by Value to a Null-terminated Unicode \r | |
223 | string specified by Buffer containing at most Width characters. No padding of spaces \r | |
224 | is ever performed. If Width is 0, then a width of MAXIMUM_VALUE_CHARACTERS is assumed.\r | |
225 | This function returns the number of Unicode characters in Buffer, not including\r | |
226 | the Null-terminator.\r | |
227 | If the conversion contains more than Width characters, this function returns \r | |
228 | the first Width characters in the conversion, along with the total number of characters in the conversion.\r | |
229 | Additional conversion parameters are specified in Flags. \r | |
230 | \r | |
231 | The Flags bit LEFT_JUSTIFY is always ignored.\r | |
232 | All conversions are left justified in Buffer.\r | |
233 | If Width is 0, PREFIX_ZERO is ignored in Flags.\r | |
234 | If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and commas\r | |
235 | are inserted every 3rd digit starting from the right.\r | |
236 | If RADIX_HEX is set in Flags, then the output buffer will be \r | |
237 | formatted in hexadecimal format.\r | |
238 | If Value is < 0 and RADIX_HEX is not set in Flags, then the fist character in Buffer is a '-'.\r | |
239 | If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored, \r | |
240 | then Buffer is padded with '0' characters so the combination of the optional '-' \r | |
241 | sign character, '0' characters, digit characters for Value, and the Null-terminator\r | |
242 | add up to Width characters.\r | |
243 | If both COMMA_TYPE and RADIX_HEX are set in Flags, then ASSERT().\r | |
244 | If Buffer is NULL, then ASSERT().\r | |
245 | If Buffer is not aligned on a 16-bit boundary, then ASSERT().\r | |
246 | If unsupported bits are set in Flags, then ASSERT().\r | |
247 | If both COMMA_TYPE and RADIX_HEX are set in Flags, then ASSERT().\r | |
248 | If Width >= MAXIMUM_VALUE_CHARACTERS, then ASSERT()\r | |
249 | \r | |
250 | @param Buffer The pointer to the output buffer for the produced Null-terminated\r | |
251 | Unicode string.\r | |
252 | @param Flags The bitmask of flags that specify left justification, zero pad, and commas.\r | |
253 | @param Value The 64-bit signed value to convert to a string.\r | |
254 | @param Width The maximum number of Unicode characters to place in Buffer, not including\r | |
255 | the Null-terminator.\r | |
256 | \r | |
257 | @return The number of Unicode characters in Buffer not including the Null-terminator.\r | |
258 | \r | |
259 | **/\r | |
260 | typedef\r | |
261 | UINTN\r | |
262 | (EFIAPI *UNICODE_VALUE_TO_STRING)(\r | |
263 | IN OUT CHAR16 *Buffer,\r | |
264 | IN UINTN Flags,\r | |
265 | IN INT64 Value,\r | |
266 | IN UINTN Width\r | |
267 | );\r | |
268 | \r | |
269 | /**\r | |
270 | Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated\r | |
271 | ASCII format string and a BASE_LIST argument list.\r | |
272 | \r | |
273 | Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer\r | |
274 | and BufferSize.\r | |
275 | The ASCII string is produced by parsing the format string specified by FormatString.\r | |
276 | Arguments are pulled from the variable argument list specified by Marker based on\r | |
277 | the contents of the format string.\r | |
278 | The number of ASCII characters in the produced output buffer is returned not including\r | |
279 | the Null-terminator.\r | |
280 | \r | |
281 | If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is\r | |
282 | unmodified and 0 is returned.\r | |
283 | If BufferSize > 0 and FormatString is NULL, then ASSERT(). Also, the output buffer is\r | |
284 | unmodified and 0 is returned.\r | |
285 | If PcdMaximumAsciiStringLength is not zero, and BufferSize >\r | |
286 | (PcdMaximumAsciiStringLength * sizeof (CHAR8)), then ASSERT(). Also, the output buffer\r | |
287 | is unmodified and 0 is returned.\r | |
288 | If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than\r | |
289 | PcdMaximumAsciiStringLength Ascii characters not including the Null-terminator, then\r | |
290 | ASSERT(). Also, the output buffer is unmodified and 0 is returned.\r | |
291 | \r | |
292 | If BufferSize is 0, then no output buffer is produced and 0 is returned.\r | |
293 | \r | |
294 | @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated\r | |
295 | ASCII string.\r | |
296 | @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.\r | |
297 | @param FormatString A Null-terminated ASCII format string.\r | |
298 | @param Marker BASE_LIST marker for the variable argument list.\r | |
299 | \r | |
300 | @return The number of ASCII characters in the produced output buffer not including the\r | |
301 | Null-terminator.\r | |
302 | \r | |
303 | **/\r | |
304 | typedef\r | |
305 | UINTN\r | |
306 | (EFIAPI *ASCII_BS_PRINT)(\r | |
307 | OUT CHAR8 *StartOfBuffer,\r | |
308 | IN UINTN BufferSize,\r | |
309 | IN CONST CHAR8 *FormatString,\r | |
310 | IN BASE_LIST Marker\r | |
311 | );\r | |
312 | \r | |
313 | /**\r | |
314 | Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated\r | |
315 | ASCII format string and variable argument list.\r | |
316 | \r | |
317 | This function is similar as snprintf_s defined in C11.\r | |
318 | \r | |
319 | Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer\r | |
320 | and BufferSize.\r | |
321 | The ASCII string is produced by parsing the format string specified by FormatString.\r | |
322 | Arguments are pulled from the variable argument list based on the contents of the\r | |
323 | format string.\r | |
324 | The number of ASCII characters in the produced output buffer is returned not including\r | |
325 | the Null-terminator.\r | |
326 | \r | |
327 | If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is\r | |
328 | unmodified and 0 is returned.\r | |
329 | If BufferSize > 0 and FormatString is NULL, then ASSERT(). Also, the output buffer is\r | |
330 | unmodified and 0 is returned.\r | |
331 | If PcdMaximumAsciiStringLength is not zero, and BufferSize >\r | |
332 | (PcdMaximumAsciiStringLength * sizeof (CHAR8)), then ASSERT(). Also, the output buffer\r | |
333 | is unmodified and 0 is returned.\r | |
334 | If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than\r | |
335 | PcdMaximumAsciiStringLength Ascii characters not including the Null-terminator, then\r | |
336 | ASSERT(). Also, the output buffer is unmodified and 0 is returned.\r | |
337 | \r | |
338 | If BufferSize is 0, then no output buffer is produced and 0 is returned.\r | |
339 | \r | |
340 | @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated\r | |
341 | ASCII string.\r | |
342 | @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.\r | |
343 | @param FormatString A Null-terminated ASCII format string.\r | |
344 | @param ... Variable argument list whose contents are accessed based on the\r | |
345 | format string specified by FormatString.\r | |
346 | \r | |
347 | @return The number of ASCII characters in the produced output buffer not including the\r | |
348 | Null-terminator.\r | |
349 | \r | |
350 | **/\r | |
351 | typedef\r | |
352 | UINTN\r | |
353 | (EFIAPI *ASCII_S_PRINT)(\r | |
354 | OUT CHAR8 *StartOfBuffer,\r | |
355 | IN UINTN BufferSize,\r | |
356 | IN CONST CHAR8 *FormatString,\r | |
357 | ...\r | |
358 | );\r | |
359 | \r | |
360 | /**\r | |
361 | Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated\r | |
362 | Unicode format string and a BASE_LIST argument list.\r | |
363 | \r | |
364 | Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer\r | |
365 | and BufferSize.\r | |
366 | The ASCII string is produced by parsing the format string specified by FormatString.\r | |
367 | Arguments are pulled from the variable argument list specified by Marker based on\r | |
368 | the contents of the format string.\r | |
369 | The number of ASCII characters in the produced output buffer is returned not including\r | |
370 | the Null-terminator.\r | |
371 | \r | |
372 | If FormatString is not aligned on a 16-bit boundary, then ASSERT().\r | |
373 | \r | |
374 | If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is\r | |
375 | unmodified and 0 is returned.\r | |
376 | If BufferSize > 0 and FormatString is NULL, then ASSERT(). Also, the output buffer is\r | |
377 | unmodified and 0 is returned.\r | |
378 | If PcdMaximumAsciiStringLength is not zero, and BufferSize >\r | |
379 | (PcdMaximumAsciiStringLength * sizeof (CHAR8)), then ASSERT(). Also, the output buffer\r | |
380 | is unmodified and 0 is returned.\r | |
381 | If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than\r | |
382 | PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then\r | |
383 | ASSERT(). Also, the output buffer is unmodified and 0 is returned.\r | |
384 | \r | |
385 | If BufferSize is 0, then no output buffer is produced and 0 is returned.\r | |
386 | \r | |
387 | @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated\r | |
388 | ASCII string.\r | |
389 | @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.\r | |
390 | @param FormatString A Null-terminated Unicode format string.\r | |
391 | @param Marker BASE_LIST marker for the variable argument list.\r | |
392 | \r | |
393 | @return The number of ASCII characters in the produced output buffer not including the\r | |
394 | Null-terminator.\r | |
395 | \r | |
396 | **/\r | |
397 | typedef\r | |
398 | UINTN\r | |
399 | (EFIAPI *ASCII_BS_PRINT_UNICODE_FORMAT)(\r | |
400 | OUT CHAR8 *StartOfBuffer,\r | |
401 | IN UINTN BufferSize,\r | |
402 | IN CONST CHAR16 *FormatString,\r | |
403 | IN BASE_LIST Marker\r | |
404 | );\r | |
405 | \r | |
406 | /**\r | |
407 | Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated\r | |
408 | Unicode format string and variable argument list.\r | |
409 | \r | |
410 | This function is similar as snprintf_s defined in C11.\r | |
411 | \r | |
412 | Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer\r | |
413 | and BufferSize.\r | |
414 | The ASCII string is produced by parsing the format string specified by FormatString.\r | |
415 | Arguments are pulled from the variable argument list based on the contents of the\r | |
416 | format string.\r | |
417 | The number of ASCII characters in the produced output buffer is returned not including\r | |
418 | the Null-terminator.\r | |
419 | \r | |
420 | If FormatString is not aligned on a 16-bit boundary, then ASSERT().\r | |
421 | \r | |
422 | If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is\r | |
423 | unmodified and 0 is returned.\r | |
424 | If BufferSize > 0 and FormatString is NULL, then ASSERT(). Also, the output buffer is\r | |
425 | unmodified and 0 is returned.\r | |
426 | If PcdMaximumAsciiStringLength is not zero, and BufferSize >\r | |
427 | (PcdMaximumAsciiStringLength * sizeof (CHAR8)), then ASSERT(). Also, the output buffer\r | |
428 | is unmodified and 0 is returned.\r | |
429 | If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than\r | |
430 | PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then\r | |
431 | ASSERT(). Also, the output buffer is unmodified and 0 is returned.\r | |
432 | \r | |
433 | If BufferSize is 0, then no output buffer is produced and 0 is returned.\r | |
434 | \r | |
435 | @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated\r | |
436 | ASCII string.\r | |
437 | @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.\r | |
438 | @param FormatString A Null-terminated Unicode format string.\r | |
439 | @param ... Variable argument list whose contents are accessed based on the\r | |
440 | format string specified by FormatString.\r | |
441 | \r | |
442 | @return The number of ASCII characters in the produced output buffer not including the\r | |
443 | Null-terminator.\r | |
444 | \r | |
445 | **/\r | |
446 | typedef\r | |
447 | UINTN\r | |
448 | (EFIAPI *ASCII_S_PRINT_UNICODE_FORMAT)(\r | |
449 | OUT CHAR8 *StartOfBuffer,\r | |
450 | IN UINTN BufferSize,\r | |
451 | IN CONST CHAR16 *FormatString,\r | |
452 | ...\r | |
453 | );\r | |
454 | \r | |
455 | /**\r | |
456 | Converts a decimal value to a Null-terminated ASCII string.\r | |
457 | \r | |
458 | Converts the decimal number specified by Value to a Null-terminated ASCII string \r | |
459 | specified by Buffer containing at most Width characters. No padding of spaces is ever performed.\r | |
460 | If Width is 0 then a width of MAXIMUM_VALUE_CHARACTERS is assumed.\r | |
461 | The number of ASCII characters in Buffer is returned not including the Null-terminator.\r | |
462 | If the conversion contains more than Width characters, then only the first Width\r | |
463 | characters are returned, and the total number of characters required to perform\r | |
464 | the conversion is returned.\r | |
465 | Additional conversion parameters are specified in Flags. \r | |
466 | The Flags bit LEFT_JUSTIFY is always ignored.\r | |
467 | All conversions are left justified in Buffer.\r | |
468 | If Width is 0, PREFIX_ZERO is ignored in Flags.\r | |
469 | If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and commas\r | |
470 | are inserted every 3rd digit starting from the right.\r | |
471 | If RADIX_HEX is set in Flags, then the output buffer will be \r | |
472 | formatted in hexadecimal format.\r | |
473 | If Value is < 0 and RADIX_HEX is not set in Flags, then the fist character in Buffer is a '-'.\r | |
474 | If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored, \r | |
475 | then Buffer is padded with '0' characters so the combination of the optional '-' \r | |
476 | sign character, '0' characters, digit characters for Value, and the Null-terminator\r | |
477 | add up to Width characters.\r | |
478 | \r | |
479 | If Buffer is NULL, then ASSERT().\r | |
480 | If unsupported bits are set in Flags, then ASSERT().\r | |
481 | If both COMMA_TYPE and RADIX_HEX are set in Flags, then ASSERT().\r | |
482 | If Width >= MAXIMUM_VALUE_CHARACTERS, then ASSERT()\r | |
483 | \r | |
484 | @param Buffer The pointer to the output buffer for the produced Null-terminated\r | |
485 | ASCII string.\r | |
486 | @param Flags The bitmask of flags that specify left justification, zero pad, and commas.\r | |
487 | @param Value The 64-bit signed value to convert to a string.\r | |
488 | @param Width The maximum number of ASCII characters to place in Buffer, not including\r | |
489 | the Null-terminator.\r | |
490 | \r | |
491 | @return The number of ASCII characters in Buffer not including the Null-terminator.\r | |
492 | \r | |
493 | **/\r | |
494 | typedef\r | |
495 | UINTN\r | |
496 | (EFIAPI *ASCII_VALUE_TO_STRING)(\r | |
497 | OUT CHAR8 *Buffer,\r | |
498 | IN UINTN Flags,\r | |
499 | IN INT64 Value,\r | |
500 | IN UINTN Width\r | |
501 | );\r | |
502 | \r | |
503 | struct _EFI_PRINT2_PROTOCOL {\r | |
504 | UNICODE_BS_PRINT UnicodeBSPrint;\r | |
505 | UNICODE_S_PRINT UnicodeSPrint;\r | |
506 | UNICODE_BS_PRINT_ASCII_FORMAT UnicodeBSPrintAsciiFormat;\r | |
507 | UNICODE_S_PRINT_ASCII_FORMAT UnicodeSPrintAsciiFormat;\r | |
508 | UNICODE_VALUE_TO_STRING UnicodeValueToString;\r | |
509 | ASCII_BS_PRINT AsciiBSPrint;\r | |
510 | ASCII_S_PRINT AsciiSPrint;\r | |
511 | ASCII_BS_PRINT_UNICODE_FORMAT AsciiBSPrintUnicodeFormat;\r | |
512 | ASCII_S_PRINT_UNICODE_FORMAT AsciiSPrintUnicodeFormat;\r | |
513 | ASCII_VALUE_TO_STRING AsciiValueToString;\r | |
514 | };\r | |
515 | \r | |
516 | extern EFI_GUID gEfiPrint2ProtocolGuid;\r | |
517 | \r | |
518 | #endif\r |