]>
Commit | Line | Data |
---|---|---|
878ddf1f | 1 | /** @file\r |
2 | Print Library.\r | |
3 | \r | |
4 | Copyright (c) 2006, 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 | |
13 | Module Name: PrintLib.c\r | |
14 | \r | |
15 | **/\r | |
16 | \r | |
17 | #include "PrintLibInternal.h"\r | |
18 | \r | |
19 | typedef struct {\r | |
20 | RETURN_STATUS Status;\r | |
21 | CHAR8 *String;\r | |
22 | } STATUS_LOOKUP_TABLE_ENTRY;\r | |
23 | \r | |
24 | static CONST STATUS_LOOKUP_TABLE_ENTRY StatusString[] = {\r | |
25 | { RETURN_SUCCESS, "Success" },\r | |
26 | { RETURN_LOAD_ERROR, "Load Error" },\r | |
27 | { RETURN_INVALID_PARAMETER, "Invalid Parameter" },\r | |
28 | { RETURN_UNSUPPORTED, "Unsupported" },\r | |
29 | { RETURN_BAD_BUFFER_SIZE, "Bad Buffer Size" },\r | |
30 | { RETURN_BUFFER_TOO_SMALL, "Buffer Too Small" },\r | |
31 | { RETURN_NOT_READY, "Not Ready" },\r | |
32 | { RETURN_DEVICE_ERROR, "Device Error" },\r | |
33 | { RETURN_WRITE_PROTECTED, "Write Protected" },\r | |
34 | { RETURN_OUT_OF_RESOURCES, "Out of Resources" },\r | |
35 | { RETURN_VOLUME_CORRUPTED, "Volume Corrupt" },\r | |
36 | { RETURN_VOLUME_FULL, "Volume Full" },\r | |
37 | { RETURN_NO_MEDIA, "No Media" },\r | |
38 | { RETURN_MEDIA_CHANGED, "Media changed" },\r | |
39 | { RETURN_NOT_FOUND, "Not Found" },\r | |
40 | { RETURN_ACCESS_DENIED, "Access Denied" },\r | |
41 | { RETURN_NO_RESPONSE, "No Response" },\r | |
42 | { RETURN_NO_MAPPING, "No mapping" },\r | |
43 | { RETURN_TIMEOUT, "Time out" },\r | |
44 | { RETURN_NOT_STARTED, "Not started" },\r | |
45 | { RETURN_ALREADY_STARTED, "Already started" },\r | |
46 | { RETURN_ABORTED, "Aborted" },\r | |
47 | { RETURN_ICMP_ERROR, "ICMP Error" },\r | |
48 | { RETURN_TFTP_ERROR, "TFTP Error" },\r | |
49 | { RETURN_PROTOCOL_ERROR, "Protocol Error" },\r | |
50 | { RETURN_WARN_UNKNOWN_GLYPH, "Warning Unknown Glyph" },\r | |
51 | { RETURN_WARN_DELETE_FAILURE, "Warning Delete Failure" },\r | |
52 | { RETURN_WARN_WRITE_FAILURE, "Warning Write Failure" },\r | |
53 | { RETURN_WARN_BUFFER_TOO_SMALL, "Warning Buffer Too Small" },\r | |
54 | { 0, NULL }\r | |
55 | };\r | |
56 | \r | |
57 | \r | |
58 | /**\r | |
3f9f540d | 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 | |
878ddf1f | 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 | |
3f9f540d | 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 | Zero means no limit.\r | |
70 | @param Flags Intial flags value.\r | |
71 | Can only have FORMAT_UNICODE and OUTPUT_UNICODE set\r | |
72 | @param Format Null-terminated format string.\r | |
73 | @param Marker Vararg list consumed by processing Format.\r | |
878ddf1f | 74 | \r |
75 | @return Number of characters printed.\r | |
76 | \r | |
77 | **/\r | |
78 | UINTN\r | |
79 | BasePrintLibVSPrint (\r | |
80 | OUT CHAR8 *Buffer,\r | |
81 | IN UINTN BufferSize,\r | |
82 | IN UINTN Flags,\r | |
83 | IN CONST CHAR8 *Format,\r | |
84 | IN VA_LIST Marker\r | |
85 | )\r | |
86 | {\r | |
87 | CHAR8 *OriginalBuffer;\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 | 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 | |
533f039e | 113 | ASSERT (Buffer != NULL);\r |
114 | ASSERT (Format != NULL);\r | |
115 | \r | |
878ddf1f | 116 | OriginalBuffer = Buffer;\r |
117 | \r | |
118 | if ((Flags & OUTPUT_UNICODE) != 0) {\r | |
119 | BytesPerOutputCharacter = 2;\r | |
120 | } else {\r | |
121 | BytesPerOutputCharacter = 1;\r | |
122 | }\r | |
123 | if ((Flags & FORMAT_UNICODE) != 0) {\r | |
124 | BytesPerFormatCharacter = 2;\r | |
125 | FormatMask = 0xffff;\r | |
126 | } else {\r | |
127 | BytesPerFormatCharacter = 1;\r | |
128 | FormatMask = 0xff;\r | |
129 | }\r | |
130 | \r | |
131 | //\r | |
132 | // Reserve space for the Null terminator.\r | |
133 | // If BufferSize is 0, this will set BufferSize to the max unsigned value\r | |
134 | //\r | |
135 | BufferSize--;\r | |
136 | \r | |
137 | //\r | |
138 | // Get the first character from the format string\r | |
139 | //\r | |
f76fd83e | 140 | FormatCharacter = (*Format | (*(Format + 1) << 8)) & FormatMask;\r |
878ddf1f | 141 | \r |
142 | //\r | |
143 | // Loop until the end of the format string is reached or the output buffer is full\r | |
144 | //\r | |
145 | while (FormatCharacter != 0 && BufferSize > 0) {\r | |
146 | //\r | |
147 | // Clear all the flag bits except those that may have been passed in\r | |
148 | //\r | |
149 | Flags &= (OUTPUT_UNICODE | FORMAT_UNICODE);\r | |
150 | \r | |
151 | //\r | |
152 | // Set the default width to zero, and the default precision to 1\r | |
153 | //\r | |
154 | Width = 0;\r | |
155 | Precision = 1;\r | |
156 | Prefix = 0;\r | |
157 | Comma = FALSE;\r | |
158 | ZeroPad = FALSE;\r | |
159 | Count = 0;\r | |
160 | Digits = 0;\r | |
161 | \r | |
162 | switch (FormatCharacter) {\r | |
163 | case '%':\r | |
164 | //\r | |
165 | // Parse Flags and Width\r | |
166 | //\r | |
167 | for (Done = FALSE; !Done; ) {\r | |
168 | Format += BytesPerFormatCharacter;\r | |
169 | FormatCharacter = (*Format | (*(Format + 1) << 8)) & FormatMask;\r | |
170 | switch (FormatCharacter) {\r | |
171 | case '.': \r | |
172 | Flags |= PRECISION; \r | |
173 | break;\r | |
174 | case '-': \r | |
175 | Flags |= LEFT_JUSTIFY; \r | |
176 | break;\r | |
177 | case '+': \r | |
178 | Flags |= PREFIX_SIGN; \r | |
179 | break;\r | |
180 | case ' ': \r | |
181 | Flags |= PREFIX_BLANK; \r | |
182 | break;\r | |
183 | case ',': \r | |
184 | Flags |= COMMA_TYPE; \r | |
185 | break;\r | |
186 | case 'L':\r | |
187 | case 'l': \r | |
188 | Flags |= LONG_TYPE; \r | |
189 | break;\r | |
190 | case '*':\r | |
191 | if ((Flags & PRECISION) == 0) {\r | |
192 | Flags |= PAD_TO_WIDTH;\r | |
193 | Width = VA_ARG (Marker, UINTN);\r | |
194 | } else {\r | |
195 | Precision = VA_ARG (Marker, UINTN);\r | |
196 | }\r | |
197 | break;\r | |
198 | case '0':\r | |
199 | if ((Flags & PRECISION) == 0) {\r | |
200 | Flags |= PREFIX_ZERO;\r | |
201 | }\r | |
202 | case '1':\r | |
203 | case '2':\r | |
204 | case '3':\r | |
205 | case '4':\r | |
206 | case '5':\r | |
207 | case '6':\r | |
208 | case '7':\r | |
209 | case '8':\r | |
210 | case '9':\r | |
211 | for (Count = 0; ((FormatCharacter >= '0') && (FormatCharacter <= '9')); ){\r | |
212 | Count = (Count * 10) + FormatCharacter - '0';\r | |
213 | Format += BytesPerFormatCharacter;\r | |
214 | FormatCharacter = (*Format | (*(Format + 1) << 8)) & FormatMask;\r | |
215 | }\r | |
216 | Format -= BytesPerFormatCharacter;\r | |
217 | if ((Flags & PRECISION) == 0) {\r | |
218 | Flags |= PAD_TO_WIDTH;\r | |
219 | Width = Count;\r | |
220 | } else {\r | |
221 | Precision = Count;\r | |
222 | }\r | |
223 | break;\r | |
224 | default:\r | |
225 | Done = TRUE;\r | |
226 | break;\r | |
227 | }\r | |
228 | } \r | |
229 | \r | |
230 | //\r | |
231 | // Limit the maximum field width to the remaining characters in the output buffer\r | |
232 | //\r | |
233 | if (Width > BufferSize) {\r | |
234 | Width = BufferSize;\r | |
235 | }\r | |
236 | \r | |
237 | //\r | |
238 | // Handle each argument type\r | |
239 | //\r | |
240 | switch (FormatCharacter) {\r | |
1d580c14 | 241 | case 'p':\r |
242 | if (sizeof (VOID *) > 4) {\r | |
243 | Flags |= LONG_TYPE;\r | |
244 | }\r | |
878ddf1f | 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 | |
1d580c14 | 257 | Value = (VA_ARG (Marker, int));\r |
878ddf1f | 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 | |
1d580c14 | 285 | Value = (unsigned int)Value;\r |
878ddf1f | 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 | |
f76fd83e | 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 | |
878ddf1f | 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 | |
f76fd83e | 370 | TmpTime->Month,\r |
371 | TmpTime->Day,\r | |
372 | TmpTime->Year,\r | |
373 | TmpTime->Hour,\r | |
374 | TmpTime->Minute\r | |
878ddf1f | 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 | |
3f9f540d | 526 | /**\r |
527 | Worker function that produces a Null-terminated string in an output buffer \r | |
528 | based on a Null-terminated format string and variable argument list.\r | |
529 | \r | |
530 | VSPrint function to process format and place the results in Buffer. Since a \r | |
531 | VA_LIST is used this rountine allows the nesting of Vararg routines. Thus \r | |
532 | this is the main print working routine\r | |
533 | \r | |
534 | @param Buffer Character buffer to print the results of the parsing\r | |
535 | of Format into.\r | |
536 | @param BufferSize Maximum number of characters to put into buffer.\r | |
537 | Zero means no limit.\r | |
538 | @param Flags Intial flags value.\r | |
539 | Can only have FORMAT_UNICODE and OUTPUT_UNICODE set\r | |
540 | @param FormatString Null-terminated format string.\r | |
541 | \r | |
542 | @return Number of characters printed.\r | |
543 | \r | |
544 | **/\r | |
878ddf1f | 545 | UINTN\r |
546 | BasePrintLibSPrint (\r | |
547 | OUT CHAR8 *StartOfBuffer,\r | |
548 | IN UINTN BufferSize,\r | |
549 | IN UINTN Flags,\r | |
550 | IN CONST CHAR8 *FormatString,\r | |
551 | ...\r | |
552 | )\r | |
553 | {\r | |
554 | VA_LIST Marker;\r | |
555 | \r | |
556 | VA_START (Marker, FormatString);\r | |
557 | return BasePrintLibVSPrint (StartOfBuffer, BufferSize, Flags, FormatString, Marker);\r | |
558 | }\r | |
559 | \r | |
3f9f540d | 560 | /**\r |
561 | Produces a Null-terminated Unicode string in an output buffer based on \r | |
562 | a Null-terminated Unicode format string and a VA_LIST argument list\r | |
563 | \r | |
564 | Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer\r | |
565 | and BufferSize. \r | |
566 | The Unicode string is produced by parsing the format string specified by FormatString. \r | |
567 | Arguments are pulled from the variable argument list specified by Marker based on the \r | |
568 | contents of the format string. \r | |
569 | The length of the produced output buffer is returned.\r | |
570 | If BufferSize is 0, then no output buffer is produced and 0 is returned.\r | |
571 | \r | |
572 | If BufferSize is not 0 and StartOfBuffer is NULL, then ASSERT().\r | |
573 | If BufferSize is not 0 and FormatString is NULL, then ASSERT().\r | |
574 | If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than \r | |
575 | PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r | |
576 | If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r | |
577 | contains more than PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r | |
578 | \r | |
579 | @param StartOfBuffer APointer to the output buffer for the produced Null-terminated \r | |
580 | Unicode string.\r | |
581 | @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.\r | |
582 | @param FormatString Null-terminated Unicode format string.\r | |
583 | @param Marker VA_LIST marker for the variable argument list.\r | |
584 | \r | |
585 | @return return Length of the produced output buffer.\r | |
586 | \r | |
587 | **/\r | |
878ddf1f | 588 | UINTN\r |
589 | EFIAPI\r | |
590 | UnicodeVSPrint (\r | |
591 | OUT CHAR16 *StartOfBuffer,\r | |
592 | IN UINTN BufferSize,\r | |
593 | IN CONST CHAR16 *FormatString,\r | |
594 | IN VA_LIST Marker\r | |
595 | )\r | |
596 | {\r | |
597 | return BasePrintLibVSPrint ((CHAR8 *)StartOfBuffer, BufferSize >> 1, FORMAT_UNICODE | OUTPUT_UNICODE, (CHAR8 *)FormatString, Marker);\r | |
598 | }\r | |
599 | \r | |
3f9f540d | 600 | /**\r |
601 | Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated \r | |
602 | Unicode format string and variable argument list.\r | |
603 | \r | |
604 | Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer\r | |
605 | and BufferSize.\r | |
606 | The Unicode string is produced by parsing the format string specified by FormatString.\r | |
607 | Arguments are pulled from the variable argument list based on the contents of the format string.\r | |
608 | The length of the produced output buffer is returned. \r | |
609 | If BufferSize is 0, then no output buffer is produced and 0 is returned.\r | |
610 | \r | |
611 | If BufferSize is not 0 and StartOfBuffer is NULL, then ASSERT().\r | |
612 | If BufferSize is not 0 and FormatString is NULL, then ASSERT().\r | |
613 | If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than \r | |
614 | PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r | |
615 | If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r | |
616 | contains more than PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r | |
617 | \r | |
618 | @param StartOfBuffer APointer to the output buffer for the produced Null-terminated \r | |
619 | Unicode string.\r | |
620 | @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.\r | |
621 | @param FormatString Null-terminated Unicode format string.\r | |
622 | \r | |
623 | @return Length of the produced output buffer.\r | |
624 | \r | |
625 | **/\r | |
878ddf1f | 626 | UINTN\r |
627 | EFIAPI\r | |
628 | UnicodeSPrint (\r | |
629 | OUT CHAR16 *StartOfBuffer,\r | |
630 | IN UINTN BufferSize,\r | |
631 | IN CONST CHAR16 *FormatString,\r | |
632 | ...\r | |
633 | )\r | |
634 | {\r | |
635 | VA_LIST Marker;\r | |
636 | \r | |
637 | VA_START (Marker, FormatString);\r | |
638 | return UnicodeVSPrint (StartOfBuffer, BufferSize, FormatString, Marker);\r | |
639 | }\r | |
640 | \r | |
3f9f540d | 641 | /**\r |
642 | Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated\r | |
643 | ASCII format string and a VA_LIST argument list\r | |
644 | \r | |
645 | Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer\r | |
646 | and BufferSize.\r | |
647 | The Unicode string is produced by parsing the format string specified by FormatString.\r | |
648 | Arguments are pulled from the variable argument list specified by Marker based on the \r | |
649 | contents of the format string.\r | |
650 | The length of the produced output buffer is returned.\r | |
651 | If BufferSize is 0, then no output buffer is produced and 0 is returned.\r | |
652 | \r | |
653 | If BufferSize is not 0 and StartOfBuffer is NULL, then ASSERT().\r | |
654 | If BufferSize is not 0 and FormatString is NULL, then ASSERT().\r | |
655 | If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than \r | |
656 | PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r | |
657 | If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r | |
658 | contains more than PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r | |
659 | \r | |
660 | @param StartOfBuffer APointer to the output buffer for the produced Null-terminated \r | |
661 | Unicode string.\r | |
662 | @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.\r | |
663 | @param FormatString Null-terminated Unicode format string.\r | |
664 | @param Marker VA_LIST marker for the variable argument list.\r | |
665 | \r | |
666 | @return Length of the produced output buffer.\r | |
667 | \r | |
668 | **/\r | |
878ddf1f | 669 | UINTN\r |
670 | EFIAPI\r | |
671 | UnicodeVSPrintAsciiFormat (\r | |
672 | OUT CHAR16 *StartOfBuffer,\r | |
673 | IN UINTN BufferSize,\r | |
674 | IN CONST CHAR8 *FormatString,\r | |
675 | IN VA_LIST Marker\r | |
676 | )\r | |
677 | {\r | |
678 | return BasePrintLibVSPrint ((CHAR8 *)StartOfBuffer, BufferSize >> 1, OUTPUT_UNICODE,FormatString, Marker);\r | |
679 | }\r | |
680 | \r | |
3f9f540d | 681 | /**\r |
682 | Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated \r | |
683 | ASCII format string and variable argument list.\r | |
684 | \r | |
685 | Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer\r | |
686 | and BufferSize.\r | |
687 | The Unicode string is produced by parsing the format string specified by FormatString.\r | |
688 | Arguments are pulled from the variable argument list based on the contents of the \r | |
689 | format string.\r | |
690 | The length of the produced output buffer is returned.\r | |
691 | If BufferSize is 0, then no output buffer is produced and 0 is returned.\r | |
692 | \r | |
693 | If BufferSize is not 0 and StartOfBuffer is NULL, then ASSERT().\r | |
694 | If BufferSize is not 0 and FormatString is NULL, then ASSERT().\r | |
695 | If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than \r | |
696 | PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r | |
697 | If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r | |
698 | contains more than PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r | |
699 | \r | |
700 | @param StartOfBuffer APointer to the output buffer for the produced Null-terminated \r | |
701 | Unicode string.\r | |
702 | @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.\r | |
703 | @param FormatString Null-terminated Unicode format string.\r | |
704 | \r | |
705 | @return Length of the produced output buffer.\r | |
706 | \r | |
707 | **/\r | |
878ddf1f | 708 | UINTN\r |
709 | EFIAPI\r | |
710 | UnicodeSPrintAsciiFormat (\r | |
711 | OUT CHAR16 *StartOfBuffer,\r | |
712 | IN UINTN BufferSize,\r | |
713 | IN CONST CHAR8 *FormatString,\r | |
714 | ...\r | |
715 | )\r | |
716 | {\r | |
717 | VA_LIST Marker;\r | |
718 | \r | |
719 | VA_START (Marker, FormatString);\r | |
720 | return UnicodeVSPrintAsciiFormat (StartOfBuffer, BufferSize >> 1, FormatString, Marker);\r | |
721 | }\r | |
722 | \r | |
3f9f540d | 723 | /**\r |
724 | Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated\r | |
725 | ASCII format string and a VA_LIST argument list.\r | |
726 | \r | |
727 | Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer\r | |
728 | and BufferSize.\r | |
729 | The ASCII string is produced by parsing the format string specified by FormatString.\r | |
730 | Arguments are pulled from the variable argument list specified by Marker based on \r | |
731 | the contents of the format string.\r | |
732 | The length of the produced output buffer is returned.\r | |
733 | If BufferSize is 0, then no output buffer is produced and 0 is returned.\r | |
734 | \r | |
735 | If BufferSize is not 0 and StartOfBuffer is NULL, then ASSERT().\r | |
736 | If BufferSize is not 0 and FormatString is NULL, then ASSERT().\r | |
737 | If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than \r | |
738 | PcdMaximumUnicodeStringLength ASCII characters, then ASSERT().\r | |
739 | If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r | |
740 | contains more than PcdMaximumUnicodeStringLength ASCII characters, then ASSERT().\r | |
741 | \r | |
742 | @param StartOfBuffer APointer to the output buffer for the produced Null-terminated \r | |
743 | ASCII string.\r | |
744 | @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.\r | |
745 | @param FormatString Null-terminated Unicode format string.\r | |
746 | @param Marker VA_LIST marker for the variable argument list.\r | |
747 | \r | |
748 | @return Length of the produced output buffer.\r | |
749 | \r | |
750 | **/\r | |
878ddf1f | 751 | UINTN\r |
752 | EFIAPI\r | |
753 | AsciiVSPrint (\r | |
754 | OUT CHAR8 *StartOfBuffer,\r | |
755 | IN UINTN BufferSize,\r | |
756 | IN CONST CHAR8 *FormatString,\r | |
757 | IN VA_LIST Marker\r | |
758 | )\r | |
759 | {\r | |
760 | return BasePrintLibVSPrint (StartOfBuffer, BufferSize, 0, FormatString, Marker);\r | |
761 | }\r | |
762 | \r | |
3f9f540d | 763 | /**\r |
764 | Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated\r | |
765 | ASCII format string and variable argument list.\r | |
766 | \r | |
767 | Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer\r | |
768 | and BufferSize.\r | |
769 | The ASCII string is produced by parsing the format string specified by FormatString.\r | |
770 | Arguments are pulled from the variable argument list based on the contents of the \r | |
771 | format string.\r | |
772 | The length of the produced output buffer is returned.\r | |
773 | If BufferSize is 0, then no output buffer is produced and 0 is returned.\r | |
774 | \r | |
775 | If BufferSize is not 0 and StartOfBuffer is NULL, then ASSERT().\r | |
776 | If BufferSize is not 0 and FormatString is NULL, then ASSERT().\r | |
777 | If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than \r | |
778 | PcdMaximumUnicodeStringLength ASCII characters, then ASSERT().\r | |
779 | If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r | |
780 | contains more than PcdMaximumUnicodeStringLength ASCII characters, then ASSERT().\r | |
781 | \r | |
782 | @param StartOfBuffer APointer to the output buffer for the produced Null-terminated \r | |
783 | ASCII string.\r | |
784 | @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.\r | |
785 | @param FormatString Null-terminated Unicode format string.\r | |
786 | \r | |
787 | @return Length of the produced output buffer.\r | |
788 | \r | |
789 | **/\r | |
878ddf1f | 790 | UINTN\r |
791 | EFIAPI\r | |
792 | AsciiSPrint (\r | |
793 | OUT CHAR8 *StartOfBuffer,\r | |
794 | IN UINTN BufferSize,\r | |
795 | IN CONST CHAR8 *FormatString,\r | |
796 | ...\r | |
797 | )\r | |
798 | {\r | |
799 | VA_LIST Marker;\r | |
800 | \r | |
801 | VA_START (Marker, FormatString);\r | |
802 | return AsciiVSPrint (StartOfBuffer, BufferSize, FormatString, Marker);\r | |
803 | }\r | |
804 | \r | |
3f9f540d | 805 | /**\r |
806 | Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated\r | |
807 | ASCII format string and a VA_LIST argument list.\r | |
808 | \r | |
809 | Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer\r | |
810 | and BufferSize.\r | |
811 | The ASCII string is produced by parsing the format string specified by FormatString.\r | |
812 | Arguments are pulled from the variable argument list specified by Marker based on \r | |
813 | the contents of the format string.\r | |
814 | The length of the produced output buffer is returned.\r | |
815 | If BufferSize is 0, then no output buffer is produced and 0 is returned.\r | |
816 | \r | |
817 | If BufferSize is not 0 and StartOfBuffer is NULL, then ASSERT().\r | |
818 | If BufferSize is not 0 and FormatString is NULL, then ASSERT().\r | |
819 | If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than \r | |
820 | PcdMaximumUnicodeStringLength ASCII characters, then ASSERT().\r | |
821 | If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r | |
822 | contains more than PcdMaximumUnicodeStringLength ASCII characters, then ASSERT().\r | |
823 | \r | |
824 | @param StartOfBuffer APointer to the output buffer for the produced Null-terminated \r | |
825 | ASCII string.\r | |
826 | @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.\r | |
827 | @param FormatString Null-terminated Unicode format string.\r | |
828 | @param Marker VA_LIST marker for the variable argument list.\r | |
829 | \r | |
830 | @return Length of the produced output buffer.\r | |
831 | \r | |
832 | **/\r | |
878ddf1f | 833 | UINTN\r |
834 | EFIAPI\r | |
835 | AsciiVSPrintUnicodeFormat (\r | |
836 | OUT CHAR8 *StartOfBuffer,\r | |
837 | IN UINTN BufferSize,\r | |
838 | IN CONST CHAR16 *FormatString,\r | |
839 | IN VA_LIST Marker\r | |
840 | )\r | |
841 | {\r | |
842 | return BasePrintLibVSPrint (StartOfBuffer, BufferSize, FORMAT_UNICODE, (CHAR8 *)FormatString, Marker);\r | |
843 | }\r | |
844 | \r | |
3f9f540d | 845 | /**\r |
846 | Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated\r | |
847 | ASCII format string and variable argument list.\r | |
848 | \r | |
849 | Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer\r | |
850 | and BufferSize.\r | |
851 | The ASCII string is produced by parsing the format string specified by FormatString.\r | |
852 | Arguments are pulled from the variable argument list based on the contents of the \r | |
853 | format string.\r | |
854 | The length of the produced output buffer is returned.\r | |
855 | If BufferSize is 0, then no output buffer is produced and 0 is returned.\r | |
856 | \r | |
857 | If BufferSize is not 0 and StartOfBuffer is NULL, then ASSERT().\r | |
858 | If BufferSize is not 0 and FormatString is NULL, then ASSERT().\r | |
859 | If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than \r | |
860 | PcdMaximumUnicodeStringLength ASCII characters, then ASSERT().\r | |
861 | If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r | |
862 | contains more than PcdMaximumUnicodeStringLength ASCII characters, then ASSERT().\r | |
863 | \r | |
864 | @param StartOfBuffer APointer to the output buffer for the produced Null-terminated \r | |
865 | ASCII string.\r | |
866 | @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.\r | |
867 | @param FormatString Null-terminated Unicode format string.\r | |
868 | \r | |
869 | @return Length of the produced output buffer.\r | |
870 | \r | |
871 | **/\r | |
878ddf1f | 872 | UINTN\r |
873 | EFIAPI\r | |
874 | AsciiSPrintUnicodeFormat (\r | |
875 | OUT CHAR8 *StartOfBuffer,\r | |
876 | IN UINTN BufferSize,\r | |
877 | IN CONST CHAR16 *FormatString,\r | |
878 | ...\r | |
879 | )\r | |
880 | {\r | |
881 | VA_LIST Marker;\r | |
882 | \r | |
883 | VA_START (Marker, FormatString);\r | |
884 | return AsciiVSPrintUnicodeFormat (StartOfBuffer, BufferSize, FormatString, Marker);\r | |
885 | }\r | |
a3657e3e | 886 | \r |
3f9f540d | 887 | /**\r |
888 | Converts a decimal value to a Null-terminated Unicode string.\r | |
889 | \r | |
890 | Converts the decimal number specified by Value to a Null-terminated Unicode \r | |
891 | string specified by Buffer containing at most Width characters.\r | |
892 | If Width is 0 then a width of MAXIMUM_VALUE_CHARACTERS is assumed.\r | |
893 | The total number of characters placed in Buffer is returned.\r | |
894 | If the conversion contains more than Width characters, then only the first\r | |
895 | Width characters are returned, and the total number of characters \r | |
896 | required to perform the conversion is returned.\r | |
897 | Additional conversion parameters are specified in Flags. \r | |
898 | The Flags bit LEFT_JUSTIFY is always ignored.\r | |
899 | All conversions are left justified in Buffer.\r | |
900 | If Width is 0, PREFIX_ZERO is ignored in Flags.\r | |
901 | If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and commas\r | |
902 | are inserted every 3rd digit starting from the right.\r | |
903 | If Value is < 0, then the fist character in Buffer is a '-'.\r | |
904 | If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored, \r | |
905 | then Buffer is padded with '0' characters so the combination of the optional '-' \r | |
906 | sign character, '0' characters, digit characters for Value, and the Null-terminator\r | |
907 | add up to Width characters.\r | |
908 | \r | |
909 | If Buffer is NULL, then ASSERT().\r | |
910 | If unsupported bits are set in Flags, then ASSERT().\r | |
911 | If Width >= MAXIMUM_VALUE_CHARACTERS, then ASSERT()\r | |
912 | \r | |
913 | @param Buffer Pointer to the output buffer for the produced Null-terminated\r | |
914 | Unicode string.\r | |
915 | @param Flags The bitmask of flags that specify left justification, zero pad, and commas.\r | |
916 | @param Value The 64-bit signed value to convert to a string.\r | |
917 | @param Width The maximum number of Unicode characters to place in Buffer.\r | |
918 | \r | |
919 | @return Total number of characters required to perform the conversion.\r | |
920 | \r | |
921 | **/\r | |
a3657e3e | 922 | UINTN\r |
923 | EFIAPI\r | |
924 | UnicodeValueToString (\r | |
925 | IN OUT CHAR16 *Buffer,\r | |
926 | IN UINTN Flags,\r | |
927 | IN INT64 Value,\r | |
928 | IN UINTN Width\r | |
929 | )\r | |
930 | {\r | |
931 | return BasePrintLibConvertValueToString ((CHAR8 *)Buffer, Flags, Value, Width, 2);\r | |
932 | }\r | |
933 | \r | |
3f9f540d | 934 | /**\r |
935 | Converts a decimal value to a Null-terminated ASCII string.\r | |
936 | \r | |
937 | Converts the decimal number specified by Value to a Null-terminated ASCII string \r | |
938 | specified by Buffer containing at most Width characters.\r | |
939 | If Width is 0 then a width of MAXIMUM_VALUE_CHARACTERS is assumed.\r | |
940 | The total number of characters placed in Buffer is returned.\r | |
941 | If the conversion contains more than Width characters, then only the first Width\r | |
942 | characters are returned, and the total number of characters required to perform\r | |
943 | the conversion is returned.\r | |
944 | Additional conversion parameters are specified in Flags. \r | |
945 | The Flags bit LEFT_JUSTIFY is always ignored.\r | |
946 | All conversions are left justified in Buffer.\r | |
947 | If Width is 0, PREFIX_ZERO is ignored in Flags.\r | |
948 | If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and commas \r | |
949 | are inserted every 3rd digit starting from the right.\r | |
950 | If Value is < 0, then the fist character in Buffer is a '-'.\r | |
951 | If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored, then Buffer\r | |
952 | is padded with '0' characters so the combination of the optional '-'\r | |
953 | sign character, '0' characters, digit characters for Value, and the \r | |
954 | Null-terminator add up to Width characters.\r | |
955 | \r | |
956 | If Buffer is NULL, then ASSERT().\r | |
957 | If unsupported bits are set in Flags, then ASSERT().\r | |
958 | If Width >= MAXIMUM_VALUE_CHARACTERS, then ASSERT()\r | |
959 | \r | |
960 | @param Buffer Pointer to the output buffer for the produced Null-terminated\r | |
961 | ASCII string.\r | |
962 | @param Flags The bitmask of flags that specify left justification, zero pad, and commas.\r | |
963 | @param Value The 64-bit signed value to convert to a string.\r | |
964 | @param Width The maximum number of ASCII characters to place in Buffer.\r | |
965 | \r | |
966 | @return Total number of characters required to perform the conversion.\r | |
967 | \r | |
968 | **/\r | |
a3657e3e | 969 | UINTN\r |
970 | EFIAPI\r | |
971 | AsciiValueToString (\r | |
972 | IN OUT CHAR8 *Buffer,\r | |
973 | IN UINTN Flags,\r | |
974 | IN INT64 Value,\r | |
975 | IN UINTN Width\r | |
976 | )\r | |
977 | {\r | |
978 | return BasePrintLibConvertValueToString ((CHAR8 *)Buffer, Flags, Value, Width, 1);\r | |
979 | }\r |