]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdePkg/Include/Library/PrintLib.h
MdePkg: Clean up source files
[mirror_edk2.git] / MdePkg / Include / Library / PrintLib.h
... / ...
CommitLineData
1/** @file\r
2 Provides services to print a formatted string to a buffer. All combinations of\r
3 Unicode and ASCII strings are supported.\r
4\r
5Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
6This program and the accompanying materials are licensed and made available under\r
7the terms and conditions of the BSD License that accompanies this distribution.\r
8The full text of the license may be found at\r
9http://opensource.org/licenses/bsd-license.php.\r
10\r
11THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
14 The Print Library functions provide a simple means to produce formatted output\r
15 strings. Many of the output functions use a format string to describe how to\r
16 format the output of variable arguments. The format string consists of normal\r
17 text and argument descriptors. There are no restrictions for how the normal\r
18 text and argument descriptors can be mixed. The following end of line(EOL)\r
19 translations must be performed on the contents of the format string:\r
20\r
21 - '\\r' is translated to '\\r'\r
22 - '\\r\\n' is translated to '\\r\\n'\r
23 - '\\n' is translated to '\\r\\n'\r
24 - '\\n\\r' is translated to '\\r\\n'\r
25\r
26 This does not follow the ANSI C standard for sprint(). The format of argument\r
27 descriptors is described below. The ANSI C standard for sprint() has been\r
28 followed for some of the format types, and has not been followed for others.\r
29 The exceptions are noted below.\r
30\r
31 %[flags][width][.precision]type\r
32\r
33 [flags]:\r
34 - -\r
35 - The field is left justified. If not flag is not specified, then the\r
36 field is right justified.\r
37 - space\r
38 - Prefix a space character to a number. Only valid for types X, x, and d.\r
39 - +\r
40 - Prefix a plus character to a number. Only valid for types X, x, and d.\r
41 If both space and + are specified, then space is ignored.\r
42 - 0\r
43 - Pad with 0 characters to the left of a number. Only valid for types\r
44 X, x, and d.\r
45 - ,\r
46 - Place a comma every 3rd digit of the number. Only valid for type d.\r
47 If 0 is also specified, then 0 is ignored.\r
48 - L, l\r
49 - The number being printed is size UINT64. Only valid for types X, x, and d.\r
50 If this flag is not specified, then the number being printed is size int.\r
51 - NOTE: All invalid flags are ignored.\r
52\r
53 [width]:\r
54\r
55 - *\r
56 - The width of the field is specified by a UINTN argument in the\r
57 argument list.\r
58 - number\r
59 - The number specified as a decimal value represents the width of\r
60 the field.\r
61 - NOTE: If [width] is not specified, then a field width of 0 is assumed.\r
62\r
63 [.precision]:\r
64\r
65 - *\r
66 - The precision of the field is specified by a UINTN argument in the\r
67 argument list.\r
68 - number\r
69 - The number specified as a decimal value represents the precision of\r
70 the field.\r
71 - NOTE: If [.precision] is not specified, then a precision of 0 is assumed.\r
72\r
73 type:\r
74\r
75 - %\r
76 - Print a %%.\r
77 - c\r
78 - The argument is a Unicode character. ASCII characters can be printed\r
79 using this type too by making sure bits 8..15 of the argument are set to 0.\r
80 - x\r
81 - The argument is an unsigned hexadecimal number. The characters used are 0..9 and\r
82 A..F. If the flag 'L' is not specified, then the argument is assumed\r
83 to be size int. This does not follow ANSI C.\r
84 - X\r
85 - The argument is an unsigned hexadecimal number and the number is padded with\r
86 zeros. This is equivalent to a format string of "0x". If the flag\r
87 'L' is not specified, then the argument is assumed to be size int.\r
88 This does not follow ANSI C.\r
89 - d\r
90 - The argument is a signed decimal number. If the flag 'L' is not specified,\r
91 then the argument is assumed to be size int.\r
92 - u\r
93 - The argument is a unsigned decimal number. If the flag 'L' is not specified,\r
94 then the argument is assumed to be size int.\r
95 - p\r
96 - The argument is a pointer that is a (VOID *), and it is printed as an\r
97 unsigned hexadecimal number The characters used are 0..9 and A..F.\r
98 - a\r
99 - The argument is a pointer to an ASCII string.\r
100 This does not follow ANSI C.\r
101 - S, s\r
102 - The argument is a pointer to a Unicode string.\r
103 This does not follow ANSI C.\r
104 - g\r
105 - The argument is a pointer to a GUID structure. The GUID is printed\r
106 in the format XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX.\r
107 This does not follow ANSI C.\r
108 - t\r
109 - The argument is a pointer to an EFI_TIME structure. The time and\r
110 date are printed in the format "mm/dd/yyyy hh:mm" where mm is the\r
111 month zero padded, dd is the day zero padded, yyyy is the year zero\r
112 padded, hh is the hour zero padded, and mm is minutes zero padded.\r
113 This does not follow ANSI C.\r
114 - r\r
115 - The argument is a RETURN_STATUS value. This value is converted to\r
116 a string following the table below. This does not follow ANSI C.\r
117 - RETURN_SUCCESS\r
118 - "Success"\r
119 - RETURN_LOAD_ERROR\r
120 - "Load Error"\r
121 - RETURN_INVALID_PARAMETER\r
122 - "Invalid Parameter"\r
123 - RETURN_UNSUPPORTED\r
124 - "Unsupported"\r
125 - RETURN_BAD_BUFFER_SIZE\r
126 - "Bad Buffer Size"\r
127 - RETURN_BUFFER_TOO_SMALL\r
128 - "Buffer Too Small"\r
129 - RETURN_NOT_READY\r
130 - "Not Ready"\r
131 - RETURN_DEVICE_ERROR\r
132 - "Device Error"\r
133 - RETURN_WRITE_PROTECTED\r
134 - "Write Protected"\r
135 - RETURN_OUT_OF_RESOURCES\r
136 - "Out of Resources"\r
137 - RETURN_VOLUME_CORRUPTED\r
138 - "Volume Corrupt"\r
139 - RETURN_VOLUME_FULL\r
140 - "Volume Full"\r
141 - RETURN_NO_MEDIA\r
142 - "No Media"\r
143 - RETURN_MEDIA_CHANGED\r
144 - "Media changed"\r
145 - RETURN_NOT_FOUND\r
146 - "Not Found"\r
147 - RETURN_ACCESS_DENIED\r
148 - "Access Denied"\r
149 - RETURN_NO_RESPONSE\r
150 - "No Response"\r
151 - RETURN_NO_MAPPING\r
152 - "No mapping"\r
153 - RETURN_TIMEOUT\r
154 - "Time out"\r
155 - RETURN_NOT_STARTED\r
156 - "Not started"\r
157 - RETURN_ALREADY_STARTED\r
158 - "Already started"\r
159 - RETURN_ABORTED\r
160 - "Aborted"\r
161 - RETURN_ICMP_ERROR\r
162 - "ICMP Error"\r
163 - RETURN_TFTP_ERROR\r
164 - "TFTP Error"\r
165 - RETURN_PROTOCOL_ERROR\r
166 - "Protocol Error"\r
167 - RETURN_WARN_UNKNOWN_GLYPH\r
168 - "Warning Unknown Glyph"\r
169 - RETURN_WARN_DELETE_FAILURE\r
170 - "Warning Delete Failure"\r
171 - RETURN_WARN_WRITE_FAILURE\r
172 - "Warning Write Failure"\r
173 - RETURN_WARN_BUFFER_TOO_SMALL\r
174 - "Warning Buffer Too Small"\r
175\r
176**/\r
177\r
178#ifndef __PRINT_LIB_H__\r
179#define __PRINT_LIB_H__\r
180\r
181///\r
182/// Define the maximum number of characters that are required to\r
183/// encode with a NULL terminator a decimal, hexadecimal, GUID,\r
184/// or TIME value.\r
185///\r
186/// Maximum Length Decimal String = 28\r
187/// "-9,223,372,036,854,775,808"\r
188/// Maximum Length Hexadecimal String = 17\r
189/// "FFFFFFFFFFFFFFFF"\r
190/// Maximum Length GUID = 37\r
191/// "00000000-0000-0000-0000-000000000000"\r
192/// Maximum Length TIME = 18\r
193/// "12/12/2006 12:12"\r
194///\r
195#define MAXIMUM_VALUE_CHARACTERS 38\r
196\r
197///\r
198/// Flags bitmask values use in UnicodeValueToString() and\r
199/// AsciiValueToString()\r
200///\r
201#define LEFT_JUSTIFY 0x01\r
202#define COMMA_TYPE 0x08\r
203#define PREFIX_ZERO 0x20\r
204#define RADIX_HEX 0x80\r
205\r
206/**\r
207 Produces a Null-terminated Unicode string in an output buffer based on\r
208 a Null-terminated Unicode format string and a VA_LIST argument list.\r
209\r
210 This function is similar as vsnprintf_s defined in C11.\r
211\r
212 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer\r
213 and BufferSize.\r
214 The Unicode string is produced by parsing the format string specified by FormatString.\r
215 Arguments are pulled from the variable argument list specified by Marker based on the\r
216 contents of the format string.\r
217 The number of Unicode characters in the produced output buffer is returned not including\r
218 the Null-terminator.\r
219\r
220 If StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().\r
221 If FormatString is not aligned on a 16-bit boundary, then ASSERT().\r
222\r
223 If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is\r
224 unmodified and 0 is returned.\r
225 If BufferSize > 1 and FormatString is NULL, then ASSERT(). Also, the output buffer is\r
226 unmodified and 0 is returned.\r
227 If PcdMaximumUnicodeStringLength is not zero, and BufferSize >\r
228 (PcdMaximumUnicodeStringLength * sizeof (CHAR16) + 1), then ASSERT(). Also, the output\r
229 buffer is unmodified and 0 is returned.\r
230 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than\r
231 PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then\r
232 ASSERT(). Also, the output buffer is unmodified and 0 is returned.\r
233\r
234 If BufferSize is 0 or 1, then the output buffer is unmodified and 0 is returned.\r
235\r
236 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated\r
237 Unicode string.\r
238 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.\r
239 @param FormatString A Null-terminated Unicode format string.\r
240 @param Marker VA_LIST marker for the variable argument list.\r
241\r
242 @return The number of Unicode characters in the produced output buffer not including the\r
243 Null-terminator.\r
244\r
245**/\r
246UINTN\r
247EFIAPI\r
248UnicodeVSPrint (\r
249 OUT CHAR16 *StartOfBuffer,\r
250 IN UINTN BufferSize,\r
251 IN CONST CHAR16 *FormatString,\r
252 IN VA_LIST Marker\r
253 );\r
254\r
255/**\r
256 Produces a Null-terminated Unicode string in an output buffer based on\r
257 a Null-terminated Unicode format string and a BASE_LIST argument list.\r
258\r
259 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer\r
260 and BufferSize.\r
261 The Unicode string is produced by parsing the format string specified by FormatString.\r
262 Arguments are pulled from the variable argument list specified by Marker based on the\r
263 contents of the format string.\r
264 The number of Unicode characters in the produced output buffer is returned not including\r
265 the Null-terminator.\r
266\r
267 If StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().\r
268 If FormatString is not aligned on a 16-bit boundary, then ASSERT().\r
269\r
270 If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is\r
271 unmodified and 0 is returned.\r
272 If BufferSize > 1 and FormatString is NULL, then ASSERT(). Also, the output buffer is\r
273 unmodified and 0 is returned.\r
274 If PcdMaximumUnicodeStringLength is not zero, and BufferSize >\r
275 (PcdMaximumUnicodeStringLength * sizeof (CHAR16) + 1), then ASSERT(). Also, the output\r
276 buffer is unmodified and 0 is returned.\r
277 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than\r
278 PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then\r
279 ASSERT(). Also, the output buffer is unmodified and 0 is returned.\r
280\r
281 If BufferSize is 0 or 1, then the output buffer is unmodified and 0 is returned.\r
282\r
283 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated\r
284 Unicode string.\r
285 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.\r
286 @param FormatString A Null-terminated Unicode format string.\r
287 @param Marker BASE_LIST marker for the variable argument list.\r
288\r
289 @return The number of Unicode characters in the produced output buffer not including the\r
290 Null-terminator.\r
291\r
292**/\r
293UINTN\r
294EFIAPI\r
295UnicodeBSPrint (\r
296 OUT CHAR16 *StartOfBuffer,\r
297 IN UINTN BufferSize,\r
298 IN CONST CHAR16 *FormatString,\r
299 IN BASE_LIST Marker\r
300 );\r
301\r
302/**\r
303 Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated\r
304 Unicode format string and variable argument list.\r
305\r
306 This function is similar as snprintf_s defined in C11.\r
307\r
308 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer\r
309 and BufferSize.\r
310 The Unicode string is produced by parsing the format string specified by FormatString.\r
311 Arguments are pulled from the variable argument list based on the contents of the format string.\r
312 The number of Unicode characters in the produced output buffer is returned not including\r
313 the Null-terminator.\r
314\r
315 If StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().\r
316 If FormatString is not aligned on a 16-bit boundary, then ASSERT().\r
317\r
318 If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is\r
319 unmodified and 0 is returned.\r
320 If BufferSize > 1 and FormatString is NULL, then ASSERT(). Also, the output buffer is\r
321 unmodified and 0 is returned.\r
322 If PcdMaximumUnicodeStringLength is not zero, and BufferSize >\r
323 (PcdMaximumUnicodeStringLength * sizeof (CHAR16) + 1), then ASSERT(). Also, the output\r
324 buffer is unmodified and 0 is returned.\r
325 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than\r
326 PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then\r
327 ASSERT(). Also, the output buffer is unmodified and 0 is returned.\r
328\r
329 If BufferSize is 0 or 1, then the output buffer is unmodified and 0 is returned.\r
330\r
331 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated\r
332 Unicode string.\r
333 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.\r
334 @param FormatString A Null-terminated Unicode format string.\r
335 @param ... Variable argument list whose contents are accessed based on the\r
336 format string specified by FormatString.\r
337\r
338 @return The number of Unicode characters in the produced output buffer not including the\r
339 Null-terminator.\r
340\r
341**/\r
342UINTN\r
343EFIAPI\r
344UnicodeSPrint (\r
345 OUT CHAR16 *StartOfBuffer,\r
346 IN UINTN BufferSize,\r
347 IN CONST CHAR16 *FormatString,\r
348 ...\r
349 );\r
350\r
351/**\r
352 Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated\r
353 ASCII format string and a VA_LIST argument list.\r
354\r
355 This function is similar as vsnprintf_s defined in C11.\r
356\r
357 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer\r
358 and BufferSize.\r
359 The Unicode string is produced by parsing the format string specified by FormatString.\r
360 Arguments are pulled from the variable argument list specified by Marker based on the\r
361 contents of the format string.\r
362 The number of Unicode characters in the produced output buffer is returned not including\r
363 the Null-terminator.\r
364\r
365 If StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().\r
366\r
367 If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is\r
368 unmodified and 0 is returned.\r
369 If BufferSize > 1 and FormatString is NULL, then ASSERT(). Also, the output buffer is\r
370 unmodified and 0 is returned.\r
371 If PcdMaximumUnicodeStringLength is not zero, and BufferSize >\r
372 (PcdMaximumUnicodeStringLength * sizeof (CHAR16) + 1), then ASSERT(). Also, the output\r
373 buffer is unmodified and 0 is returned.\r
374 If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than\r
375 PcdMaximumAsciiStringLength Ascii characters not including the Null-terminator, then\r
376 ASSERT(). Also, the output buffer is unmodified and 0 is returned.\r
377\r
378 If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.\r
379\r
380 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated\r
381 Unicode string.\r
382 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.\r
383 @param FormatString A Null-terminated ASCII format string.\r
384 @param Marker VA_LIST marker for the variable argument list.\r
385\r
386 @return The number of Unicode characters in the produced output buffer not including the\r
387 Null-terminator.\r
388\r
389**/\r
390UINTN\r
391EFIAPI\r
392UnicodeVSPrintAsciiFormat (\r
393 OUT CHAR16 *StartOfBuffer,\r
394 IN UINTN BufferSize,\r
395 IN CONST CHAR8 *FormatString,\r
396 IN VA_LIST Marker\r
397 );\r
398\r
399/**\r
400 Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated\r
401 ASCII format string and a BASE_LIST argument list.\r
402\r
403 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer\r
404 and BufferSize.\r
405 The Unicode string is produced by parsing the format string specified by FormatString.\r
406 Arguments are pulled from the variable argument list specified by Marker based on the\r
407 contents of the format string.\r
408 The number of Unicode characters in the produced output buffer is returned not including\r
409 the Null-terminator.\r
410\r
411 If StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().\r
412\r
413 If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is\r
414 unmodified and 0 is returned.\r
415 If BufferSize > 1 and FormatString is NULL, then ASSERT(). Also, the output buffer is\r
416 unmodified and 0 is returned.\r
417 If PcdMaximumUnicodeStringLength is not zero, and BufferSize >\r
418 (PcdMaximumUnicodeStringLength * sizeof (CHAR16) + 1), then ASSERT(). Also, the output\r
419 buffer is unmodified and 0 is returned.\r
420 If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than\r
421 PcdMaximumAsciiStringLength Ascii characters not including the Null-terminator, then\r
422 ASSERT(). Also, the output buffer is unmodified and 0 is returned.\r
423\r
424 If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.\r
425\r
426 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated\r
427 Unicode string.\r
428 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.\r
429 @param FormatString A Null-terminated ASCII format string.\r
430 @param Marker BASE_LIST marker for the variable argument list.\r
431\r
432 @return The number of Unicode characters in the produced output buffer not including the\r
433 Null-terminator.\r
434\r
435**/\r
436UINTN\r
437EFIAPI\r
438UnicodeBSPrintAsciiFormat (\r
439 OUT CHAR16 *StartOfBuffer,\r
440 IN UINTN BufferSize,\r
441 IN CONST CHAR8 *FormatString,\r
442 IN BASE_LIST Marker\r
443 );\r
444\r
445/**\r
446 Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated\r
447 ASCII format string and variable argument list.\r
448\r
449 This function is similar as snprintf_s defined in C11.\r
450\r
451 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer\r
452 and BufferSize.\r
453 The Unicode string is produced by parsing the format string specified by FormatString.\r
454 Arguments are pulled from the variable argument list based on the contents of the\r
455 format string.\r
456 The number of Unicode characters in the produced output buffer is returned not including\r
457 the Null-terminator.\r
458\r
459 If StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().\r
460\r
461 If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is\r
462 unmodified and 0 is returned.\r
463 If BufferSize > 1 and FormatString is NULL, then ASSERT(). Also, the output buffer is\r
464 unmodified and 0 is returned.\r
465 If PcdMaximumUnicodeStringLength is not zero, and BufferSize >\r
466 (PcdMaximumUnicodeStringLength * sizeof (CHAR16) + 1), then ASSERT(). Also, the output\r
467 buffer is unmodified and 0 is returned.\r
468 If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than\r
469 PcdMaximumAsciiStringLength Ascii characters not including the Null-terminator, then\r
470 ASSERT(). Also, the output buffer is unmodified and 0 is returned.\r
471\r
472 If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.\r
473\r
474 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated\r
475 Unicode string.\r
476 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.\r
477 @param FormatString A Null-terminated ASCII format string.\r
478 @param ... Variable argument list whose contents are accessed based on the\r
479 format string specified by FormatString.\r
480\r
481 @return The number of Unicode characters in the produced output buffer not including the\r
482 Null-terminator.\r
483\r
484**/\r
485UINTN\r
486EFIAPI\r
487UnicodeSPrintAsciiFormat (\r
488 OUT CHAR16 *StartOfBuffer,\r
489 IN UINTN BufferSize,\r
490 IN CONST CHAR8 *FormatString,\r
491 ...\r
492 );\r
493\r
494#ifndef DISABLE_NEW_DEPRECATED_INTERFACES\r
495\r
496/**\r
497 [ATTENTION] This function is deprecated for security reason.\r
498\r
499 Converts a decimal value to a Null-terminated Unicode string.\r
500\r
501 Converts the decimal number specified by Value to a Null-terminated Unicode\r
502 string specified by Buffer containing at most Width characters. No padding of spaces\r
503 is ever performed. If Width is 0 then a width of MAXIMUM_VALUE_CHARACTERS is assumed.\r
504 The number of Unicode characters in Buffer is returned, not including the Null-terminator.\r
505 If the conversion contains more than Width characters, then only the first\r
506 Width characters are returned, and the total number of characters\r
507 required to perform the conversion is returned.\r
508 Additional conversion parameters are specified in Flags.\r
509\r
510 The Flags bit LEFT_JUSTIFY is always ignored.\r
511 All conversions are left justified in Buffer.\r
512 If Width is 0, PREFIX_ZERO is ignored in Flags.\r
513 If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and commas\r
514 are inserted every 3rd digit starting from the right.\r
515 If RADIX_HEX is set in Flags, then the output buffer will be\r
516 formatted in hexadecimal format.\r
517 If Value is < 0 and RADIX_HEX is not set in Flags, then the fist character in Buffer is a '-'.\r
518 If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored,\r
519 then Buffer is padded with '0' characters so the combination of the optional '-'\r
520 sign character, '0' characters, digit characters for Value, and the Null-terminator\r
521 add up to Width characters.\r
522 If both COMMA_TYPE and RADIX_HEX are set in Flags, then ASSERT().\r
523 If Buffer is NULL, then ASSERT().\r
524 If Buffer is not aligned on a 16-bit boundary, then ASSERT().\r
525 If unsupported bits are set in Flags, then ASSERT().\r
526 If both COMMA_TYPE and RADIX_HEX are set in Flags, then ASSERT().\r
527 If Width >= MAXIMUM_VALUE_CHARACTERS, then ASSERT()\r
528\r
529 @param Buffer The pointer to the output buffer for the produced Null-terminated\r
530 Unicode string.\r
531 @param Flags The bitmask of flags that specify left justification, zero pad, and commas.\r
532 @param Value The 64-bit signed value to convert to a string.\r
533 @param Width The maximum number of Unicode characters to place in Buffer, not including\r
534 the Null-terminator.\r
535\r
536 @return The number of Unicode characters in Buffer, not including the Null-terminator.\r
537\r
538**/\r
539UINTN\r
540EFIAPI\r
541UnicodeValueToString (\r
542 IN OUT CHAR16 *Buffer,\r
543 IN UINTN Flags,\r
544 IN INT64 Value,\r
545 IN UINTN Width\r
546 );\r
547\r
548#endif\r
549\r
550/**\r
551 Converts a decimal value to a Null-terminated Unicode string.\r
552\r
553 Converts the decimal number specified by Value to a Null-terminated Unicode\r
554 string specified by Buffer containing at most Width characters. No padding of\r
555 spaces is ever performed. If Width is 0 then a width of\r
556 MAXIMUM_VALUE_CHARACTERS is assumed. If the conversion contains more than\r
557 Width characters, then only the first Width characters are placed in Buffer.\r
558 Additional conversion parameters are specified in Flags.\r
559\r
560 The Flags bit LEFT_JUSTIFY is always ignored.\r
561 All conversions are left justified in Buffer.\r
562 If Width is 0, PREFIX_ZERO is ignored in Flags.\r
563 If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and\r
564 commas are inserted every 3rd digit starting from the right.\r
565 If RADIX_HEX is set in Flags, then the output buffer will be formatted in\r
566 hexadecimal format.\r
567 If Value is < 0 and RADIX_HEX is not set in Flags, then the fist character in\r
568 Buffer is a '-'.\r
569 If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored, then\r
570 Buffer is padded with '0' characters so the combination of the optional '-'\r
571 sign character, '0' characters, digit characters for Value, and the\r
572 Null-terminator add up to Width characters.\r
573\r
574 If Buffer is not aligned on a 16-bit boundary, then ASSERT().\r
575 If an error would be returned, then the function will also ASSERT().\r
576\r
577 @param Buffer The pointer to the output buffer for the produced\r
578 Null-terminated Unicode string.\r
579 @param BufferSize The size of Buffer in bytes, including the\r
580 Null-terminator.\r
581 @param Flags The bitmask of flags that specify left justification,\r
582 zero pad, and commas.\r
583 @param Value The 64-bit signed value to convert to a string.\r
584 @param Width The maximum number of Unicode characters to place in\r
585 Buffer, not including the Null-terminator.\r
586\r
587 @retval RETURN_SUCCESS The decimal value is converted.\r
588 @retval RETURN_BUFFER_TOO_SMALL If BufferSize cannot hold the converted\r
589 value.\r
590 @retval RETURN_INVALID_PARAMETER If Buffer is NULL.\r
591 If PcdMaximumUnicodeStringLength is not\r
592 zero, and BufferSize is greater than\r
593 (PcdMaximumUnicodeStringLength *\r
594 sizeof (CHAR16) + 1).\r
595 If unsupported bits are set in Flags.\r
596 If both COMMA_TYPE and RADIX_HEX are set in\r
597 Flags.\r
598 If Width >= MAXIMUM_VALUE_CHARACTERS.\r
599\r
600**/\r
601RETURN_STATUS\r
602EFIAPI\r
603UnicodeValueToStringS (\r
604 IN OUT CHAR16 *Buffer,\r
605 IN UINTN BufferSize,\r
606 IN UINTN Flags,\r
607 IN INT64 Value,\r
608 IN UINTN Width\r
609 );\r
610\r
611/**\r
612 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated\r
613 ASCII format string and a VA_LIST argument list.\r
614\r
615 This function is similar as vsnprintf_s defined in C11.\r
616\r
617 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer\r
618 and BufferSize.\r
619 The ASCII string is produced by parsing the format string specified by FormatString.\r
620 Arguments are pulled from the variable argument list specified by Marker based on\r
621 the contents of the format string.\r
622 The number of ASCII characters in the produced output buffer is returned not including\r
623 the Null-terminator.\r
624\r
625 If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is\r
626 unmodified and 0 is returned.\r
627 If BufferSize > 0 and FormatString is NULL, then ASSERT(). Also, the output buffer is\r
628 unmodified and 0 is returned.\r
629 If PcdMaximumAsciiStringLength is not zero, and BufferSize >\r
630 (PcdMaximumAsciiStringLength * sizeof (CHAR8)), then ASSERT(). Also, the output buffer\r
631 is unmodified and 0 is returned.\r
632 If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than\r
633 PcdMaximumAsciiStringLength Ascii characters not including the Null-terminator, then\r
634 ASSERT(). Also, the output buffer is unmodified and 0 is returned.\r
635\r
636 If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
637\r
638 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated\r
639 ASCII string.\r
640 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.\r
641 @param FormatString A Null-terminated ASCII format string.\r
642 @param Marker VA_LIST marker for the variable argument list.\r
643\r
644 @return The number of ASCII characters in the produced output buffer not including the\r
645 Null-terminator.\r
646\r
647**/\r
648UINTN\r
649EFIAPI\r
650AsciiVSPrint (\r
651 OUT CHAR8 *StartOfBuffer,\r
652 IN UINTN BufferSize,\r
653 IN CONST CHAR8 *FormatString,\r
654 IN VA_LIST Marker\r
655 );\r
656\r
657/**\r
658 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated\r
659 ASCII format string and a BASE_LIST argument list.\r
660\r
661 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer\r
662 and BufferSize.\r
663 The ASCII string is produced by parsing the format string specified by FormatString.\r
664 Arguments are pulled from the variable argument list specified by Marker based on\r
665 the contents of the format string.\r
666 The number of ASCII characters in the produced output buffer is returned not including\r
667 the Null-terminator.\r
668\r
669 If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is\r
670 unmodified and 0 is returned.\r
671 If BufferSize > 0 and FormatString is NULL, then ASSERT(). Also, the output buffer is\r
672 unmodified and 0 is returned.\r
673 If PcdMaximumAsciiStringLength is not zero, and BufferSize >\r
674 (PcdMaximumAsciiStringLength * sizeof (CHAR8)), then ASSERT(). Also, the output buffer\r
675 is unmodified and 0 is returned.\r
676 If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than\r
677 PcdMaximumAsciiStringLength Ascii characters not including the Null-terminator, then\r
678 ASSERT(). Also, the output buffer is unmodified and 0 is returned.\r
679\r
680 If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
681\r
682 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated\r
683 ASCII string.\r
684 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.\r
685 @param FormatString A Null-terminated ASCII format string.\r
686 @param Marker BASE_LIST marker for the variable argument list.\r
687\r
688 @return The number of ASCII characters in the produced output buffer not including the\r
689 Null-terminator.\r
690\r
691**/\r
692UINTN\r
693EFIAPI\r
694AsciiBSPrint (\r
695 OUT CHAR8 *StartOfBuffer,\r
696 IN UINTN BufferSize,\r
697 IN CONST CHAR8 *FormatString,\r
698 IN BASE_LIST Marker\r
699 );\r
700\r
701/**\r
702 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated\r
703 ASCII format string and variable argument list.\r
704\r
705 This function is similar as snprintf_s defined in C11.\r
706\r
707 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer\r
708 and BufferSize.\r
709 The ASCII string is produced by parsing the format string specified by FormatString.\r
710 Arguments are pulled from the variable argument list based on the contents of the\r
711 format string.\r
712 The number of ASCII characters in the produced output buffer is returned not including\r
713 the Null-terminator.\r
714\r
715 If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is\r
716 unmodified and 0 is returned.\r
717 If BufferSize > 0 and FormatString is NULL, then ASSERT(). Also, the output buffer is\r
718 unmodified and 0 is returned.\r
719 If PcdMaximumAsciiStringLength is not zero, and BufferSize >\r
720 (PcdMaximumAsciiStringLength * sizeof (CHAR8)), then ASSERT(). Also, the output buffer\r
721 is unmodified and 0 is returned.\r
722 If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than\r
723 PcdMaximumAsciiStringLength Ascii characters not including the Null-terminator, then\r
724 ASSERT(). Also, the output buffer is unmodified and 0 is returned.\r
725\r
726 If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
727\r
728 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated\r
729 ASCII string.\r
730 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.\r
731 @param FormatString A Null-terminated ASCII format string.\r
732 @param ... Variable argument list whose contents are accessed based on the\r
733 format string specified by FormatString.\r
734\r
735 @return The number of ASCII characters in the produced output buffer not including the\r
736 Null-terminator.\r
737\r
738**/\r
739UINTN\r
740EFIAPI\r
741AsciiSPrint (\r
742 OUT CHAR8 *StartOfBuffer,\r
743 IN UINTN BufferSize,\r
744 IN CONST CHAR8 *FormatString,\r
745 ...\r
746 );\r
747\r
748/**\r
749 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated\r
750 Unicode format string and a VA_LIST argument list.\r
751\r
752 This function is similar as vsnprintf_s defined in C11.\r
753\r
754 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer\r
755 and BufferSize.\r
756 The ASCII string is produced by parsing the format string specified by FormatString.\r
757 Arguments are pulled from the variable argument list specified by Marker based on\r
758 the contents of the format string.\r
759 The number of ASCII characters in the produced output buffer is returned not including\r
760 the Null-terminator.\r
761\r
762 If FormatString is not aligned on a 16-bit boundary, then ASSERT().\r
763\r
764 If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is\r
765 unmodified and 0 is returned.\r
766 If BufferSize > 0 and FormatString is NULL, then ASSERT(). Also, the output buffer is\r
767 unmodified and 0 is returned.\r
768 If PcdMaximumAsciiStringLength is not zero, and BufferSize >\r
769 (PcdMaximumAsciiStringLength * sizeof (CHAR8)), then ASSERT(). Also, the output buffer\r
770 is unmodified and 0 is returned.\r
771 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than\r
772 PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then\r
773 ASSERT(). Also, the output buffer is unmodified and 0 is returned.\r
774\r
775 If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
776\r
777 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated\r
778 ASCII string.\r
779 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.\r
780 @param FormatString A Null-terminated Unicode format string.\r
781 @param Marker VA_LIST marker for the variable argument list.\r
782\r
783 @return The number of ASCII characters in the produced output buffer not including the\r
784 Null-terminator.\r
785\r
786**/\r
787UINTN\r
788EFIAPI\r
789AsciiVSPrintUnicodeFormat (\r
790 OUT CHAR8 *StartOfBuffer,\r
791 IN UINTN BufferSize,\r
792 IN CONST CHAR16 *FormatString,\r
793 IN VA_LIST Marker\r
794 );\r
795\r
796/**\r
797 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated\r
798 Unicode format string and a BASE_LIST argument list.\r
799\r
800 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer\r
801 and BufferSize.\r
802 The ASCII string is produced by parsing the format string specified by FormatString.\r
803 Arguments are pulled from the variable argument list specified by Marker based on\r
804 the contents of the format string.\r
805 The number of ASCII characters in the produced output buffer is returned not including\r
806 the Null-terminator.\r
807\r
808 If FormatString is not aligned on a 16-bit boundary, then ASSERT().\r
809\r
810 If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is\r
811 unmodified and 0 is returned.\r
812 If BufferSize > 0 and FormatString is NULL, then ASSERT(). Also, the output buffer is\r
813 unmodified and 0 is returned.\r
814 If PcdMaximumAsciiStringLength is not zero, and BufferSize >\r
815 (PcdMaximumAsciiStringLength * sizeof (CHAR8)), then ASSERT(). Also, the output buffer\r
816 is unmodified and 0 is returned.\r
817 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than\r
818 PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then\r
819 ASSERT(). Also, the output buffer is unmodified and 0 is returned.\r
820\r
821 If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
822\r
823 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated\r
824 ASCII string.\r
825 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.\r
826 @param FormatString A Null-terminated Unicode format string.\r
827 @param Marker BASE_LIST marker for the variable argument list.\r
828\r
829 @return The number of ASCII characters in the produced output buffer not including the\r
830 Null-terminator.\r
831\r
832**/\r
833UINTN\r
834EFIAPI\r
835AsciiBSPrintUnicodeFormat (\r
836 OUT CHAR8 *StartOfBuffer,\r
837 IN UINTN BufferSize,\r
838 IN CONST CHAR16 *FormatString,\r
839 IN BASE_LIST Marker\r
840 );\r
841\r
842/**\r
843 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated\r
844 Unicode format string and variable argument list.\r
845\r
846 This function is similar as snprintf_s defined in C11.\r
847\r
848 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer\r
849 and BufferSize.\r
850 The ASCII string is produced by parsing the format string specified by FormatString.\r
851 Arguments are pulled from the variable argument list based on the contents of the\r
852 format string.\r
853 The number of ASCII characters in the produced output buffer is returned not including\r
854 the Null-terminator.\r
855\r
856 If FormatString is not aligned on a 16-bit boundary, then ASSERT().\r
857\r
858 If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is\r
859 unmodified and 0 is returned.\r
860 If BufferSize > 0 and FormatString is NULL, then ASSERT(). Also, the output buffer is\r
861 unmodified and 0 is returned.\r
862 If PcdMaximumAsciiStringLength is not zero, and BufferSize >\r
863 (PcdMaximumAsciiStringLength * sizeof (CHAR8)), then ASSERT(). Also, the output buffer\r
864 is unmodified and 0 is returned.\r
865 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than\r
866 PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then\r
867 ASSERT(). Also, the output buffer is unmodified and 0 is returned.\r
868\r
869 If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
870\r
871 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated\r
872 ASCII string.\r
873 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.\r
874 @param FormatString A Null-terminated Unicode format string.\r
875 @param ... Variable argument list whose contents are accessed based on the\r
876 format string specified by FormatString.\r
877\r
878 @return The number of ASCII characters in the produced output buffer not including the\r
879 Null-terminator.\r
880\r
881**/\r
882UINTN\r
883EFIAPI\r
884AsciiSPrintUnicodeFormat (\r
885 OUT CHAR8 *StartOfBuffer,\r
886 IN UINTN BufferSize,\r
887 IN CONST CHAR16 *FormatString,\r
888 ...\r
889 );\r
890\r
891#ifndef DISABLE_NEW_DEPRECATED_INTERFACES\r
892\r
893/**\r
894 [ATTENTION] This function is deprecated for security reason.\r
895\r
896 Converts a decimal value to a Null-terminated ASCII string.\r
897\r
898 Converts the decimal number specified by Value to a Null-terminated ASCII string\r
899 specified by Buffer containing at most Width characters. No padding of spaces\r
900 is ever performed.\r
901 If Width is 0 then a width of MAXIMUM_VALUE_CHARACTERS is assumed.\r
902 The number of ASCII characters in Buffer is returned, not including the Null-terminator.\r
903 If the conversion contains more than Width characters, then only the first Width\r
904 characters are returned, and the total number of characters required to perform\r
905 the conversion is returned.\r
906 Additional conversion parameters are specified in Flags.\r
907 The Flags bit LEFT_JUSTIFY is always ignored.\r
908 All conversions are left justified in Buffer.\r
909 If Width is 0, PREFIX_ZERO is ignored in Flags.\r
910 If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and commas\r
911 are inserted every 3rd digit starting from the right.\r
912 If RADIX_HEX is set in Flags, then the output buffer will be\r
913 formatted in hexadecimal format.\r
914 If Value is < 0 and RADIX_HEX is not set in Flags, then the fist character in Buffer is a '-'.\r
915 If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored,\r
916 then Buffer is padded with '0' characters so the combination of the optional '-'\r
917 sign character, '0' characters, digit characters for Value, and the Null-terminator\r
918 add up to Width characters.\r
919\r
920 If Buffer is NULL, then ASSERT().\r
921 If unsupported bits are set in Flags, then ASSERT().\r
922 If both COMMA_TYPE and RADIX_HEX are set in Flags, then ASSERT().\r
923 If Width >= MAXIMUM_VALUE_CHARACTERS, then ASSERT()\r
924\r
925 @param Buffer A pointer to the output buffer for the produced Null-terminated\r
926 ASCII string.\r
927 @param Flags The bitmask of flags that specify left justification, zero pad, and commas.\r
928 @param Value The 64-bit signed value to convert to a string.\r
929 @param Width The maximum number of ASCII characters to place in Buffer, not including\r
930 the Null-terminator.\r
931\r
932 @return The number of ASCII characters in Buffer, not including the Null-terminator.\r
933\r
934**/\r
935UINTN\r
936EFIAPI\r
937AsciiValueToString (\r
938 OUT CHAR8 *Buffer,\r
939 IN UINTN Flags,\r
940 IN INT64 Value,\r
941 IN UINTN Width\r
942 );\r
943\r
944#endif\r
945\r
946/**\r
947 Converts a decimal value to a Null-terminated Ascii string.\r
948\r
949 Converts the decimal number specified by Value to a Null-terminated Ascii\r
950 string specified by Buffer containing at most Width characters. No padding of\r
951 spaces is ever performed. If Width is 0 then a width of\r
952 MAXIMUM_VALUE_CHARACTERS is assumed. If the conversion contains more than\r
953 Width characters, then only the first Width characters are placed in Buffer.\r
954 Additional conversion parameters are specified in Flags.\r
955\r
956 The Flags bit LEFT_JUSTIFY is always ignored.\r
957 All conversions are left justified in Buffer.\r
958 If Width is 0, PREFIX_ZERO is ignored in Flags.\r
959 If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and\r
960 commas are inserted every 3rd digit starting from the right.\r
961 If RADIX_HEX is set in Flags, then the output buffer will be formatted in\r
962 hexadecimal format.\r
963 If Value is < 0 and RADIX_HEX is not set in Flags, then the fist character in\r
964 Buffer is a '-'.\r
965 If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored, then\r
966 Buffer is padded with '0' characters so the combination of the optional '-'\r
967 sign character, '0' characters, digit characters for Value, and the\r
968 Null-terminator add up to Width characters.\r
969\r
970 If an error would be returned, then the function will ASSERT().\r
971\r
972 @param Buffer The pointer to the output buffer for the produced\r
973 Null-terminated Ascii string.\r
974 @param BufferSize The size of Buffer in bytes, including the\r
975 Null-terminator.\r
976 @param Flags The bitmask of flags that specify left justification,\r
977 zero pad, and commas.\r
978 @param Value The 64-bit signed value to convert to a string.\r
979 @param Width The maximum number of Ascii characters to place in\r
980 Buffer, not including the Null-terminator.\r
981\r
982 @retval RETURN_SUCCESS The decimal value is converted.\r
983 @retval RETURN_BUFFER_TOO_SMALL If BufferSize cannot hold the converted\r
984 value.\r
985 @retval RETURN_INVALID_PARAMETER If Buffer is NULL.\r
986 If PcdMaximumAsciiStringLength is not\r
987 zero, and BufferSize is greater than\r
988 PcdMaximumAsciiStringLength.\r
989 If unsupported bits are set in Flags.\r
990 If both COMMA_TYPE and RADIX_HEX are set in\r
991 Flags.\r
992 If Width >= MAXIMUM_VALUE_CHARACTERS.\r
993\r
994**/\r
995RETURN_STATUS\r
996EFIAPI\r
997AsciiValueToStringS (\r
998 IN OUT CHAR8 *Buffer,\r
999 IN UINTN BufferSize,\r
1000 IN UINTN Flags,\r
1001 IN INT64 Value,\r
1002 IN UINTN Width\r
1003 );\r
1004\r
1005/**\r
1006 Returns the number of characters that would be produced by if the formatted\r
1007 output were produced not including the Null-terminator.\r
1008\r
1009 If FormatString is not aligned on a 16-bit boundary, then ASSERT().\r
1010\r
1011 If FormatString is NULL, then ASSERT() and 0 is returned.\r
1012 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more\r
1013 than PcdMaximumUnicodeStringLength Unicode characters not including the\r
1014 Null-terminator, then ASSERT() and 0 is returned.\r
1015\r
1016 @param[in] FormatString A Null-terminated Unicode format string.\r
1017 @param[in] Marker VA_LIST marker for the variable argument list.\r
1018\r
1019 @return The number of characters that would be produced, not including the\r
1020 Null-terminator.\r
1021**/\r
1022UINTN\r
1023EFIAPI\r
1024SPrintLength (\r
1025 IN CONST CHAR16 *FormatString,\r
1026 IN VA_LIST Marker\r
1027 );\r
1028\r
1029/**\r
1030 Returns the number of characters that would be produced by if the formatted\r
1031 output were produced not including the Null-terminator.\r
1032\r
1033 If FormatString is NULL, then ASSERT() and 0 is returned.\r
1034 If PcdMaximumAsciiStringLength is not zero, and FormatString contains more\r
1035 than PcdMaximumAsciiStringLength Ascii characters not including the\r
1036 Null-terminator, then ASSERT() and 0 is returned.\r
1037\r
1038 @param[in] FormatString A Null-terminated ASCII format string.\r
1039 @param[in] Marker VA_LIST marker for the variable argument list.\r
1040\r
1041 @return The number of characters that would be produced, not including the\r
1042 Null-terminator.\r
1043**/\r
1044UINTN\r
1045EFIAPI\r
1046SPrintLengthAsciiFormat (\r
1047 IN CONST CHAR8 *FormatString,\r
1048 IN VA_LIST Marker\r
1049 );\r
1050\r
1051#endif\r