]>
git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Library/EdkDxePrintLib/PrintLib.c
3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
27 #include <Protocol/Print.h>
29 #include <Library/PrintLib.h>
30 #include <Library/UefiBootServicesTableLib.h>
32 static EFI_PRINT_PROTOCOL
*gPrintProtocol
= NULL
;
36 OUT CHAR16
*StartOfBuffer
,
38 IN
const CHAR16
*FormatString
,
45 VSPrint function to process format and place the results in Buffer. Since a
46 VA_LIST is used this rountine allows the nesting of Vararg routines. Thus
47 this is the main print working routine
51 StartOfBuffer - Unicode buffer to print the results of the parsing of Format into.
53 BufferSize - Maximum number of characters to put into buffer. Zero means
56 FormatString - Unicode format string see file header for more details.
58 Marker - Vararg list consumed by processing Format.
62 Number of characters printed.
68 if (gPrintProtocol
== NULL
) {
69 Status
= gBS
->LocateProtocol (
70 &gEfiPrintProtocolGuid
,
72 (VOID
**)&gPrintProtocol
74 if (EFI_ERROR (Status
)) {
75 gPrintProtocol
= NULL
;
77 if (gPrintProtocol
== NULL
) {
81 return gPrintProtocol
->VSPrint (StartOfBuffer
, BufferSize
, FormatString
, Marker
);
86 OUT CHAR16
*StartOfBuffer
,
88 IN
const CHAR16
*FormatString
,
96 VA_START (Marker
, FormatString
);
97 Return
= UnicodeVSPrint (StartOfBuffer
, BufferSize
, FormatString
, Marker
);
104 OUT CHAR8
*StartOfBuffer
,
106 IN
const CHAR8
*FormatString
,
113 VSPrint function to process format and place the results in Buffer. Since a
114 VA_LIST is used this rountine allows the nesting of Vararg routines. Thus
115 this is the main print working routine
119 StartOfBuffer - Unicode buffer to print the results of the parsing of Format into.
121 BufferSize - Maximum number of characters to put into buffer. Zero means
124 FormatString - Unicode format string see file header for more details.
126 Marker - Vararg list consumed by processing Format.
130 Number of characters printed.
139 OUT CHAR8
*StartOfBuffer
,
141 IN
const CHAR8
*FormatString
,
149 VA_START (Marker
, FormatString
);
150 Return
= AsciiVSPrint (StartOfBuffer
, BufferSize
, FormatString
, Marker
);