Add new OSS License
[mirror_edk2.git] / Tools / Source / TianoTools / String / PrintLib.c
CommitLineData
d2ec0d9e 1/** @file\r
2 Print Library.\r
3\r
cf171110 4\r
5Copyright (c) 2004-2006 Intel Corporation. All rights reserved\r
6This software and associated documentation (if any) is furnished\r
7under a license and may only be used or copied in accordance\r
8with the terms of the license. Except as permitted by such\r
9license, no part of this software or documentation may be\r
10reproduced, stored in a retrieval system, or transmitted in any\r
11form or by any means without the express written consent of\r
12Intel Corporation.\r
d2ec0d9e 13\r
14 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
15 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
16\r
17 Module Name: PrintLib.c\r
18\r
19**/\r
20\r
ce53a8c3 21#include <Common/UefiBaseTypes.h>\r
22#include <Library/PrintLib.h>\r
23\r
24#include "CommonLib.h"\r
d2ec0d9e 25#include "PrintLibInternal.h"\r
26\r
27typedef struct {\r
28 RETURN_STATUS Status;\r
29 CHAR8 *String;\r
30} STATUS_LOOKUP_TABLE_ENTRY;\r
31\r
32static CONST STATUS_LOOKUP_TABLE_ENTRY StatusString[] = {\r
33 { RETURN_SUCCESS, "Success" },\r
34 { RETURN_LOAD_ERROR, "Load Error" },\r
35 { RETURN_INVALID_PARAMETER, "Invalid Parameter" },\r
36 { RETURN_UNSUPPORTED, "Unsupported" },\r
37 { RETURN_BAD_BUFFER_SIZE, "Bad Buffer Size" },\r
38 { RETURN_BUFFER_TOO_SMALL, "Buffer Too Small" },\r
39 { RETURN_NOT_READY, "Not Ready" },\r
40 { RETURN_DEVICE_ERROR, "Device Error" },\r
41 { RETURN_WRITE_PROTECTED, "Write Protected" },\r
42 { RETURN_OUT_OF_RESOURCES, "Out of Resources" },\r
43 { RETURN_VOLUME_CORRUPTED, "Volume Corrupt" },\r
44 { RETURN_VOLUME_FULL, "Volume Full" },\r
45 { RETURN_NO_MEDIA, "No Media" },\r
46 { RETURN_MEDIA_CHANGED, "Media changed" },\r
47 { RETURN_NOT_FOUND, "Not Found" },\r
48 { RETURN_ACCESS_DENIED, "Access Denied" },\r
49 { RETURN_NO_RESPONSE, "No Response" },\r
50 { RETURN_NO_MAPPING, "No mapping" },\r
51 { RETURN_TIMEOUT, "Time out" },\r
52 { RETURN_NOT_STARTED, "Not started" },\r
53 { RETURN_ALREADY_STARTED, "Already started" },\r
54 { RETURN_ABORTED, "Aborted" },\r
55 { RETURN_ICMP_ERROR, "ICMP Error" },\r
56 { RETURN_TFTP_ERROR, "TFTP Error" },\r
57 { RETURN_PROTOCOL_ERROR, "Protocol Error" },\r
58 { RETURN_WARN_UNKNOWN_GLYPH, "Warning Unknown Glyph" },\r
59 { RETURN_WARN_DELETE_FAILURE, "Warning Delete Failure" },\r
60 { RETURN_WARN_WRITE_FAILURE, "Warning Write Failure" },\r
61 { RETURN_WARN_BUFFER_TOO_SMALL, "Warning Buffer Too Small" },\r
62 { 0, NULL }\r
63};\r
64\r
65\r
66/**\r
67 VSPrint function to process format and place the results in Buffer. Since a \r
68 VA_LIST is used this rountine allows the nesting of Vararg routines. Thus \r
69 this is the main print working routine\r
70\r
71 @param StartOfBuffer Unicode buffer to print the results of the parsing of Format into.\r
72 \r
73 @param BufferSize Maximum number of characters to put into buffer. Zero means\r
74 no limit.\r
75 \r
76 @param Flags Intial flags value. Can only have FORMAT_UNICODE and OUTPUT_UNICODE set\r
77 \r
78 @param FormatString Unicode format string see file header for more details.\r
79 \r
80 @param Marker Vararg list consumed by processing Format.\r
81\r
82 @return Number of characters printed.\r
83\r
84**/\r
85UINTN\r
86BasePrintLibVSPrint (\r
87 OUT CHAR8 *Buffer,\r
88 IN UINTN BufferSize,\r
89 IN UINTN Flags,\r
90 IN CONST CHAR8 *Format,\r
91 IN VA_LIST Marker\r
92 )\r
93{\r
94 CHAR8 *OriginalBuffer;\r
95 CHAR8 ValueBuffer[MAXIMUM_VALUE_CHARACTERS];\r
96 UINTN BytesPerOutputCharacter;\r
97 UINTN BytesPerFormatCharacter;\r
98 UINTN FormatMask;\r
99 UINTN FormatCharacter;\r
100 UINTN Width;\r
101 UINTN Precision;\r
102 INT64 Value;\r
103 CHAR8 *ArgumentString;\r
104 UINTN Character;\r
105 GUID *TmpGuid;\r
106 TIME *TmpTime;\r
107 UINTN Count;\r
108 UINTN ArgumentMask;\r
109 INTN BytesPerArgumentCharacter;\r
110 UINTN ArgumentCharacter;\r
111 BOOLEAN Done;\r
112 UINTN Index;\r
113 CHAR8 Prefix;\r
114 BOOLEAN ZeroPad;\r
115 BOOLEAN Comma;\r
116 UINTN Digits;\r
117 UINTN Radix;\r
118 RETURN_STATUS Status;\r
119\r
120 OriginalBuffer = Buffer;\r
121\r
122 if ((Flags & OUTPUT_UNICODE) != 0) {\r
123 BytesPerOutputCharacter = 2;\r
124 } else {\r
125 BytesPerOutputCharacter = 1;\r
126 }\r
127 if ((Flags & FORMAT_UNICODE) != 0) {\r
128 BytesPerFormatCharacter = 2;\r
129 FormatMask = 0xffff;\r
130 } else {\r
131 BytesPerFormatCharacter = 1;\r
132 FormatMask = 0xff;\r
133 }\r
134\r
135 //\r
136 // Reserve space for the Null terminator.\r
137 // If BufferSize is 0, this will set BufferSize to the max unsigned value\r
138 //\r
139 BufferSize--;\r
140\r
141 //\r
142 // Get the first character from the format string\r
143 //\r
144 FormatCharacter = (*Format | (*(Format + 1) << 8)) & FormatMask;\r
145\r
146 //\r
147 // Loop until the end of the format string is reached or the output buffer is full\r
148 //\r
149 while (FormatCharacter != 0 && BufferSize > 0) {\r
150 //\r
151 // Clear all the flag bits except those that may have been passed in\r
152 //\r
153 Flags &= (OUTPUT_UNICODE | FORMAT_UNICODE);\r
154\r
155 //\r
156 // Set the default width to zero, and the default precision to 1\r
157 //\r
158 Width = 0;\r
159 Precision = 1;\r
160 Prefix = 0;\r
161 Comma = FALSE;\r
162 ZeroPad = FALSE;\r
163 Count = 0;\r
164 Digits = 0;\r
165\r
166 switch (FormatCharacter) {\r
167 case '%':\r
168 //\r
169 // Parse Flags and Width\r
170 //\r
171 for (Done = FALSE; !Done; ) {\r
172 Format += BytesPerFormatCharacter;\r
173 FormatCharacter = (*Format | (*(Format + 1) << 8)) & FormatMask;\r
174 switch (FormatCharacter) {\r
175 case '.': \r
176 Flags |= PRECISION; \r
177 break;\r
178 case '-': \r
179 Flags |= LEFT_JUSTIFY; \r
180 break;\r
181 case '+': \r
182 Flags |= PREFIX_SIGN; \r
183 break;\r
184 case ' ': \r
185 Flags |= PREFIX_BLANK; \r
186 break;\r
187 case ',': \r
188 Flags |= COMMA_TYPE; \r
189 break;\r
190 case 'L':\r
191 case 'l': \r
192 Flags |= LONG_TYPE; \r
193 break;\r
194 case '*':\r
195 if ((Flags & PRECISION) == 0) {\r
196 Flags |= PAD_TO_WIDTH;\r
197 Width = VA_ARG (Marker, UINTN);\r
198 } else {\r
199 Precision = VA_ARG (Marker, UINTN);\r
200 }\r
201 break;\r
202 case '0':\r
203 if ((Flags & PRECISION) == 0) {\r
204 Flags |= PREFIX_ZERO;\r
205 }\r
206 case '1':\r
207 case '2':\r
208 case '3':\r
209 case '4':\r
210 case '5':\r
211 case '6':\r
212 case '7':\r
213 case '8':\r
214 case '9':\r
215 for (Count = 0; ((FormatCharacter >= '0') && (FormatCharacter <= '9')); ){\r
216 Count = (Count * 10) + FormatCharacter - '0';\r
217 Format += BytesPerFormatCharacter;\r
218 FormatCharacter = (*Format | (*(Format + 1) << 8)) & FormatMask;\r
219 }\r
220 Format -= BytesPerFormatCharacter;\r
221 if ((Flags & PRECISION) == 0) {\r
222 Flags |= PAD_TO_WIDTH;\r
223 Width = Count;\r
224 } else {\r
225 Precision = Count;\r
226 }\r
227 break;\r
228 default:\r
229 Done = TRUE;\r
230 break;\r
231 }\r
232 } \r
233\r
234 //\r
235 // Limit the maximum field width to the remaining characters in the output buffer\r
236 //\r
237 if (Width > BufferSize) {\r
238 Width = BufferSize;\r
239 }\r
240\r
241 //\r
242 // Handle each argument type\r
243 //\r
244 switch (FormatCharacter) {\r
245 case 'X':\r
246 Flags |= PREFIX_ZERO;\r
247 //\r
248 // break skiped on purpose\r
249 //\r
250 case 'x':\r
251 Flags |= RADIX_HEX;\r
252 //\r
253 // break skiped on purpose\r
254 //\r
255 case 'd':\r
256 if ((Flags & LONG_TYPE) == 0) {\r
257 Value = (VA_ARG (Marker, INTN));\r
258 } else {\r
259 Value = VA_ARG (Marker, INT64);\r
260 }\r
261 if ((Flags & PREFIX_BLANK) != 0) {\r
262 Prefix = ' ';\r
263 }\r
264 if ((Flags & PREFIX_SIGN) != 0) {\r
265 Prefix = '+';\r
266 }\r
267 if ((Flags & COMMA_TYPE) != 0) {\r
268 Comma = TRUE;\r
269 }\r
270 if ((Flags & RADIX_HEX) == 0) {\r
271 Radix = 10;\r
272 if (Comma) {\r
273 Flags &= (~PREFIX_ZERO);\r
274 Precision = 1;\r
275 }\r
276 if (Value < 0) {\r
277 Flags |= PREFIX_SIGN;\r
278 Prefix = '-';\r
279 Value = -Value;\r
280 }\r
281 } else {\r
282 Radix = 16;\r
283 Comma = FALSE;\r
284 if ((Flags & LONG_TYPE) == 0 && Value < 0) {\r
285 Value = (UINTN)Value;\r
286 }\r
287 }\r
288 //\r
289 // Convert Value to a reversed string\r
290 //\r
291 Count = BasePrintLibValueToString (ValueBuffer, Value, Radix);\r
292 if (Value == 0 && Precision == 0) {\r
293 Count = 0;\r
294 }\r
295 ArgumentString = (CHAR8 *)ValueBuffer + Count;\r
296 Digits = 3 - (Count % 3);\r
297 if (Comma && Count != 0) {\r
298 Count += ((Count - 1) / 3);\r
299 }\r
300 if (Prefix != 0) {\r
301 Count++;\r
302 }\r
303 Flags |= ARGUMENT_REVERSED;\r
304 ZeroPad = TRUE;\r
305 if ((Flags & PREFIX_ZERO) != 0) {\r
306 if ((Flags & PAD_TO_WIDTH) != 0) {\r
307 if ((Flags & PRECISION) == 0) {\r
308 Precision = Width;\r
309 }\r
310 }\r
311 }\r
312 break;\r
313\r
314 case 's':\r
315 case 'S':\r
316 Flags |= ARGUMENT_UNICODE;\r
317 //\r
318 // break skipped on purpose\r
319 //\r
320 case 'a':\r
321 ArgumentString = (CHAR8 *)VA_ARG (Marker, CHAR8 *);\r
322 if (ArgumentString == NULL) {\r
323 Flags &= (~ARGUMENT_UNICODE);\r
324 ArgumentString = "<null string>";\r
325 }\r
326 break;\r
327\r
328 case 'c':\r
329 Character = VA_ARG (Marker, UINTN) & 0xffff;\r
330 ArgumentString = (CHAR8 *)&Character;\r
331 Flags |= ARGUMENT_UNICODE;\r
332 break;\r
333\r
334 case 'g':\r
335 TmpGuid = VA_ARG (Marker, GUID *);\r
336 if (TmpGuid == NULL) {\r
337 ArgumentString = "<null guid>";\r
338 } else {\r
339 BasePrintLibSPrint (\r
340 ValueBuffer,\r
341 0, \r
342 0,\r
343 "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",\r
344 TmpGuid->Data1,\r
345 TmpGuid->Data2,\r
346 TmpGuid->Data3,\r
347 TmpGuid->Data4[0],\r
348 TmpGuid->Data4[1],\r
349 TmpGuid->Data4[2],\r
350 TmpGuid->Data4[3],\r
351 TmpGuid->Data4[4],\r
352 TmpGuid->Data4[5],\r
353 TmpGuid->Data4[6],\r
354 TmpGuid->Data4[7]\r
355 );\r
356 ArgumentString = ValueBuffer;\r
357 }\r
358 break;\r
359\r
360 case 't':\r
361 TmpTime = VA_ARG (Marker, TIME *); \r
362 if (TmpTime == NULL) {\r
363 ArgumentString = "<null time>";\r
364 } else {\r
365 BasePrintLibSPrint (\r
366 ValueBuffer,\r
367 0,\r
368 0,\r
369 "%02d/%02d/%04d %02d:%02d",\r
370 TmpTime->Month,\r
371 TmpTime->Day,\r
372 TmpTime->Year,\r
373 TmpTime->Hour,\r
374 TmpTime->Minute\r
375 );\r
376 ArgumentString = ValueBuffer;\r
377 }\r
378 break;\r
379\r
380 case 'r':\r
381 Status = VA_ARG (Marker, RETURN_STATUS);\r
382 ArgumentString = ValueBuffer;\r
383 for (Index = 0; StatusString[Index].String != NULL; Index++) {\r
384 if (Status == StatusString[Index].Status) {\r
385 ArgumentString = StatusString[Index].String;\r
386 }\r
387 }\r
388 if (ArgumentString == ValueBuffer) {\r
389 BasePrintLibSPrint ((CHAR8 *) ValueBuffer, 0, 0, "%08X", Status);\r
390 }\r
391 break;\r
392\r
393 case '%':\r
394 default:\r
395 //\r
396 // if the type is '%' or unknown, then print it to the screen\r
397 //\r
398 ArgumentString = (CHAR8 *)&FormatCharacter;\r
399 Flags |= ARGUMENT_UNICODE;\r
400 break;\r
401 }\r
402 break;\r
403 case '\n':\r
404 ArgumentString = "\r\n";\r
405 break;\r
406 default:\r
407 ArgumentString = (CHAR8 *)&FormatCharacter;\r
408 Flags |= ARGUMENT_UNICODE;\r
409 break;\r
410 }\r
411\r
412 //\r
413 // Retrieve the ArgumentString attriubutes\r
414 //\r
415 if ((Flags & ARGUMENT_UNICODE) != 0) {\r
416 ArgumentMask = 0xffff;\r
417 BytesPerArgumentCharacter = 2;\r
418 } else {\r
419 ArgumentMask = 0xff;\r
420 BytesPerArgumentCharacter = 1;\r
421 }\r
422 if ((Flags & ARGUMENT_REVERSED) != 0) {\r
423 BytesPerArgumentCharacter = -BytesPerArgumentCharacter;\r
424 } else {\r
425 //\r
426 // Compute the number of characters in ArgumentString and store it in Count\r
427 // ArgumentString is either null-terminated, or it contains Precision characters\r
428 //\r
429 for (Count = 0; Count < Precision || ((Flags & PRECISION) == 0); Count++) {\r
430 ArgumentCharacter = ((ArgumentString[Count * BytesPerArgumentCharacter] & 0xff) | ((ArgumentString[Count * BytesPerArgumentCharacter + 1]) << 8)) & ArgumentMask;\r
431 if (ArgumentCharacter == 0) {\r
432 break;\r
433 }\r
434 }\r
435 }\r
436\r
437 //\r
438 // Limit the length of the string to append to the remaining characters in the output buffer\r
439 //\r
440 if (Count > BufferSize) {\r
441 Count = BufferSize;\r
442 }\r
443 if (Precision < Count) {\r
444 Precision = Count;\r
445 }\r
446\r
447 //\r
448 // Pad before the string\r
449 //\r
450 if ((Flags & (PAD_TO_WIDTH | LEFT_JUSTIFY)) == (PAD_TO_WIDTH)) {\r
451 Buffer = BasePrintLibFillBuffer (Buffer, Width - Precision, ' ', BytesPerOutputCharacter);\r
452 }\r
453\r
454 if (ZeroPad) {\r
455 if (Prefix != 0) {\r
456 Buffer = BasePrintLibFillBuffer (Buffer, 1, Prefix, BytesPerOutputCharacter);\r
457 }\r
458 Buffer = BasePrintLibFillBuffer (Buffer, Precision - Count, '0', BytesPerOutputCharacter);\r
459 } else {\r
460 Buffer = BasePrintLibFillBuffer (Buffer, Precision - Count, ' ', BytesPerOutputCharacter);\r
461 if (Prefix != 0) {\r
462 Buffer = BasePrintLibFillBuffer (Buffer, 1, Prefix, BytesPerOutputCharacter);\r
463 }\r
464 }\r
465\r
466 //\r
467 // Output the Prefix character if it is present\r
468 //\r
469 Index = 0;\r
470 if (Prefix) {\r
471 Index++;\r
472 }\r
473\r
474 //\r
475 // Copy the string into the output buffer performing the required type conversions\r
476 //\r
477 while (Index < Count) {\r
478 ArgumentCharacter = ((*ArgumentString & 0xff) | (*(ArgumentString + 1) << 8)) & ArgumentMask;\r
479\r
480 Buffer = BasePrintLibFillBuffer (Buffer, 1, ArgumentCharacter, BytesPerOutputCharacter);\r
481 ArgumentString += BytesPerArgumentCharacter;\r
482 Index++;\r
483 if (Comma) {\r
484 Digits++;\r
485 if (Digits == 3) {\r
486 Digits = 0;\r
487 Index++;\r
488 if (Index < Count) {\r
489 Buffer = BasePrintLibFillBuffer (Buffer, 1, ',', BytesPerOutputCharacter);\r
490 }\r
491 }\r
492 }\r
493 }\r
494\r
495 //\r
496 // Pad after the string\r
497 //\r
498 if ((Flags & (PAD_TO_WIDTH | LEFT_JUSTIFY)) == (PAD_TO_WIDTH | LEFT_JUSTIFY)) {\r
499 Buffer = BasePrintLibFillBuffer (Buffer, Width - Precision, ' ', BytesPerOutputCharacter);\r
500 }\r
501\r
502 //\r
503 // Reduce the number of characters\r
504 //\r
505 BufferSize -= Count;\r
506\r
507 //\r
508 // Get the next character from the format string\r
509 //\r
510 Format += BytesPerFormatCharacter;\r
511\r
512 //\r
513 // Get the next character from the format string\r
514 //\r
515 FormatCharacter = (*Format | (*(Format + 1) << 8)) & FormatMask;\r
516 }\r
517\r
518 //\r
519 // Null terminate the Unicode or ASCII string\r
520 //\r
521 Buffer = BasePrintLibFillBuffer (Buffer, 1, 0, BytesPerOutputCharacter);\r
522 \r
523 return ((Buffer - OriginalBuffer) / BytesPerOutputCharacter);\r
524}\r
525\r
526UINTN\r
527BasePrintLibSPrint (\r
528 OUT CHAR8 *StartOfBuffer,\r
529 IN UINTN BufferSize,\r
530 IN UINTN Flags,\r
531 IN CONST CHAR8 *FormatString,\r
532 ...\r
533 )\r
534{\r
535 VA_LIST Marker;\r
536\r
537 VA_START (Marker, FormatString);\r
538 return BasePrintLibVSPrint (StartOfBuffer, BufferSize, Flags, FormatString, Marker);\r
539}\r
540\r
541UINTN\r
542EFIAPI\r
543UnicodeVSPrint (\r
544 OUT CHAR16 *StartOfBuffer,\r
545 IN UINTN BufferSize,\r
546 IN CONST CHAR16 *FormatString,\r
547 IN VA_LIST Marker\r
548 )\r
549{\r
550 return BasePrintLibVSPrint ((CHAR8 *)StartOfBuffer, BufferSize >> 1, FORMAT_UNICODE | OUTPUT_UNICODE, (CHAR8 *)FormatString, Marker);\r
551}\r
552\r
553UINTN\r
554EFIAPI\r
555UnicodeSPrint (\r
556 OUT CHAR16 *StartOfBuffer,\r
557 IN UINTN BufferSize,\r
558 IN CONST CHAR16 *FormatString,\r
559 ...\r
560 )\r
561{\r
562 VA_LIST Marker;\r
563\r
564 VA_START (Marker, FormatString);\r
565 return UnicodeVSPrint (StartOfBuffer, BufferSize, FormatString, Marker);\r
566}\r
567\r
568UINTN\r
569EFIAPI\r
570UnicodeVSPrintAsciiFormat (\r
571 OUT CHAR16 *StartOfBuffer,\r
572 IN UINTN BufferSize,\r
573 IN CONST CHAR8 *FormatString,\r
574 IN VA_LIST Marker\r
575 )\r
576{\r
577 return BasePrintLibVSPrint ((CHAR8 *)StartOfBuffer, BufferSize >> 1, OUTPUT_UNICODE,FormatString, Marker);\r
578}\r
579\r
580UINTN\r
581EFIAPI\r
582UnicodeSPrintAsciiFormat (\r
583 OUT CHAR16 *StartOfBuffer,\r
584 IN UINTN BufferSize,\r
585 IN CONST CHAR8 *FormatString,\r
586 ...\r
587 )\r
588{\r
589 VA_LIST Marker;\r
590\r
591 VA_START (Marker, FormatString);\r
592 return UnicodeVSPrintAsciiFormat (StartOfBuffer, BufferSize >> 1, FormatString, Marker);\r
593}\r
594\r
595UINTN\r
596EFIAPI\r
597AsciiVSPrint (\r
598 OUT CHAR8 *StartOfBuffer,\r
599 IN UINTN BufferSize,\r
600 IN CONST CHAR8 *FormatString,\r
601 IN VA_LIST Marker\r
602 )\r
603{\r
604 return BasePrintLibVSPrint (StartOfBuffer, BufferSize, 0, FormatString, Marker);\r
605}\r
606\r
607UINTN\r
608EFIAPI\r
609AsciiSPrint (\r
610 OUT CHAR8 *StartOfBuffer,\r
611 IN UINTN BufferSize,\r
612 IN CONST CHAR8 *FormatString,\r
613 ...\r
614 )\r
615{\r
616 VA_LIST Marker;\r
617\r
618 VA_START (Marker, FormatString);\r
619 return AsciiVSPrint (StartOfBuffer, BufferSize, FormatString, Marker);\r
620}\r
621\r
622UINTN\r
623EFIAPI\r
624AsciiVSPrintUnicodeFormat (\r
625 OUT CHAR8 *StartOfBuffer,\r
626 IN UINTN BufferSize,\r
627 IN CONST CHAR16 *FormatString,\r
628 IN VA_LIST Marker\r
629 )\r
630{\r
631 return BasePrintLibVSPrint (StartOfBuffer, BufferSize, FORMAT_UNICODE, (CHAR8 *)FormatString, Marker);\r
632}\r
633\r
634UINTN\r
635EFIAPI\r
636AsciiSPrintUnicodeFormat (\r
637 OUT CHAR8 *StartOfBuffer,\r
638 IN UINTN BufferSize,\r
639 IN CONST CHAR16 *FormatString,\r
640 ...\r
641 )\r
642{\r
643 VA_LIST Marker;\r
644\r
645 VA_START (Marker, FormatString);\r
646 return AsciiVSPrintUnicodeFormat (StartOfBuffer, BufferSize, FormatString, Marker);\r
647}\r
648\r
649UINTN\r
650EFIAPI\r
651UnicodeValueToString (\r
652 IN OUT CHAR16 *Buffer,\r
653 IN UINTN Flags,\r
654 IN INT64 Value,\r
655 IN UINTN Width\r
656 )\r
657{\r
658 return BasePrintLibConvertValueToString ((CHAR8 *)Buffer, Flags, Value, Width, 2);\r
659}\r
660\r
661UINTN\r
662EFIAPI\r
663AsciiValueToString (\r
664 IN OUT CHAR8 *Buffer,\r
665 IN UINTN Flags,\r
666 IN INT64 Value,\r
667 IN UINTN Width\r
668 )\r
669{\r
670 return BasePrintLibConvertValueToString ((CHAR8 *)Buffer, Flags, Value, Width, 1);\r
671}\r