3 This file defines the Print protocol.
5 Copyright (c) 2006 - 2008, Intel Corporation
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
19 #define EFI_PRINT_PROTOCOL_GUID \
20 { 0x5bcc3dbc, 0x8c57, 0x450a, { 0xbb, 0xc, 0xa1, 0xc0, 0xbd, 0xde, 0x48, 0xc } }
23 // Forward reference for pure ANSI compatability
25 typedef struct _EFI_PRINT_PROTOCOL EFI_PRINT_PROTOCOL
;
28 Produces a Null-terminated Unicode string in an output buffer based on
29 a Null-terminated Unicode format string and a VA_LIST argument list
31 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
33 The Unicode string is produced by parsing the format string specified by FormatString.
34 Arguments are pulled from the variable argument list specified by Marker based on the
35 contents of the format string.
36 The number of Unicode characters in the produced output buffer is returned not including
38 If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
40 If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
41 If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
42 If BufferSize > 1 and FormatString is NULL, then ASSERT().
43 If BufferSize > 1 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
44 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
45 PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
47 If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
48 contains more than PcdMaximumUnicodeStringLength Unicode characters not including the
49 Null-terminator, then ASSERT().
51 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
53 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
54 @param FormatString Null-terminated Unicode format string.
55 @param Marker VA_LIST marker for the variable argument list.
57 @return The number of Unicode characters in the produced output buffer not including the
63 (EFIAPI
*UNI_VSPRINT
) (
64 OUT CHAR16
*StartOfBuffer
,
66 IN CONST CHAR16
*FormatString
,
71 Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated
72 ASCII format string and a VA_LIST argument list
74 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
76 The Unicode string is produced by parsing the format string specified by FormatString.
77 Arguments are pulled from the variable argument list specified by Marker based on the
78 contents of the format string.
79 The number of Unicode characters in the produced output buffer is returned not including
81 If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
83 If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
84 If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
85 If BufferSize > 1 and FormatString is NULL, then ASSERT().
86 If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
87 PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then
89 If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
90 contains more than PcdMaximumUnicodeStringLength Unicode characters not including the
91 Null-terminator, then ASSERT().
93 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
95 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
96 @param FormatString Null-terminated Unicode format string.
97 @param Marker VA_LIST marker for the variable argument list.
99 @return The number of Unicode characters in the produced output buffer not including the
105 (EFIAPI
*UNI_VSPRINT_ASCII
) (
106 OUT CHAR16
*StartOfBuffer
,
108 IN CONST CHAR8
*FormatString
,
113 Converts a decimal value to a Null-terminated Unicode string.
115 Converts the decimal number specified by Value to a Null-terminated Unicode
116 string specified by Buffer containing at most Width characters. No padding of spaces
117 is ever performed. If Width is 0 then a width of MAXIMUM_VALUE_CHARACTERS is assumed.
118 The number of Unicode characters in Buffer is returned not including the Null-terminator.
119 If the conversion contains more than Width characters, then only the first
120 Width characters are returned, and the total number of characters
121 required to perform the conversion is returned.
122 Additional conversion parameters are specified in Flags.
124 The Flags bit LEFT_JUSTIFY is always ignored.
125 All conversions are left justified in Buffer.
126 If Width is 0, PREFIX_ZERO is ignored in Flags.
127 If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and commas
128 are inserted every 3rd digit starting from the right.
129 If HEX_RADIX is set in Flags, then the output buffer will be
130 formatted in hexadecimal format.
131 If Value is < 0 and HEX_RADIX is not set in Flags, then the fist character in Buffer is a '-'.
132 If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored,
133 then Buffer is padded with '0' characters so the combination of the optional '-'
134 sign character, '0' characters, digit characters for Value, and the Null-terminator
135 add up to Width characters.
136 If both COMMA_TYPE and HEX_RADIX are set in Flags, then ASSERT().
137 If Buffer is NULL, then ASSERT().
138 If Buffer is not aligned on a 16-bit boundary, then ASSERT().
139 If unsupported bits are set in Flags, then ASSERT().
140 If both COMMA_TYPE and HEX_RADIX are set in Flags, then ASSERT().
141 If Width >= MAXIMUM_VALUE_CHARACTERS, then ASSERT()
143 @param Buffer Pointer to the output buffer for the produced Null-terminated
145 @param Flags The bitmask of flags that specify left justification, zero pad, and commas.
146 @param Value The 64-bit signed value to convert to a string.
147 @param Width The maximum number of Unicode characters to place in Buffer, not including
150 @return The number of Unicode characters in Buffer not including the Null-terminator.
155 (EFIAPI
*VALUE_TO_UNISTRING
) (
156 IN OUT CHAR16
*Buffer
,
163 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
164 ASCII format string and a VA_LIST argument list.
166 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
168 The ASCII string is produced by parsing the format string specified by FormatString.
169 Arguments are pulled from the variable argument list specified by Marker based on
170 the contents of the format string.
171 The number of ASCII characters in the produced output buffer is returned not including
173 If BufferSize is 0, then no output buffer is produced and 0 is returned.
175 If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
176 If BufferSize > 0 and FormatString is NULL, then ASSERT().
177 If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
178 PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then
180 If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
181 contains more than PcdMaximumAsciiStringLength ASCII characters not including the
182 Null-terminator, then ASSERT().
184 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
186 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
187 @param FormatString Null-terminated Unicode format string.
188 @param Marker VA_LIST marker for the variable argument list.
190 @return The number of ASCII characters in the produced output buffer not including the
196 (EFIAPI
*ASCII_VSPRINT
) (
197 OUT CHAR8
*StartOfBuffer
,
199 IN CONST CHAR8
*FormatString
,
204 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
205 ASCII format string and a VA_LIST argument list.
207 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
209 The ASCII string is produced by parsing the format string specified by FormatString.
210 Arguments are pulled from the variable argument list specified by Marker based on
211 the contents of the format string.
212 The number of ASCII characters in the produced output buffer is returned not including
214 If BufferSize is 0, then no output buffer is produced and 0 is returned.
216 If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
217 If BufferSize > 0 and FormatString is NULL, then ASSERT().
218 If BufferSize > 0 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
219 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
220 PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
222 If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
223 contains more than PcdMaximumAsciiStringLength ASCII characters not including the
224 Null-terminator, then ASSERT().
226 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
228 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
229 @param FormatString Null-terminated Unicode format string.
230 @param Marker VA_LIST marker for the variable argument list.
232 @return The number of ASCII characters in the produced output buffer not including the
238 (EFIAPI
*ASCII_VSPRINT_UNI
) (
239 OUT CHAR8
*StartOfBuffer
,
241 IN CONST CHAR16
*FormatString
,
246 Converts a decimal value to a Null-terminated ASCII string.
248 Converts the decimal number specified by Value to a Null-terminated ASCII string
249 specified by Buffer containing at most Width characters. No padding of spaces
251 If Width is 0 then a width of MAXIMUM_VALUE_CHARACTERS is assumed.
252 The number of ASCII characters in Buffer is returned not including the Null-terminator.
253 If the conversion contains more than Width characters, then only the first Width
254 characters are returned, and the total number of characters required to perform
255 the conversion is returned.
256 Additional conversion parameters are specified in Flags.
257 The Flags bit LEFT_JUSTIFY is always ignored.
258 All conversions are left justified in Buffer.
259 If Width is 0, PREFIX_ZERO is ignored in Flags.
260 If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and commas
261 are inserted every 3rd digit starting from the right.
262 If HEX_RADIX is set in Flags, then the output buffer will be
263 formatted in hexadecimal format.
264 If Value is < 0 and HEX_RADIX is not set in Flags, then the fist character in Buffer is a '-'.
265 If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored,
266 then Buffer is padded with '0' characters so the combination of the optional '-'
267 sign character, '0' characters, digit characters for Value, and the Null-terminator
268 add up to Width characters.
270 If Buffer is NULL, then ASSERT().
271 If unsupported bits are set in Flags, then ASSERT().
272 If both COMMA_TYPE and HEX_RADIX are set in Flags, then ASSERT().
273 If Width >= MAXIMUM_VALUE_CHARACTERS, then ASSERT()
275 @param Buffer Pointer to the output buffer for the produced Null-terminated
277 @param Flags The bitmask of flags that specify left justification, zero pad, and commas.
278 @param Value The 64-bit signed value to convert to a string.
279 @param Width The maximum number of ASCII characters to place in Buffer, not including
282 @return The number of ASCII characters in Buffer not including the Null-terminator.
287 (EFIAPI
*VALUE_TO_ASCIISTRING
) (
288 IN OUT CHAR8
*Buffer
,
294 struct _EFI_PRINT_PROTOCOL
{
296 UNI_VSPRINT_ASCII UniVSPrintAscii
;
297 VALUE_TO_UNISTRING UniValueToString
;
298 ASCII_VSPRINT AsciiVSPrint
;
299 ASCII_VSPRINT_UNI AsciiVSPrintUni
;
300 VALUE_TO_ASCIISTRING AsciiValueToString
;
303 extern EFI_GUID gEfiPrintProtocolGuid
;