/** @file\r
Base Print Library instance Internal Functions definition.\r
\r
- Copyright (c) 2006 - 2017, 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
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+ Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
+ SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
\r
} TIME;\r
\r
/**\r
- Worker function that produces a Null-terminated string in an output buffer \r
+ Worker function that produces a Null-terminated string in an output buffer\r
based on a Null-terminated format string and a VA_LIST argument list.\r
\r
- VSPrint function to process format and place the results in Buffer. Since a \r
- VA_LIST is used this routine allows the nesting of Vararg routines. Thus \r
+ VSPrint function to process format and place the results in Buffer. Since a\r
+ VA_LIST is used this routine allows the nesting of Vararg routines. Thus\r
this is the main print working routine.\r
\r
If COUNT_ONLY_NO_PRINT is set in Flags, Buffer will not be modified at all.\r
\r
- @param[out] Buffer The character buffer to print the results of the \r
+ @param[out] Buffer The character buffer to print the results of the\r
parsing of Format into.\r
- @param[in] BufferSize The maximum number of characters to put into \r
+ @param[in] BufferSize The maximum number of characters to put into\r
buffer.\r
@param[in] Flags Initial flags value.\r
- Can only have FORMAT_UNICODE, OUTPUT_UNICODE, \r
+ Can only have FORMAT_UNICODE, OUTPUT_UNICODE,\r
and COUNT_ONLY_NO_PRINT set.\r
@param[in] Format A Null-terminated format string.\r
@param[in] VaListMarker VA_LIST style variable argument list consumed by\r
);\r
\r
/**\r
- Worker function that produces a Null-terminated string in an output buffer \r
+ Worker function that produces a Null-terminated string in an output buffer\r
based on a Null-terminated format string and variable argument list.\r
\r
- VSPrint function to process format and place the results in Buffer. Since a \r
- VA_LIST is used this routine allows the nesting of Vararg routines. Thus \r
+ VSPrint function to process format and place the results in Buffer. Since a\r
+ VA_LIST is used this routine allows the nesting of Vararg routines. Thus\r
this is the main print working routine\r
\r
@param StartOfBuffer The character buffer to print the results of the parsing\r
\r
@param Buffer Buffer to place the Unicode or ASCII string.\r
@param EndBuffer The end of the input Buffer. No characters will be\r
- placed after that. \r
+ placed after that.\r
@param Length The count of character to be placed into Buffer.\r
(Negative value indicates no buffer fill.)\r
@param Character The character to be placed into Buffer.\r
**/\r
CHAR8 *\r
BasePrintLibValueToString (\r
- IN OUT CHAR8 *Buffer, \r
- IN INT64 Value, \r
+ IN OUT CHAR8 *Buffer,\r
+ IN INT64 Value,\r
IN UINTN Radix\r
);\r
\r
/**\r
Internal function that converts a decimal value to a Null-terminated string.\r
- \r
- Converts the decimal number specified by Value to a Null-terminated \r
+\r
+ Converts the decimal number specified by Value to a Null-terminated\r
string specified by Buffer containing at most Width characters.\r
If Width is 0 then a width of MAXIMUM_VALUE_CHARACTERS is assumed.\r
The total number of characters placed in Buffer is returned.\r
If the conversion contains more than Width characters, then only the first\r
- Width characters are returned, and the total number of characters \r
+ Width characters are returned, and the total number of characters\r
required to perform the conversion is returned.\r
- Additional conversion parameters are specified in Flags. \r
+ Additional conversion parameters are specified in Flags.\r
The Flags bit LEFT_JUSTIFY is always ignored.\r
All conversions are left justified in Buffer.\r
If Width is 0, PREFIX_ZERO is ignored in Flags.\r
If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and commas\r
are inserted every 3rd digit starting from the right.\r
If Value is < 0, then the fist character in Buffer is a '-'.\r
- If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored, \r
- then Buffer is padded with '0' characters so the combination of the optional '-' \r
+ If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored,\r
+ then Buffer is padded with '0' characters so the combination of the optional '-'\r
sign character, '0' characters, digit characters for Value, and the Null-terminator\r
add up to Width characters.\r
\r
@param Width The maximum number of characters to place in Buffer, not including\r
the Null-terminator.\r
@param Increment Character increment in Buffer.\r
- \r
+\r
@return Total number of characters required to perform the conversion.\r
\r
**/\r
IN UINTN Increment\r
);\r
\r
+/**\r
+ Internal function that converts a decimal value to a Null-terminated string.\r
+\r
+ Converts the decimal number specified by Value to a Null-terminated string\r
+ specified by Buffer containing at most Width characters. If Width is 0 then a\r
+ width of MAXIMUM_VALUE_CHARACTERS is assumed. If the conversion contains more\r
+ than Width characters, then only the first Width characters are placed in\r
+ Buffer. Additional conversion parameters are specified in Flags.\r
+ The Flags bit LEFT_JUSTIFY is always ignored.\r
+ All conversions are left justified in Buffer.\r
+ If Width is 0, PREFIX_ZERO is ignored in Flags.\r
+ If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and\r
+ commas are inserted every 3rd digit starting from the right.\r
+ If Value is < 0, then the fist character in Buffer is a '-'.\r
+ If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored,\r
+ then Buffer is padded with '0' characters so the combination of the optional\r
+ '-' sign character, '0' characters, digit characters for Value, and the\r
+ Null-terminator add up to Width characters.\r
+\r
+ If an error would be returned, the function will ASSERT().\r
+\r
+ @param Buffer The pointer to the output buffer for the produced\r
+ Null-terminated string.\r
+ @param BufferSize The size of Buffer in bytes, including the\r
+ Null-terminator.\r
+ @param Flags The bitmask of flags that specify left justification,\r
+ zero pad, and commas.\r
+ @param Value The 64-bit signed value to convert to a string.\r
+ @param Width The maximum number of characters to place in Buffer,\r
+ not including the Null-terminator.\r
+ @param Increment The character increment in Buffer.\r
+\r
+ @retval RETURN_SUCCESS The decimal value is converted.\r
+ @retval RETURN_BUFFER_TOO_SMALL If BufferSize cannot hold the converted\r
+ value.\r
+ @retval RETURN_INVALID_PARAMETER If Buffer is NULL.\r
+ If Increment is 1 and\r
+ PcdMaximumAsciiStringLength is not zero,\r
+ BufferSize is greater than\r
+ PcdMaximumAsciiStringLength.\r
+ If Increment is not 1 and\r
+ PcdMaximumUnicodeStringLength is not zero,\r
+ BufferSize is greater than\r
+ (PcdMaximumUnicodeStringLength *\r
+ sizeof (CHAR16) + 1).\r
+ If unsupported bits are set in Flags.\r
+ If both COMMA_TYPE and RADIX_HEX are set in\r
+ Flags.\r
+ If Width >= MAXIMUM_VALUE_CHARACTERS.\r
+\r
+**/\r
+RETURN_STATUS\r
+BasePrintLibConvertValueToStringS (\r
+ IN OUT CHAR8 *Buffer,\r
+ IN UINTN BufferSize,\r
+ IN UINTN Flags,\r
+ IN INT64 Value,\r
+ IN UINTN Width,\r
+ IN UINTN Increment\r
+ );\r
+\r
#endif\r