+++ /dev/null
-/*++\r
-\r
-Copyright (c) 2006, Intel Corporation \r
-All rights reserved. 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
-\r
-Module Name:\r
-\r
- PrintLib.c\r
-\r
-Abstract:\r
-\r
- Print Library\r
-\r
---*/\r
-\r
-\r
-\r
-static EFI_PRINT_PROTOCOL *gPrintProtocol = NULL;\r
-\r
-UINTN\r
-UnicodeVSPrint (\r
- OUT CHAR16 *StartOfBuffer,\r
- IN UINTN BufferSize,\r
- IN const CHAR16 *FormatString,\r
- IN VA_LIST Marker\r
- )\r
-/*++\r
-\r
-Routine Description:\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
- this is the main print working routine\r
-\r
-Arguments:\r
-\r
- StartOfBuffer - Unicode buffer to print the results of the parsing of Format into.\r
-\r
- BufferSize - Maximum number of characters to put into buffer. Zero means \r
- no limit.\r
-\r
- FormatString - Unicode format string see file header for more details.\r
-\r
- Marker - Vararg list consumed by processing Format.\r
-\r
-Returns: \r
-\r
- Number of characters printed.\r
-\r
---*/\r
-{\r
- EFI_STATUS Status;\r
-\r
- if (gPrintProtocol == NULL) {\r
- Status = gBS->LocateProtocol (\r
- &gEfiPrintProtocolGuid,\r
- NULL,\r
- (VOID **)&gPrintProtocol\r
- );\r
- if (EFI_ERROR (Status)) {\r
- gPrintProtocol = NULL;\r
- } \r
- if (gPrintProtocol == NULL) {\r
- return 0;\r
- }\r
- }\r
- return gPrintProtocol->VSPrint (StartOfBuffer, BufferSize, FormatString, Marker);\r
-}\r
-\r
-UINTN\r
-UnicodeSPrint (\r
- OUT CHAR16 *StartOfBuffer,\r
- IN UINTN BufferSize,\r
- IN const CHAR16 *FormatString,\r
- ...\r
- )\r
-\r
-{\r
- UINTN Return;\r
- VA_LIST Marker;\r
-\r
- VA_START (Marker, FormatString);\r
- Return = UnicodeVSPrint (StartOfBuffer, BufferSize, FormatString, Marker);\r
- VA_END (Marker);\r
- return Return;\r
-}\r
-\r
-UINTN\r
-AsciiVSPrint (\r
- OUT CHAR8 *StartOfBuffer,\r
- IN UINTN BufferSize,\r
- IN const CHAR8 *FormatString,\r
- IN VA_LIST Marker\r
- )\r
-/*++\r
-\r
-Routine Description:\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
- this is the main print working routine\r
-\r
-Arguments:\r
-\r
- StartOfBuffer - Unicode buffer to print the results of the parsing of Format into.\r
-\r
- BufferSize - Maximum number of characters to put into buffer. Zero means \r
- no limit.\r
-\r
- FormatString - Unicode format string see file header for more details.\r
-\r
- Marker - Vararg list consumed by processing Format.\r
-\r
-Returns: \r
-\r
- Number of characters printed.\r
-\r
---*/\r
-{\r
- return 0;\r
-}\r
-\r
-UINTN\r
-AsciiSPrint (\r
- OUT CHAR8 *StartOfBuffer,\r
- IN UINTN BufferSize,\r
- IN const CHAR8 *FormatString,\r
- ...\r
- )\r
-\r
-{\r
- UINTN Return;\r
- VA_LIST Marker;\r
-\r
- VA_START (Marker, FormatString);\r
- Return = AsciiVSPrint (StartOfBuffer, BufferSize, FormatString, Marker);\r
- VA_END (Marker);\r
- return Return;\r
-}\r