]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BasePrintLib/PrintLib.c
add GLOBAL_REMOVE_IF_UNREFERENCED and CONST modifier.
[mirror_edk2.git] / MdePkg / Library / BasePrintLib / PrintLib.c
CommitLineData
e1f414b6 1/** @file\r
2 Print Library.\r
3\r
4 Copyright (c) 2006 - 2007, Intel Corporation<BR>\r
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
15//\r
16// Include common header file for this module.\r
17//\r
f734a10a 18\r
e1f414b6 19\r
20#include "PrintLibInternal.h"\r
21\r
22#define WARNING_STATUS_NUMBER 4\r
23#define ERROR_STATUS_NUMBER 24\r
24#define ASSERT_UNICODE_BUFFER(Buffer) ASSERT ((((UINTN) (Buffer)) & 0x01) == 0)\r
25\r
26GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR8 *StatusString [] = {\r
27 "Success", // RETURN_SUCCESS = 0\r
28 "Warning Unknown Glyph", // RETURN_WARN_UNKNOWN_GLYPH = 1\r
29 "Warning Delete Failure", // RETURN_WARN_DELETE_FAILURE = 2\r
30 "Warning Write Failure", // RETURN_WARN_WRITE_FAILURE = 3\r
31 "Warning Buffer Too Small", // RETURN_WARN_BUFFER_TOO_SMALL = 4\r
32 "Load Error", // RETURN_LOAD_ERROR = 1 | MAX_BIT\r
33 "Invalid Parameter", // RETURN_INVALID_PARAMETER = 2 | MAX_BIT\r
34 "Unsupported", // RETURN_UNSUPPORTED = 3 | MAX_BIT\r
35 "Bad Buffer Size", // RETURN_BAD_BUFFER_SIZE = 4 | MAX_BIT\r
36 "Buffer Too Small", // RETURN_BUFFER_TOO_SMALL, = 5 | MAX_BIT\r
37 "Not Ready", // RETURN_NOT_READY = 6 | MAX_BIT\r
38 "Device Error", // RETURN_DEVICE_ERROR = 7 | MAX_BIT\r
39 "Write Protected", // RETURN_WRITE_PROTECTED = 8 | MAX_BIT\r
40 "Out of Resources", // RETURN_OUT_OF_RESOURCES = 9 | MAX_BIT\r
41 "Volume Corrupt", // RETURN_VOLUME_CORRUPTED = 10 | MAX_BIT\r
42 "Volume Full", // RETURN_VOLUME_FULL = 11 | MAX_BIT\r
43 "No Media", // RETURN_NO_MEDIA = 12 | MAX_BIT\r
44 "Media changed", // RETURN_MEDIA_CHANGED = 13 | MAX_BIT\r
45 "Not Found", // RETURN_NOT_FOUND = 14 | MAX_BIT\r
46 "Access Denied", // RETURN_ACCESS_DENIED = 15 | MAX_BIT\r
47 "No Response", // RETURN_NO_RESPONSE = 16 | MAX_BIT\r
48 "No mapping", // RETURN_NO_MAPPING = 17 | MAX_BIT\r
49 "Time out", // RETURN_TIMEOUT = 18 | MAX_BIT\r
50 "Not started", // RETURN_NOT_STARTED = 19 | MAX_BIT\r
51 "Already started", // RETURN_ALREADY_STARTED = 20 | MAX_BIT\r
52 "Aborted", // RETURN_ABORTED = 21 | MAX_BIT\r
53 "ICMP Error", // RETURN_ICMP_ERROR = 22 | MAX_BIT\r
54 "TFTP Error", // RETURN_TFTP_ERROR = 23 | MAX_BIT\r
55 "Protocol Error" // RETURN_PROTOCOL_ERROR = 24 | MAX_BIT\r
56};\r
57\r
58/**\r
59 Worker function that produces a Null-terminated string in an output buffer \r
60 based on a Null-terminated format string and a VA_LIST argument list.\r
61\r
62 VSPrint function to process format and place the results in Buffer. Since a \r
63 VA_LIST is used this rountine allows the nesting of Vararg routines. Thus \r
64 this is the main print working routine.\r
65\r
66 @param Buffer Character buffer to print the results of the parsing\r
67 of Format into.\r
68 @param BufferSize Maximum number of characters to put into buffer.\r
69 @param Flags Intial flags value.\r
70 Can only have FORMAT_UNICODE and OUTPUT_UNICODE set.\r
71 @param Format Null-terminated format string.\r
72 @param Marker Vararg list consumed by processing Format.\r
73\r
74 @return Number of characters printed not including the Null-terminator.\r
75\r
76**/\r
77UINTN\r
78BasePrintLibVSPrint (\r
79 OUT CHAR8 *Buffer,\r
80 IN UINTN BufferSize,\r
81 IN UINTN Flags,\r
82 IN CONST CHAR8 *Format,\r
83 IN VA_LIST Marker\r
84 )\r
85{\r
86 CHAR8 *OriginalBuffer;\r
87 CHAR8 *EndBuffer;\r
88 CHAR8 ValueBuffer[MAXIMUM_VALUE_CHARACTERS];\r
89 UINTN BytesPerOutputCharacter;\r
90 UINTN BytesPerFormatCharacter;\r
91 UINTN FormatMask;\r
92 UINTN FormatCharacter;\r
93 UINTN Width;\r
94 UINTN Precision;\r
95 INT64 Value;\r
96 CONST CHAR8 *ArgumentString;\r
97 UINTN Character;\r
98 GUID *TmpGuid;\r
99 TIME *TmpTime;\r
100 UINTN Count;\r
101 UINTN ArgumentMask;\r
102 INTN BytesPerArgumentCharacter;\r
103 UINTN ArgumentCharacter;\r
104 BOOLEAN Done;\r
105 UINTN Index;\r
106 CHAR8 Prefix;\r
107 BOOLEAN ZeroPad;\r
108 BOOLEAN Comma;\r
109 UINTN Digits;\r
110 UINTN Radix;\r
111 RETURN_STATUS Status;\r
112\r
113 if (BufferSize == 0) {\r
114 return 0;\r
115 }\r
116 ASSERT (Buffer != NULL);\r
117\r
118 if ((Flags & OUTPUT_UNICODE) != 0) {\r
119 BytesPerOutputCharacter = 2;\r
120 } else {\r
121 BytesPerOutputCharacter = 1;\r
122 }\r
123\r
124 //\r
125 // Reserve space for the Null terminator.\r
126 //\r
127 BufferSize--;\r
128 OriginalBuffer = Buffer;\r
129 //\r
130 // Set the tag for the end of the input Buffer.\r
131 //\r
132 EndBuffer = Buffer + BufferSize * BytesPerOutputCharacter;\r
133\r
134 if ((Flags & FORMAT_UNICODE) != 0) {\r
135 //\r
136 // Make sure format string cannot contain more than PcdMaximumUnicodeStringLength\r
137 // Unicode characters if PcdMaximumUnicodeStringLength is not zero. \r
138 //\r
139 ASSERT (StrSize ((CHAR16 *) Format) != 0);\r
140 BytesPerFormatCharacter = 2;\r
141 FormatMask = 0xffff;\r
142 } else {\r
143 //\r
144 // Make sure format string cannot contain more than PcdMaximumAsciiStringLength\r
145 // Ascii characters if PcdMaximumAsciiStringLength is not zero. \r
146 //\r
147 ASSERT (AsciiStrSize (Format) != 0);\r
148 BytesPerFormatCharacter = 1;\r
149 FormatMask = 0xff;\r
150 }\r
151\r
152\r
153\r
154 //\r
155 // Get the first character from the format string\r
156 //\r
e7fe4996 157 FormatCharacter = ((*Format & 0xff) | (*(Format + 1) << 8)) & FormatMask;\r
e1f414b6 158\r
159 //\r
160 // Loop until the end of the format string is reached or the output buffer is full\r
161 //\r
162 while (FormatCharacter != 0 && Buffer < EndBuffer) {\r
163 //\r
164 // Clear all the flag bits except those that may have been passed in\r
165 //\r
166 Flags &= (OUTPUT_UNICODE | FORMAT_UNICODE);\r
167\r
168 //\r
169 // Set the default width to zero, and the default precision to 1\r
170 //\r
171 Width = 0;\r
172 Precision = 1;\r
173 Prefix = 0;\r
174 Comma = FALSE;\r
175 ZeroPad = FALSE;\r
176 Count = 0;\r
177 Digits = 0;\r
178\r
179 switch (FormatCharacter) {\r
180 case '%':\r
181 //\r
182 // Parse Flags and Width\r
183 //\r
184 for (Done = FALSE; !Done; ) {\r
185 Format += BytesPerFormatCharacter;\r
e7fe4996 186 FormatCharacter = ((*Format & 0xff) | (*(Format + 1) << 8)) & FormatMask;\r
e1f414b6 187 switch (FormatCharacter) {\r
188 case '.': \r
189 Flags |= PRECISION; \r
190 break;\r
191 case '-': \r
192 Flags |= LEFT_JUSTIFY; \r
193 break;\r
194 case '+': \r
195 Flags |= PREFIX_SIGN; \r
196 break;\r
197 case ' ': \r
198 Flags |= PREFIX_BLANK; \r
199 break;\r
200 case ',': \r
201 Flags |= COMMA_TYPE; \r
202 break;\r
203 case 'L':\r
204 case 'l': \r
205 Flags |= LONG_TYPE; \r
206 break;\r
207 case '*':\r
208 if ((Flags & PRECISION) == 0) {\r
209 Flags |= PAD_TO_WIDTH;\r
210 Width = VA_ARG (Marker, UINTN);\r
211 } else {\r
212 Precision = VA_ARG (Marker, UINTN);\r
213 }\r
214 break;\r
215 case '0':\r
216 if ((Flags & PRECISION) == 0) {\r
217 Flags |= PREFIX_ZERO;\r
218 }\r
219 case '1':\r
220 case '2':\r
221 case '3':\r
222 case '4':\r
223 case '5':\r
224 case '6':\r
225 case '7':\r
226 case '8':\r
227 case '9':\r
228 for (Count = 0; ((FormatCharacter >= '0') && (FormatCharacter <= '9')); ){\r
229 Count = (Count * 10) + FormatCharacter - '0';\r
230 Format += BytesPerFormatCharacter;\r
e7fe4996 231 FormatCharacter = ((*Format & 0xff) | (*(Format + 1) << 8)) & FormatMask;\r
e1f414b6 232 }\r
233 Format -= BytesPerFormatCharacter;\r
234 if ((Flags & PRECISION) == 0) {\r
235 Flags |= PAD_TO_WIDTH;\r
236 Width = Count;\r
237 } else {\r
238 Precision = Count;\r
239 }\r
240 break;\r
241 \r
242 case '\0':\r
243 //\r
244 // Make no output if Format string terminates unexpectedly when\r
245 // looking up for flag, width, precision and type. \r
246 //\r
247 Format -= BytesPerFormatCharacter;\r
248 Precision = 0;\r
249 //\r
250 // break skipped on purpose.\r
251 //\r
252 default:\r
253 Done = TRUE;\r
254 break;\r
255 }\r
256 } \r
257\r
258 //\r
259 // Handle each argument type\r
260 //\r
261 switch (FormatCharacter) {\r
262 case 'p':\r
263 //\r
264 // Flag space, +, 0, L & l are invalid for type p.\r
265 //\r
266 Flags &= ~(PREFIX_BLANK | PREFIX_SIGN | PREFIX_ZERO | LONG_TYPE);\r
267 if (sizeof (VOID *) > 4) {\r
268 Flags |= LONG_TYPE;\r
269 }\r
270 case 'X':\r
271 Flags |= PREFIX_ZERO;\r
272 //\r
273 // break skipped on purpose\r
274 //\r
275 case 'x':\r
276 Flags |= RADIX_HEX;\r
277 //\r
278 // break skipped on purpose\r
279 //\r
280 case 'd':\r
281 if ((Flags & LONG_TYPE) == 0) {\r
282 Value = (VA_ARG (Marker, int));\r
283 } else {\r
284 Value = VA_ARG (Marker, INT64);\r
285 }\r
286 if ((Flags & PREFIX_BLANK) != 0) {\r
287 Prefix = ' ';\r
288 }\r
289 if ((Flags & PREFIX_SIGN) != 0) {\r
290 Prefix = '+';\r
291 }\r
292 if ((Flags & COMMA_TYPE) != 0) {\r
293 Comma = TRUE;\r
294 }\r
295 if ((Flags & RADIX_HEX) == 0) {\r
296 Radix = 10;\r
297 if (Comma) {\r
298 Flags &= (~PREFIX_ZERO);\r
299 Precision = 1;\r
300 }\r
301 if (Value < 0) {\r
302 Flags |= PREFIX_SIGN;\r
303 Prefix = '-';\r
304 Value = -Value;\r
305 }\r
306 } else {\r
307 Radix = 16;\r
308 Comma = FALSE;\r
309 if ((Flags & LONG_TYPE) == 0 && Value < 0) {\r
310 Value = (unsigned int)Value;\r
311 }\r
312 }\r
313 //\r
314 // Convert Value to a reversed string\r
315 //\r
316 Count = BasePrintLibValueToString (ValueBuffer, Value, Radix);\r
317 if (Value == 0 && Precision == 0) {\r
318 Count = 0;\r
319 }\r
320 ArgumentString = (CHAR8 *)ValueBuffer + Count;\r
321 \r
322 Digits = Count % 3;\r
323 if (Digits != 0) {\r
324 Digits = 3 - Digits;\r
325 }\r
326 if (Comma && Count != 0) {\r
327 Count += ((Count - 1) / 3);\r
328 }\r
329 if (Prefix != 0) {\r
330 Count++;\r
331 Precision++;\r
332 }\r
333 Flags |= ARGUMENT_REVERSED;\r
334 ZeroPad = TRUE;\r
335 if ((Flags & PREFIX_ZERO) != 0) {\r
336 if ((Flags & LEFT_JUSTIFY) == 0) {\r
337 if ((Flags & PAD_TO_WIDTH) != 0) {\r
338 if ((Flags & PRECISION) == 0) {\r
339 Precision = Width;\r
340 }\r
341 }\r
342 }\r
343 }\r
344 break;\r
345\r
346 case 's':\r
347 case 'S':\r
348 Flags |= ARGUMENT_UNICODE;\r
349 //\r
350 // break skipped on purpose\r
351 //\r
352 case 'a':\r
353 ArgumentString = (CHAR8 *)VA_ARG (Marker, CHAR8 *);\r
354 if (ArgumentString == NULL) {\r
355 Flags &= (~ARGUMENT_UNICODE);\r
356 ArgumentString = "<null string>";\r
357 }\r
0c0e0a04 358 //\r
359 // Set the default precision for string to be zero if not specified.\r
360 //\r
361 if ((Flags & PRECISION) == 0) {\r
362 Precision = 0;\r
363 }\r
e1f414b6 364 break;\r
365\r
366 case 'c':\r
367 Character = VA_ARG (Marker, UINTN) & 0xffff;\r
368 ArgumentString = (CHAR8 *)&Character;\r
369 Flags |= ARGUMENT_UNICODE;\r
370 break;\r
371\r
372 case 'g':\r
373 TmpGuid = VA_ARG (Marker, GUID *);\r
374 if (TmpGuid == NULL) {\r
375 ArgumentString = "<null guid>";\r
376 } else {\r
377 BasePrintLibSPrint (\r
378 ValueBuffer,\r
379 MAXIMUM_VALUE_CHARACTERS, \r
380 0,\r
381 "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",\r
382 TmpGuid->Data1,\r
383 TmpGuid->Data2,\r
384 TmpGuid->Data3,\r
385 TmpGuid->Data4[0],\r
386 TmpGuid->Data4[1],\r
387 TmpGuid->Data4[2],\r
388 TmpGuid->Data4[3],\r
389 TmpGuid->Data4[4],\r
390 TmpGuid->Data4[5],\r
391 TmpGuid->Data4[6],\r
392 TmpGuid->Data4[7]\r
393 );\r
394 ArgumentString = ValueBuffer;\r
395 }\r
396 break;\r
397\r
398 case 't':\r
399 TmpTime = VA_ARG (Marker, TIME *); \r
400 if (TmpTime == NULL) {\r
401 ArgumentString = "<null time>";\r
402 } else {\r
403 BasePrintLibSPrint (\r
404 ValueBuffer,\r
405 MAXIMUM_VALUE_CHARACTERS,\r
406 0,\r
407 "%02d/%02d/%04d %02d:%02d",\r
408 TmpTime->Month,\r
409 TmpTime->Day,\r
410 TmpTime->Year,\r
411 TmpTime->Hour,\r
412 TmpTime->Minute\r
413 );\r
414 ArgumentString = ValueBuffer;\r
415 }\r
416 break;\r
417\r
418 case 'r':\r
419 Status = VA_ARG (Marker, RETURN_STATUS);\r
420 ArgumentString = ValueBuffer;\r
421 if (RETURN_ERROR (Status)) {\r
422 //\r
423 // Clear error bit\r
424 //\r
425 Index = Status & ~MAX_BIT;\r
426 if (Index > 0 && Index <= ERROR_STATUS_NUMBER) {\r
427 ArgumentString = StatusString [Index + WARNING_STATUS_NUMBER];\r
428 }\r
429 } else {\r
430 Index = Status;\r
431 if (Index <= WARNING_STATUS_NUMBER) {\r
432 ArgumentString = StatusString [Index];\r
433 }\r
434 }\r
435 if (ArgumentString == ValueBuffer) {\r
436 BasePrintLibSPrint ((CHAR8 *) ValueBuffer, MAXIMUM_VALUE_CHARACTERS, 0, "%08X", Status);\r
437 }\r
438 break;\r
439\r
440 case '\n':\r
441 ArgumentString = "\n\r";\r
442 break;\r
443\r
444 case '%':\r
445 default:\r
446 //\r
447 // if the type is '%' or unknown, then print it to the screen\r
448 //\r
449 ArgumentString = (CHAR8 *)&FormatCharacter;\r
450 Flags |= ARGUMENT_UNICODE;\r
451 break;\r
452 }\r
453 break;\r
454 \r
455 case '\n':\r
456 ArgumentString = "\n\r";\r
457 break;\r
458\r
459 default:\r
460 ArgumentString = (CHAR8 *)&FormatCharacter;\r
461 Flags |= ARGUMENT_UNICODE;\r
462 break;\r
463 }\r
464\r
465 //\r
466 // Retrieve the ArgumentString attriubutes\r
467 //\r
468 if ((Flags & ARGUMENT_UNICODE) != 0) {\r
469 ArgumentMask = 0xffff;\r
470 BytesPerArgumentCharacter = 2;\r
471 } else {\r
472 ArgumentMask = 0xff;\r
473 BytesPerArgumentCharacter = 1;\r
474 }\r
475 if ((Flags & ARGUMENT_REVERSED) != 0) {\r
476 BytesPerArgumentCharacter = -BytesPerArgumentCharacter;\r
477 } else {\r
478 //\r
479 // Compute the number of characters in ArgumentString and store it in Count\r
480 // ArgumentString is either null-terminated, or it contains Precision characters\r
481 //\r
482 for (Count = 0; Count < Precision || ((Flags & PRECISION) == 0); Count++) {\r
483 ArgumentCharacter = ((ArgumentString[Count * BytesPerArgumentCharacter] & 0xff) | ((ArgumentString[Count * BytesPerArgumentCharacter + 1]) << 8)) & ArgumentMask;\r
484 if (ArgumentCharacter == 0) {\r
485 break;\r
486 }\r
487 }\r
488 }\r
489\r
490 if (Precision < Count) {\r
491 Precision = Count;\r
492 }\r
493\r
494 //\r
495 // Pad before the string\r
496 //\r
497 if ((Flags & (PAD_TO_WIDTH | LEFT_JUSTIFY)) == (PAD_TO_WIDTH)) {\r
498 Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, Width - Precision, ' ', BytesPerOutputCharacter);\r
499 }\r
500\r
501 if (ZeroPad) {\r
502 if (Prefix != 0) {\r
503 Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, Prefix, BytesPerOutputCharacter);\r
504 }\r
505 Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, Precision - Count, '0', BytesPerOutputCharacter);\r
506 } else {\r
507 Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, Precision - Count, ' ', BytesPerOutputCharacter);\r
508 if (Prefix != 0) {\r
509 Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, Prefix, BytesPerOutputCharacter);\r
510 }\r
511 }\r
512\r
513 //\r
514 // Output the Prefix character if it is present\r
515 //\r
516 Index = 0;\r
517 if (Prefix != 0) {\r
518 Index++;\r
519 }\r
520\r
521 //\r
522 // Copy the string into the output buffer performing the required type conversions\r
523 //\r
524 while (Index < Count) {\r
525 ArgumentCharacter = ((*ArgumentString & 0xff) | (*(ArgumentString + 1) << 8)) & ArgumentMask;\r
526\r
527 Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, ArgumentCharacter, BytesPerOutputCharacter);\r
528 ArgumentString += BytesPerArgumentCharacter;\r
529 Index++;\r
530 if (Comma) {\r
531 Digits++;\r
532 if (Digits == 3) {\r
533 Digits = 0;\r
534 Index++;\r
535 if (Index < Count) {\r
536 Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, ',', BytesPerOutputCharacter);\r
537 }\r
538 }\r
539 }\r
540 }\r
541\r
542 //\r
543 // Pad after the string\r
544 //\r
545 if ((Flags & (PAD_TO_WIDTH | LEFT_JUSTIFY)) == (PAD_TO_WIDTH | LEFT_JUSTIFY)) {\r
546 Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, Width - Precision, ' ', BytesPerOutputCharacter);\r
547 }\r
548\r
549 //\r
550 // Get the next character from the format string\r
551 //\r
552 Format += BytesPerFormatCharacter;\r
553\r
554 //\r
555 // Get the next character from the format string\r
556 //\r
e7fe4996 557 FormatCharacter = ((*Format & 0xff) | (*(Format + 1) << 8)) & FormatMask;\r
e1f414b6 558 }\r
559\r
560 //\r
561 // Null terminate the Unicode or ASCII string\r
562 //\r
563 BasePrintLibFillBuffer (Buffer, EndBuffer + BytesPerOutputCharacter, 1, 0, BytesPerOutputCharacter);\r
564 //\r
565 // Make sure output buffer cannot contain more than PcdMaximumUnicodeStringLength\r
566 // Unicode characters if PcdMaximumUnicodeStringLength is not zero. \r
567 //\r
568 ASSERT ((((Flags & OUTPUT_UNICODE) == 0)) || (StrSize ((CHAR16 *) OriginalBuffer) != 0));\r
569 //\r
570 // Make sure output buffer cannot contain more than PcdMaximumAsciiStringLength\r
571 // ASCII characters if PcdMaximumAsciiStringLength is not zero. \r
572 //\r
573 ASSERT ((((Flags & OUTPUT_UNICODE) != 0)) || (AsciiStrSize (OriginalBuffer) != 0));\r
574\r
575 return ((Buffer - OriginalBuffer) / BytesPerOutputCharacter);\r
576}\r
577\r
578/**\r
579 Worker function that produces a Null-terminated string in an output buffer \r
580 based on a Null-terminated format string and variable argument list.\r
581\r
582 VSPrint function to process format and place the results in Buffer. Since a \r
583 VA_LIST is used this rountine allows the nesting of Vararg routines. Thus \r
584 this is the main print working routine.\r
585\r
586 @param Buffer Character buffer to print the results of the parsing\r
587 of Format into.\r
588 @param BufferSize Maximum number of characters to put into buffer.\r
589 Zero means no limit.\r
590 @param Flags Intial flags value.\r
591 Can only have FORMAT_UNICODE and OUTPUT_UNICODE set\r
592 @param FormatString Null-terminated format string.\r
593\r
594 @return Number of characters printed not including the Null-terminator.\r
595\r
596**/\r
597UINTN\r
598BasePrintLibSPrint (\r
599 OUT CHAR8 *StartOfBuffer,\r
600 IN UINTN BufferSize,\r
601 IN UINTN Flags,\r
602 IN CONST CHAR8 *FormatString,\r
603 ...\r
604 )\r
605{\r
606 VA_LIST Marker;\r
607\r
608 VA_START (Marker, FormatString);\r
609 return BasePrintLibVSPrint (StartOfBuffer, BufferSize, Flags, FormatString, Marker);\r
610}\r
611\r
612/**\r
613 Produces a Null-terminated Unicode string in an output buffer based on \r
614 a Null-terminated Unicode format string and a VA_LIST argument list\r
615 \r
616 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer\r
617 and BufferSize. \r
618 The Unicode string is produced by parsing the format string specified by FormatString. \r
619 Arguments are pulled from the variable argument list specified by Marker based on the \r
620 contents of the format string. \r
621 The number of Unicode characters in the produced output buffer is returned not including\r
622 the Null-terminator.\r
623 If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.\r
624\r
625 If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().\r
626 If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().\r
627 If BufferSize > 1 and FormatString is NULL, then ASSERT().\r
628 If BufferSize > 1 and FormatString is not aligned on a 16-bit boundary, then ASSERT().\r
629 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than \r
630 PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then\r
631 ASSERT().\r
632 If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r
633 contains more than PcdMaximumUnicodeStringLength Unicode characters not including the\r
634 Null-terminator, then ASSERT().\r
635\r
636 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated \r
637 Unicode string.\r
638 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.\r
639 @param FormatString Null-terminated Unicode format string.\r
640 @param Marker VA_LIST marker for the variable argument list.\r
641 \r
642 @return The number of Unicode characters in the produced output buffer not including the\r
643 Null-terminator.\r
644\r
645**/\r
646UINTN\r
647EFIAPI\r
648UnicodeVSPrint (\r
649 OUT CHAR16 *StartOfBuffer,\r
650 IN UINTN BufferSize,\r
651 IN CONST CHAR16 *FormatString,\r
652 IN VA_LIST Marker\r
653 )\r
654{\r
655 ASSERT_UNICODE_BUFFER(StartOfBuffer);\r
656 ASSERT_UNICODE_BUFFER(FormatString);\r
657 return BasePrintLibVSPrint ((CHAR8 *)StartOfBuffer, BufferSize >> 1, FORMAT_UNICODE | OUTPUT_UNICODE, (CHAR8 *)FormatString, Marker);\r
658}\r
659\r
660/**\r
661 Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated \r
662 Unicode format string and variable argument list.\r
663 \r
664 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer\r
665 and BufferSize.\r
666 The Unicode string is produced by parsing the format string specified by FormatString.\r
667 Arguments are pulled from the variable argument list based on the contents of the format string.\r
668 The number of Unicode characters in the produced output buffer is returned not including\r
669 the Null-terminator.\r
670 If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.\r
671\r
672 If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().\r
673 If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().\r
674 If BufferSize > 1 and FormatString is NULL, then ASSERT().\r
675 If BufferSize > 1 and FormatString is not aligned on a 16-bit boundary, then ASSERT().\r
676 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than \r
677 PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then\r
678 ASSERT().\r
679 If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r
680 contains more than PcdMaximumUnicodeStringLength Unicode characters not including the\r
681 Null-terminator, then ASSERT().\r
682\r
683 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated \r
684 Unicode string.\r
685 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.\r
686 @param FormatString Null-terminated Unicode format string.\r
687 \r
688 @return The number of Unicode characters in the produced output buffer not including the\r
689 Null-terminator.\r
690\r
691**/\r
692UINTN\r
693EFIAPI\r
694UnicodeSPrint (\r
695 OUT CHAR16 *StartOfBuffer,\r
696 IN UINTN BufferSize,\r
697 IN CONST CHAR16 *FormatString,\r
698 ...\r
699 )\r
700{\r
701 VA_LIST Marker;\r
702\r
703 VA_START (Marker, FormatString);\r
704 return UnicodeVSPrint (StartOfBuffer, BufferSize, FormatString, Marker);\r
705}\r
706\r
707/**\r
708 Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated\r
709 ASCII format string and a VA_LIST argument list\r
710 \r
711 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer\r
712 and BufferSize.\r
713 The Unicode string is produced by parsing the format string specified by FormatString.\r
714 Arguments are pulled from the variable argument list specified by Marker based on the \r
715 contents of the format string.\r
716 The number of Unicode characters in the produced output buffer is returned not including\r
717 the Null-terminator.\r
718 If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.\r
719\r
720 If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().\r
721 If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().\r
722 If BufferSize > 1 and FormatString is NULL, then ASSERT().\r
723 If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than\r
724 PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then\r
725 ASSERT().\r
726 If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r
727 contains more than PcdMaximumUnicodeStringLength Unicode characters not including the\r
728 Null-terminator, then ASSERT().\r
729\r
730 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated \r
731 Unicode string.\r
732 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.\r
733 @param FormatString Null-terminated Unicode format string.\r
734 @param Marker VA_LIST marker for the variable argument list.\r
735 \r
736 @return The number of Unicode characters in the produced output buffer not including the\r
737 Null-terminator.\r
738\r
739**/\r
740UINTN\r
741EFIAPI\r
742UnicodeVSPrintAsciiFormat (\r
743 OUT CHAR16 *StartOfBuffer,\r
744 IN UINTN BufferSize,\r
745 IN CONST CHAR8 *FormatString,\r
746 IN VA_LIST Marker\r
747 )\r
748{\r
749 ASSERT_UNICODE_BUFFER(StartOfBuffer);\r
750 return BasePrintLibVSPrint ((CHAR8 *)StartOfBuffer, BufferSize >> 1, OUTPUT_UNICODE,FormatString, Marker);\r
751}\r
752\r
753/**\r
754 Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated \r
755 ASCII format string and variable argument list.\r
756 \r
757 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer\r
758 and BufferSize.\r
759 The Unicode string is produced by parsing the format string specified by FormatString.\r
760 Arguments are pulled from the variable argument list based on the contents of the \r
761 format string.\r
762 The number of Unicode characters in the produced output buffer is returned not including\r
763 the Null-terminator.\r
764 If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.\r
765\r
766 If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().\r
767 If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().\r
768 If BufferSize > 1 and FormatString is NULL, then ASSERT().\r
769 If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than\r
770 PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then\r
771 ASSERT().\r
772 If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r
773 contains more than PcdMaximumUnicodeStringLength Unicode characters not including the\r
774 Null-terminator, then ASSERT().\r
775\r
776 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated \r
777 Unicode string.\r
778 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.\r
779 @param FormatString Null-terminated Unicode format string.\r
780 \r
781 @return The number of Unicode characters in the produced output buffer not including the\r
782 Null-terminator.\r
783\r
784**/\r
785UINTN\r
786EFIAPI\r
787UnicodeSPrintAsciiFormat (\r
788 OUT CHAR16 *StartOfBuffer,\r
789 IN UINTN BufferSize,\r
790 IN CONST CHAR8 *FormatString,\r
791 ...\r
792 )\r
793{\r
794 VA_LIST Marker;\r
795\r
796 VA_START (Marker, FormatString);\r
797 return UnicodeVSPrintAsciiFormat (StartOfBuffer, BufferSize, FormatString, Marker);\r
798}\r
799\r
800/**\r
801 Converts a decimal value to a Null-terminated Unicode string.\r
802 \r
803 Converts the decimal number specified by Value to a Null-terminated Unicode \r
804 string specified by Buffer containing at most Width characters. No padding of spaces \r
805 is ever performed. If Width is 0 then a width of MAXIMUM_VALUE_CHARACTERS is assumed.\r
806 The number of Unicode characters in Buffer is returned not including the Null-terminator.\r
807 If the conversion contains more than Width characters, then only the first\r
808 Width characters are returned, and the total number of characters \r
809 required to perform the conversion is returned.\r
810 Additional conversion parameters are specified in Flags. \r
811 \r
812 The Flags bit LEFT_JUSTIFY is always ignored.\r
813 All conversions are left justified in Buffer.\r
814 If Width is 0, PREFIX_ZERO is ignored in Flags.\r
815 If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and commas\r
816 are inserted every 3rd digit starting from the right.\r
817 If HEX_RADIX is set in Flags, then the output buffer will be \r
818 formatted in hexadecimal format.\r
819 If Value is < 0 and HEX_RADIX is not set in Flags, then the fist character in Buffer is a '-'.\r
820 If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored, \r
821 then Buffer is padded with '0' characters so the combination of the optional '-' \r
822 sign character, '0' characters, digit characters for Value, and the Null-terminator\r
823 add up to Width characters.\r
824 If both COMMA_TYPE and HEX_RADIX are set in Flags, then ASSERT().\r
825 If Buffer is NULL, then ASSERT().\r
826 If Buffer is not aligned on a 16-bit boundary, then ASSERT().\r
827 If unsupported bits are set in Flags, then ASSERT().\r
828 If both COMMA_TYPE and HEX_RADIX are set in Flags, then ASSERT().\r
829 If Width >= MAXIMUM_VALUE_CHARACTERS, then ASSERT()\r
830\r
831 @param Buffer Pointer to the output buffer for the produced Null-terminated\r
832 Unicode string.\r
833 @param Flags The bitmask of flags that specify left justification, zero pad, and commas.\r
834 @param Value The 64-bit signed value to convert to a string.\r
835 @param Width The maximum number of Unicode characters to place in Buffer, not including\r
836 the Null-terminator.\r
837 \r
838 @return The number of Unicode characters in Buffer not including the Null-terminator.\r
839\r
840**/\r
841UINTN\r
842EFIAPI\r
843UnicodeValueToString (\r
844 IN OUT CHAR16 *Buffer,\r
845 IN UINTN Flags,\r
846 IN INT64 Value,\r
847 IN UINTN Width\r
848 )\r
849{\r
850 ASSERT_UNICODE_BUFFER(Buffer);\r
851 return BasePrintLibConvertValueToString ((CHAR8 *)Buffer, Flags, Value, Width, 2);\r
852}\r
853\r
854/**\r
855 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated\r
856 ASCII format string and a VA_LIST argument list.\r
857 \r
858 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer\r
859 and BufferSize.\r
860 The ASCII string is produced by parsing the format string specified by FormatString.\r
861 Arguments are pulled from the variable argument list specified by Marker based on \r
862 the contents of the format string.\r
863 The number of ASCII characters in the produced output buffer is returned not including\r
864 the Null-terminator.\r
865 If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
866\r
867 If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().\r
868 If BufferSize > 0 and FormatString is NULL, then ASSERT().\r
869 If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than\r
870 PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then\r
871 ASSERT().\r
872 If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string\r
873 contains more than PcdMaximumAsciiStringLength ASCII characters not including the\r
874 Null-terminator, then ASSERT().\r
875\r
876 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated \r
877 ASCII string.\r
878 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.\r
879 @param FormatString Null-terminated Unicode format string.\r
880 @param Marker VA_LIST marker for the variable argument list.\r
881 \r
882 @return The number of ASCII characters in the produced output buffer not including the\r
883 Null-terminator.\r
884\r
885**/\r
886UINTN\r
887EFIAPI\r
888AsciiVSPrint (\r
889 OUT CHAR8 *StartOfBuffer,\r
890 IN UINTN BufferSize,\r
891 IN CONST CHAR8 *FormatString,\r
892 IN VA_LIST Marker\r
893 )\r
894{\r
895 return BasePrintLibVSPrint (StartOfBuffer, BufferSize, 0, FormatString, Marker);\r
896}\r
897\r
898/**\r
899 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated\r
900 ASCII format string and variable argument list.\r
901 \r
902 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer\r
903 and BufferSize.\r
904 The ASCII string is produced by parsing the format string specified by FormatString.\r
905 Arguments are pulled from the variable argument list based on the contents of the \r
906 format string.\r
907 The number of ASCII characters in the produced output buffer is returned not including\r
908 the Null-terminator.\r
909 If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
910\r
911 If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().\r
912 If BufferSize > 0 and FormatString is NULL, then ASSERT().\r
913 If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than\r
914 PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then\r
915 ASSERT().\r
916 If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string\r
917 contains more than PcdMaximumAsciiStringLength ASCII characters not including the\r
918 Null-terminator, then ASSERT().\r
919\r
920 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated \r
921 ASCII string.\r
922 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.\r
923 @param FormatString Null-terminated Unicode format string.\r
924 \r
925 @return The number of ASCII characters in the produced output buffer not including the\r
926 Null-terminator.\r
927\r
928**/\r
929UINTN\r
930EFIAPI\r
931AsciiSPrint (\r
932 OUT CHAR8 *StartOfBuffer,\r
933 IN UINTN BufferSize,\r
934 IN CONST CHAR8 *FormatString,\r
935 ...\r
936 )\r
937{\r
938 VA_LIST Marker;\r
939\r
940 VA_START (Marker, FormatString);\r
941 return AsciiVSPrint (StartOfBuffer, BufferSize, FormatString, Marker);\r
942}\r
943\r
944/**\r
945 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated\r
946 ASCII format string and a VA_LIST argument list.\r
947 \r
948 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer\r
949 and BufferSize.\r
950 The ASCII string is produced by parsing the format string specified by FormatString.\r
951 Arguments are pulled from the variable argument list specified by Marker based on \r
952 the contents of the format string.\r
953 The number of ASCII characters in the produced output buffer is returned not including\r
954 the Null-terminator.\r
955 If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
956\r
957 If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().\r
958 If BufferSize > 0 and FormatString is NULL, then ASSERT().\r
959 If BufferSize > 0 and FormatString is not aligned on a 16-bit boundary, then ASSERT().\r
960 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than\r
961 PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then\r
962 ASSERT().\r
963 If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string\r
964 contains more than PcdMaximumAsciiStringLength ASCII characters not including the\r
965 Null-terminator, then ASSERT().\r
966\r
967 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated \r
968 ASCII string.\r
969 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.\r
970 @param FormatString Null-terminated Unicode format string.\r
971 @param Marker VA_LIST marker for the variable argument list.\r
972 \r
973 @return The number of ASCII characters in the produced output buffer not including the\r
974 Null-terminator.\r
975\r
976**/\r
977UINTN\r
978EFIAPI\r
979AsciiVSPrintUnicodeFormat (\r
980 OUT CHAR8 *StartOfBuffer,\r
981 IN UINTN BufferSize,\r
982 IN CONST CHAR16 *FormatString,\r
983 IN VA_LIST Marker\r
984 )\r
985{\r
986 ASSERT_UNICODE_BUFFER (FormatString);\r
987 return BasePrintLibVSPrint (StartOfBuffer, BufferSize, FORMAT_UNICODE, (CHAR8 *)FormatString, Marker);\r
988}\r
989\r
990/**\r
991 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated\r
992 ASCII format string and variable argument list.\r
993 \r
994 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer\r
995 and BufferSize.\r
996 The ASCII string is produced by parsing the format string specified by FormatString.\r
997 Arguments are pulled from the variable argument list based on the contents of the \r
998 format string.\r
999 The number of ASCII characters in the produced output buffer is returned not including\r
1000 the Null-terminator.\r
1001 If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
1002\r
1003 If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().\r
1004 If BufferSize > 0 and FormatString is NULL, then ASSERT().\r
1005 If BufferSize > 0 and FormatString is not aligned on a 16-bit boundary, then ASSERT().\r
1006 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than\r
1007 PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then\r
1008 ASSERT().\r
1009 If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string\r
1010 contains more than PcdMaximumAsciiStringLength ASCII characters not including the\r
1011 Null-terminator, then ASSERT().\r
1012\r
1013 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated \r
1014 ASCII string.\r
1015 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.\r
1016 @param FormatString Null-terminated Unicode format string.\r
1017 \r
1018 @return The number of ASCII characters in the produced output buffer not including the\r
1019 Null-terminator.\r
1020\r
1021**/\r
1022UINTN\r
1023EFIAPI\r
1024AsciiSPrintUnicodeFormat (\r
1025 OUT CHAR8 *StartOfBuffer,\r
1026 IN UINTN BufferSize,\r
1027 IN CONST CHAR16 *FormatString,\r
1028 ...\r
1029 )\r
1030{\r
1031 VA_LIST Marker;\r
1032\r
1033 VA_START (Marker, FormatString);\r
1034 return AsciiVSPrintUnicodeFormat (StartOfBuffer, BufferSize, FormatString, Marker);\r
1035}\r
1036\r
1037\r
1038/**\r
1039 Converts a decimal value to a Null-terminated ASCII string.\r
1040 \r
1041 Converts the decimal number specified by Value to a Null-terminated ASCII string \r
1042 specified by Buffer containing at most Width characters. No padding of spaces \r
1043 is ever performed.\r
1044 If Width is 0 then a width of MAXIMUM_VALUE_CHARACTERS is assumed.\r
1045 The number of ASCII characters in Buffer is returned not including the Null-terminator.\r
1046 If the conversion contains more than Width characters, then only the first Width\r
1047 characters are returned, and the total number of characters required to perform\r
1048 the conversion is returned.\r
1049 Additional conversion parameters are specified in Flags. \r
1050 The Flags bit LEFT_JUSTIFY is always ignored.\r
1051 All conversions are left justified in Buffer.\r
1052 If Width is 0, PREFIX_ZERO is ignored in Flags.\r
1053 If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and commas\r
1054 are inserted every 3rd digit starting from the right.\r
1055 If HEX_RADIX is set in Flags, then the output buffer will be \r
1056 formatted in hexadecimal format.\r
1057 If Value is < 0 and HEX_RADIX is not set in Flags, then the fist character in Buffer is a '-'.\r
1058 If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored, \r
1059 then Buffer is padded with '0' characters so the combination of the optional '-' \r
1060 sign character, '0' characters, digit characters for Value, and the Null-terminator\r
1061 add up to Width characters.\r
1062 \r
1063 If Buffer is NULL, then ASSERT().\r
1064 If unsupported bits are set in Flags, then ASSERT().\r
1065 If both COMMA_TYPE and HEX_RADIX are set in Flags, then ASSERT().\r
1066 If Width >= MAXIMUM_VALUE_CHARACTERS, then ASSERT()\r
1067\r
1068 @param Buffer Pointer to the output buffer for the produced Null-terminated\r
1069 ASCII string.\r
1070 @param Flags The bitmask of flags that specify left justification, zero pad, and commas.\r
1071 @param Value The 64-bit signed value to convert to a string.\r
1072 @param Width The maximum number of ASCII characters to place in Buffer, not including\r
1073 the Null-terminator.\r
1074 \r
1075 @return The number of ASCII characters in Buffer not including the Null-terminator.\r
1076\r
1077**/\r
1078UINTN\r
1079EFIAPI\r
1080AsciiValueToString (\r
1081 IN OUT CHAR8 *Buffer,\r
1082 IN UINTN Flags,\r
1083 IN INT64 Value,\r
1084 IN UINTN Width\r
1085 )\r
1086{\r
1087 return BasePrintLibConvertValueToString (Buffer, Flags, Value, Width, 1);\r
1088}\r
1089\r