-/** @file\r
- Print Library.\r
-\r
+/*++\r
\r
Copyright (c) 2004-2006 Intel Corporation. All rights reserved\r
-This software and associated documentation (if any) is furnished\r
-under a license and may only be used or copied in accordance\r
-with the terms of the license. Except as permitted by such\r
-license, no part of this software or documentation may be\r
-reproduced, stored in a retrieval system, or transmitted in any\r
-form or by any means without the express written consent of\r
-Intel Corporation.\r
+This program and the accompanying materials are licensed and made available\r
+under the terms and conditions of the BSD License which accompanies this\r
+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
+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
\r
- Module Name: PrintLib.c\r
\r
-**/\r
+Module Name:\r
+\r
+ PrintLib.c\r
+\r
+Abstract:\r
+\r
+ Print Library.\r
+\r
+--*/\r
\r
#include <Common/UefiBaseTypes.h>\r
#include <Library/PrintLib.h>\r
\r
\r
/**\r
- VSPrint function to process format and place the results in Buffer. Since a \r
- VA_LIST is used this rountine 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 rountine allows the nesting of Vararg routines. Thus\r
this is the main print working routine\r
\r
@param StartOfBuffer Unicode buffer to print the results of the parsing of Format into.\r
- \r
+\r
@param BufferSize Maximum number of characters to put into buffer. Zero means\r
no limit.\r
- \r
+\r
@param Flags Intial flags value. Can only have FORMAT_UNICODE and OUTPUT_UNICODE set\r
- \r
+\r
@param FormatString Unicode format string see file header for more details.\r
- \r
+\r
@param Marker Vararg list consumed by processing Format.\r
\r
@return Number of characters printed.\r
Format += BytesPerFormatCharacter;\r
FormatCharacter = (*Format | (*(Format + 1) << 8)) & FormatMask;\r
switch (FormatCharacter) {\r
- case '.': \r
- Flags |= PRECISION; \r
+ case '.':\r
+ Flags |= PRECISION;\r
break;\r
- case '-': \r
- Flags |= LEFT_JUSTIFY; \r
+ case '-':\r
+ Flags |= LEFT_JUSTIFY;\r
break;\r
- case '+': \r
- Flags |= PREFIX_SIGN; \r
+ case '+':\r
+ Flags |= PREFIX_SIGN;\r
break;\r
- case ' ': \r
- Flags |= PREFIX_BLANK; \r
+ case ' ':\r
+ Flags |= PREFIX_BLANK;\r
break;\r
- case ',': \r
- Flags |= COMMA_TYPE; \r
+ case ',':\r
+ Flags |= COMMA_TYPE;\r
break;\r
case 'L':\r
- case 'l': \r
- Flags |= LONG_TYPE; \r
+ case 'l':\r
+ Flags |= LONG_TYPE;\r
break;\r
case '*':\r
if ((Flags & PRECISION) == 0) {\r
Done = TRUE;\r
break;\r
}\r
- } \r
+ }\r
\r
//\r
// Limit the maximum field width to the remaining characters in the output buffer\r
} else {\r
BasePrintLibSPrint (\r
ValueBuffer,\r
- 0, \r
+ 0,\r
0,\r
"%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",\r
TmpGuid->Data1,\r
break;\r
\r
case 't':\r
- TmpTime = VA_ARG (Marker, TIME *); \r
+ TmpTime = VA_ARG (Marker, TIME *);\r
if (TmpTime == NULL) {\r
ArgumentString = "<null time>";\r
} else {\r
// Null terminate the Unicode or ASCII string\r
//\r
Buffer = BasePrintLibFillBuffer (Buffer, 1, 0, BytesPerOutputCharacter);\r
- \r
+\r
return ((Buffer - OriginalBuffer) / BytesPerOutputCharacter);\r
}\r
\r