]>
git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Foundation/Library/Dxe/PrintLite/Print.c
3 Copyright (c) 2004, 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.
18 Basic Ascii AvSPrintf() function named VSPrint(). VSPrint() enables very
19 simple implemenation of SPrint() and Print() to support debug.
21 You can not Print more than EFI_DRIVER_LIB_MAX_PRINT_BUFFER characters at a
22 time. This makes the implementation very simple.
24 VSPrint, Print, SPrint format specification has the follwoing form
32 ',' - Place commas in numberss
33 '0' - Prefix for width with zeros
38 '*' - Get width from a UINTN argumnet from the argument list
39 Decimal number that represents width of print
42 'X' - argument is a UINTN hex number, prefix '0'
43 'x' - argument is a hex number
44 'd' - argument is a decimal number
45 'a' - argument is an ascii string
46 'S','s' - argument is an Unicode string
47 'g' - argument is a pointer to an EFI_GUID
48 't' - argument is a pointer to an EFI_TIME structure
49 'c' - argument is an ascii character
50 'r' - argument is EFI_STATUS
56 #include "EfiDriverLib.h"
57 #include "TianoCommon.h"
58 #include "EfiCommonLib.h"
59 #include "PrintWidth.h"
60 #include "EfiPrintLib.h"
67 IN CONST CHAR_W
*Format
,
74 SPrint function to process format and place the results in Buffer.
78 Buffer - Wide char buffer to print the results of the parsing of Format into.
80 BufferSize - Maximum number of characters to put into buffer. Zero means no
83 Format - Format string see file header for more details.
85 ... - Vararg list consumed by processing Format.
89 Number of characters printed.
96 VA_START (Marker
, Format
);
97 Return
= VSPrint (Buffer
, BufferSize
, Format
, Marker
);
105 OUT CHAR_W
*StartOfBuffer
,
107 IN CONST CHAR_W
*FormatString
,
114 VSPrint function to process format and place the results in Buffer. Since a
115 VA_LIST is used this rountine allows the nesting of Vararg routines. Thus
116 this is the main print working routine
120 StartOfBuffer - Unicode buffer to print the results of the parsing of Format into.
122 BufferSize - Maximum number of characters to put into buffer. Zero means
125 FormatString - Unicode format string see file header for more details.
127 Marker - Vararg list consumed by processing Format.
131 Number of characters printed.
136 EFI_PRINT_PROTOCOL
*PrintProtocol
;
138 Status
= gBS
->LocateProtocol (
139 &gEfiPrintProtocolGuid
,
141 (VOID
*)&PrintProtocol
143 if (EFI_ERROR (Status
)) {
146 return PrintProtocol
->VSPrint (