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