'%' - Print a %\r
\r
\r
-Copyright (c) 2004 - 2007, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
\r
#include "Setup.h"\r
\r
-/**\r
- VSPrint worker function that prints a Value as a decimal number in Buffer.\r
-\r
- @param Buffer Location to place ascii decimal number string of Value.\r
- @param Flags Flags to use in printing decimal string, see file header for\r
- details.\r
- @param Value Decimal value to convert to a string in Buffer.\r
-\r
- @return Number of characters printed.\r
-\r
-**/\r
-UINTN\r
-ValueToString (\r
- IN OUT CHAR16 *Buffer,\r
- IN BOOLEAN Flags,\r
- IN INT64 Value\r
- );\r
-\r
/**\r
The internal function prints to the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL\r
protocol instance.\r
\r
**/\r
UINTN\r
+EFIAPI\r
ConsolePrint (\r
IN CHAR16 *Fmt,\r
...\r
)\r
{\r
VA_LIST Args;\r
+ UINTN LengthOfPrinted;\r
\r
VA_START (Args, Fmt);\r
- return PrintInternal ((UINTN) -1, (UINTN) -1, gST->ConOut, Fmt, Args);\r
+ LengthOfPrinted = PrintInternal ((UINTN) -1, (UINTN) -1, gST->ConOut, Fmt, Args);\r
+ VA_END (Args);\r
+ return LengthOfPrinted;\r
}\r
\r
\r
\r
**/\r
UINTN\r
+EFIAPI\r
PrintAt (\r
IN UINTN Column,\r
IN UINTN Row,\r
)\r
{\r
VA_LIST Args;\r
+ UINTN LengthOfPrinted;\r
\r
VA_START (Args, Fmt);\r
- return PrintInternal (Column, Row, gST->ConOut, Fmt, Args);\r
+ LengthOfPrinted = PrintInternal (Column, Row, gST->ConOut, Fmt, Args);\r
+ VA_END (Args);\r
+ return LengthOfPrinted;\r
}\r
\r
\r
{\r
return PrintAt (Column, Row, L"%c", Character);\r
}\r
-\r
-\r
-/**\r
- VSPrint worker function that prints a Value as a decimal number in Buffer.\r
-\r
- @param Buffer Location to place ascii decimal number string of Value.\r
- @param Flags Flags to use in printing decimal string, see file header for\r
- details.\r
- @param Value Decimal value to convert to a string in Buffer.\r
-\r
- @return Number of characters printed.\r
-\r
-**/\r
-UINTN\r
-ValueToString (\r
- IN OUT CHAR16 *Buffer,\r
- IN BOOLEAN Flags,\r
- IN INT64 Value\r
- )\r
-{\r
- CHAR16 TempBuffer[30];\r
- CHAR16 *TempStr;\r
- CHAR16 *BufferPtr;\r
- UINTN Count;\r
- UINTN NumberCount;\r
- UINT32 Remainder;\r
- BOOLEAN Negative;\r
-\r
- Negative = FALSE;\r
- TempStr = TempBuffer;\r
- BufferPtr = Buffer;\r
- Count = 0;\r
- NumberCount = 0;\r
-\r
- if (Value < 0) {\r
- Negative = TRUE;\r
- Value = -Value;\r
- }\r
-\r
- do {\r
- Value = (INT64) DivU64x32Remainder ((UINT64) Value, 10, &Remainder);\r
- *(TempStr++) = (CHAR16) (Remainder + '0');\r
- Count++;\r
- NumberCount++;\r
- if ((Flags & COMMA_TYPE) == COMMA_TYPE) {\r
- if (NumberCount % 3 == 0 && Value != 0) {\r
- *(TempStr++) = ',';\r
- Count++;\r
- }\r
- }\r
- } while (Value != 0);\r
-\r
- if (Negative) {\r
- *(BufferPtr++) = '-';\r
- Count++;\r
- }\r
-\r
- //\r
- // Reverse temp string into Buffer.\r
- //\r
- while (TempStr != TempBuffer) {\r
- *(BufferPtr++) = *(--TempStr);\r
- }\r
-\r
- *BufferPtr = 0;\r
- return Count;\r
-}\r