1*f334afcfSToomas Soome /** @file
2*f334afcfSToomas Soome 
3*f334afcfSToomas Soome   Produces EFI_PRINT2_PROTOCOL and EFI_PRINT2S_PROTOCOL.
4*f334afcfSToomas Soome   These protocols define basic print functions to  print the format unicode and
5*f334afcfSToomas Soome   ascii string.
6*f334afcfSToomas Soome 
7*f334afcfSToomas Soome Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
8*f334afcfSToomas Soome SPDX-License-Identifier: BSD-2-Clause-Patent
9*f334afcfSToomas Soome 
10*f334afcfSToomas Soome **/
11*f334afcfSToomas Soome 
12*f334afcfSToomas Soome #ifndef __PPRINT2_H__
13*f334afcfSToomas Soome #define __PPRINT2_H__
14*f334afcfSToomas Soome 
15*f334afcfSToomas Soome #define EFI_PRINT2_PROTOCOL_GUID  \
16*f334afcfSToomas Soome   { 0xf05976ef, 0x83f1, 0x4f3d, { 0x86, 0x19, 0xf7, 0x59, 0x5d, 0x41, 0xe5, 0x38 } }
17*f334afcfSToomas Soome 
18*f334afcfSToomas Soome //
19*f334afcfSToomas Soome // Forward reference for pure ANSI compatability
20*f334afcfSToomas Soome //
21*f334afcfSToomas Soome typedef struct _EFI_PRINT2_PROTOCOL EFI_PRINT2_PROTOCOL;
22*f334afcfSToomas Soome 
23*f334afcfSToomas Soome /**
24*f334afcfSToomas Soome   Produces a Null-terminated Unicode string in an output buffer based on
25*f334afcfSToomas Soome   a Null-terminated Unicode format string and a BASE_LIST argument list.
26*f334afcfSToomas Soome 
27*f334afcfSToomas Soome   Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
28*f334afcfSToomas Soome   and BufferSize.
29*f334afcfSToomas Soome   The Unicode string is produced by parsing the format string specified by FormatString.
30*f334afcfSToomas Soome   Arguments are pulled from the variable argument list specified by Marker based on the
31*f334afcfSToomas Soome   contents of the format string.
32*f334afcfSToomas Soome   The number of Unicode characters in the produced output buffer is returned not including
33*f334afcfSToomas Soome   the Null-terminator.
34*f334afcfSToomas Soome 
35*f334afcfSToomas Soome   If StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
36*f334afcfSToomas Soome   If FormatString is not aligned on a 16-bit boundary, then ASSERT().
37*f334afcfSToomas Soome 
38*f334afcfSToomas Soome   If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is
39*f334afcfSToomas Soome   unmodified and 0 is returned.
40*f334afcfSToomas Soome   If BufferSize > 1 and FormatString is NULL, then ASSERT(). Also, the output buffer is
41*f334afcfSToomas Soome   unmodified and 0 is returned.
42*f334afcfSToomas Soome   If PcdMaximumUnicodeStringLength is not zero, and BufferSize >
43*f334afcfSToomas Soome   (PcdMaximumUnicodeStringLength * sizeof (CHAR16) + 1), then ASSERT(). Also, the output
44*f334afcfSToomas Soome   buffer is unmodified and 0 is returned.
45*f334afcfSToomas Soome   If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
46*f334afcfSToomas Soome   PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
47*f334afcfSToomas Soome   ASSERT(). Also, the output buffer is unmodified and 0 is returned.
48*f334afcfSToomas Soome 
49*f334afcfSToomas Soome   If BufferSize is 0 or 1, then the output buffer is unmodified and 0 is returned.
50*f334afcfSToomas Soome 
51*f334afcfSToomas Soome   @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated
52*f334afcfSToomas Soome                           Unicode string.
53*f334afcfSToomas Soome   @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.
54*f334afcfSToomas Soome   @param  FormatString    A Null-terminated Unicode format string.
55*f334afcfSToomas Soome   @param  Marker          BASE_LIST marker for the variable argument list.
56*f334afcfSToomas Soome 
57*f334afcfSToomas Soome   @return The number of Unicode characters in the produced output buffer not including the
58*f334afcfSToomas Soome           Null-terminator.
59*f334afcfSToomas Soome 
60*f334afcfSToomas Soome **/
61*f334afcfSToomas Soome typedef
62*f334afcfSToomas Soome UINTN
63*f334afcfSToomas Soome (EFIAPI *UNICODE_BS_PRINT)(
64*f334afcfSToomas Soome   OUT CHAR16        *StartOfBuffer,
65*f334afcfSToomas Soome   IN  UINTN         BufferSize,
66*f334afcfSToomas Soome   IN  CONST CHAR16  *FormatString,
67*f334afcfSToomas Soome   IN  BASE_LIST     Marker
68*f334afcfSToomas Soome   );
69*f334afcfSToomas Soome 
70*f334afcfSToomas Soome /**
71*f334afcfSToomas Soome   Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated
72*f334afcfSToomas Soome   Unicode format string and variable argument list.
73*f334afcfSToomas Soome 
74*f334afcfSToomas Soome   This function is similar as snprintf_s defined in C11.
75*f334afcfSToomas Soome 
76*f334afcfSToomas Soome   Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
77*f334afcfSToomas Soome   and BufferSize.
78*f334afcfSToomas Soome   The Unicode string is produced by parsing the format string specified by FormatString.
79*f334afcfSToomas Soome   Arguments are pulled from the variable argument list based on the contents of the format string.
80*f334afcfSToomas Soome   The number of Unicode characters in the produced output buffer is returned not including
81*f334afcfSToomas Soome   the Null-terminator.
82*f334afcfSToomas Soome 
83*f334afcfSToomas Soome   If StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
84*f334afcfSToomas Soome   If FormatString is not aligned on a 16-bit boundary, then ASSERT().
85*f334afcfSToomas Soome 
86*f334afcfSToomas Soome   If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is
87*f334afcfSToomas Soome   unmodified and 0 is returned.
88*f334afcfSToomas Soome   If BufferSize > 1 and FormatString is NULL, then ASSERT(). Also, the output buffer is
89*f334afcfSToomas Soome   unmodified and 0 is returned.
90*f334afcfSToomas Soome   If PcdMaximumUnicodeStringLength is not zero, and BufferSize >
91*f334afcfSToomas Soome   (PcdMaximumUnicodeStringLength * sizeof (CHAR16) + 1), then ASSERT(). Also, the output
92*f334afcfSToomas Soome   buffer is unmodified and 0 is returned.
93*f334afcfSToomas Soome   If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
94*f334afcfSToomas Soome   PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
95*f334afcfSToomas Soome   ASSERT(). Also, the output buffer is unmodified and 0 is returned.
96*f334afcfSToomas Soome 
97*f334afcfSToomas Soome   If BufferSize is 0 or 1, then the output buffer is unmodified and 0 is returned.
98*f334afcfSToomas Soome 
99*f334afcfSToomas Soome   @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated
100*f334afcfSToomas Soome                           Unicode string.
101*f334afcfSToomas Soome   @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.
102*f334afcfSToomas Soome   @param  FormatString    A Null-terminated Unicode format string.
103*f334afcfSToomas Soome   @param  ...             Variable argument list whose contents are accessed based on the
104*f334afcfSToomas Soome                           format string specified by FormatString.
105*f334afcfSToomas Soome 
106*f334afcfSToomas Soome   @return The number of Unicode characters in the produced output buffer not including the
107*f334afcfSToomas Soome           Null-terminator.
108*f334afcfSToomas Soome 
109*f334afcfSToomas Soome **/
110*f334afcfSToomas Soome typedef
111*f334afcfSToomas Soome UINTN
112*f334afcfSToomas Soome (EFIAPI *UNICODE_S_PRINT)(
113*f334afcfSToomas Soome   OUT CHAR16        *StartOfBuffer,
114*f334afcfSToomas Soome   IN  UINTN         BufferSize,
115*f334afcfSToomas Soome   IN  CONST CHAR16  *FormatString,
116*f334afcfSToomas Soome   ...
117*f334afcfSToomas Soome   );
118*f334afcfSToomas Soome 
119*f334afcfSToomas Soome /**
120*f334afcfSToomas Soome   Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated
121*f334afcfSToomas Soome   ASCII format string and a BASE_LIST argument list.
122*f334afcfSToomas Soome 
123*f334afcfSToomas Soome   Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
124*f334afcfSToomas Soome   and BufferSize.
125*f334afcfSToomas Soome   The Unicode string is produced by parsing the format string specified by FormatString.
126*f334afcfSToomas Soome   Arguments are pulled from the variable argument list specified by Marker based on the
127*f334afcfSToomas Soome   contents of the format string.
128*f334afcfSToomas Soome   The number of Unicode characters in the produced output buffer is returned not including
129*f334afcfSToomas Soome   the Null-terminator.
130*f334afcfSToomas Soome 
131*f334afcfSToomas Soome   If StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
132*f334afcfSToomas Soome 
133*f334afcfSToomas Soome   If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is
134*f334afcfSToomas Soome   unmodified and 0 is returned.
135*f334afcfSToomas Soome   If BufferSize > 1 and FormatString is NULL, then ASSERT(). Also, the output buffer is
136*f334afcfSToomas Soome   unmodified and 0 is returned.
137*f334afcfSToomas Soome   If PcdMaximumUnicodeStringLength is not zero, and BufferSize >
138*f334afcfSToomas Soome   (PcdMaximumUnicodeStringLength * sizeof (CHAR16) + 1), then ASSERT(). Also, the output
139*f334afcfSToomas Soome   buffer is unmodified and 0 is returned.
140*f334afcfSToomas Soome   If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
141*f334afcfSToomas Soome   PcdMaximumAsciiStringLength Ascii characters not including the Null-terminator, then
142*f334afcfSToomas Soome   ASSERT(). Also, the output buffer is unmodified and 0 is returned.
143*f334afcfSToomas Soome 
144*f334afcfSToomas Soome   If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
145*f334afcfSToomas Soome 
146*f334afcfSToomas Soome   @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated
147*f334afcfSToomas Soome                           Unicode string.
148*f334afcfSToomas Soome   @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.
149*f334afcfSToomas Soome   @param  FormatString    A Null-terminated ASCII format string.
150*f334afcfSToomas Soome   @param  Marker          BASE_LIST marker for the variable argument list.
151*f334afcfSToomas Soome 
152*f334afcfSToomas Soome   @return The number of Unicode characters in the produced output buffer not including the
153*f334afcfSToomas Soome           Null-terminator.
154*f334afcfSToomas Soome 
155*f334afcfSToomas Soome **/
156*f334afcfSToomas Soome typedef
157*f334afcfSToomas Soome UINTN
158*f334afcfSToomas Soome (EFIAPI *UNICODE_BS_PRINT_ASCII_FORMAT)(
159*f334afcfSToomas Soome   OUT CHAR16       *StartOfBuffer,
160*f334afcfSToomas Soome   IN  UINTN        BufferSize,
161*f334afcfSToomas Soome   IN  CONST CHAR8  *FormatString,
162*f334afcfSToomas Soome   IN  BASE_LIST    Marker
163*f334afcfSToomas Soome   );
164*f334afcfSToomas Soome 
165*f334afcfSToomas Soome /**
166*f334afcfSToomas Soome   Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated
167*f334afcfSToomas Soome   ASCII format string and  variable argument list.
168*f334afcfSToomas Soome 
169*f334afcfSToomas Soome   This function is similar as snprintf_s defined in C11.
170*f334afcfSToomas Soome 
171*f334afcfSToomas Soome   Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
172*f334afcfSToomas Soome   and BufferSize.
173*f334afcfSToomas Soome   The Unicode string is produced by parsing the format string specified by FormatString.
174*f334afcfSToomas Soome   Arguments are pulled from the variable argument list based on the contents of the
175*f334afcfSToomas Soome   format string.
176*f334afcfSToomas Soome   The number of Unicode characters in the produced output buffer is returned not including
177*f334afcfSToomas Soome   the Null-terminator.
178*f334afcfSToomas Soome 
179*f334afcfSToomas Soome   If StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
180*f334afcfSToomas Soome 
181*f334afcfSToomas Soome   If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is
182*f334afcfSToomas Soome   unmodified and 0 is returned.
183*f334afcfSToomas Soome   If BufferSize > 1 and FormatString is NULL, then ASSERT(). Also, the output buffer is
184*f334afcfSToomas Soome   unmodified and 0 is returned.
185*f334afcfSToomas Soome   If PcdMaximumUnicodeStringLength is not zero, and BufferSize >
186*f334afcfSToomas Soome   (PcdMaximumUnicodeStringLength * sizeof (CHAR16) + 1), then ASSERT(). Also, the output
187*f334afcfSToomas Soome   buffer is unmodified and 0 is returned.
188*f334afcfSToomas Soome   If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
189*f334afcfSToomas Soome   PcdMaximumAsciiStringLength Ascii characters not including the Null-terminator, then
190*f334afcfSToomas Soome   ASSERT(). Also, the output buffer is unmodified and 0 is returned.
191*f334afcfSToomas Soome 
192*f334afcfSToomas Soome   If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
193*f334afcfSToomas Soome 
194*f334afcfSToomas Soome   @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated
195*f334afcfSToomas Soome                           Unicode string.
196*f334afcfSToomas Soome   @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.
197*f334afcfSToomas Soome   @param  FormatString    A Null-terminated ASCII format string.
198*f334afcfSToomas Soome   @param  ...             Variable argument list whose contents are accessed based on the
199*f334afcfSToomas Soome                           format string specified by FormatString.
200*f334afcfSToomas Soome 
201*f334afcfSToomas Soome   @return The number of Unicode characters in the produced output buffer not including the
202*f334afcfSToomas Soome           Null-terminator.
203*f334afcfSToomas Soome 
204*f334afcfSToomas Soome **/
205*f334afcfSToomas Soome typedef
206*f334afcfSToomas Soome UINTN
207*f334afcfSToomas Soome (EFIAPI *UNICODE_S_PRINT_ASCII_FORMAT)(
208*f334afcfSToomas Soome   OUT CHAR16       *StartOfBuffer,
209*f334afcfSToomas Soome   IN  UINTN        BufferSize,
210*f334afcfSToomas Soome   IN  CONST CHAR8  *FormatString,
211*f334afcfSToomas Soome   ...
212*f334afcfSToomas Soome   );
213*f334afcfSToomas Soome 
214*f334afcfSToomas Soome /**
215*f334afcfSToomas Soome   Converts a decimal value to a Null-terminated Unicode string.
216*f334afcfSToomas Soome 
217*f334afcfSToomas Soome   Converts the decimal number specified by Value to a Null-terminated Unicode
218*f334afcfSToomas Soome   string specified by Buffer containing at most Width characters. No padding of spaces
219*f334afcfSToomas Soome   is ever performed. If Width is 0, then a width of MAXIMUM_VALUE_CHARACTERS is assumed.
220*f334afcfSToomas Soome   This function returns the number of Unicode characters in Buffer, not including
221*f334afcfSToomas Soome   the Null-terminator.
222*f334afcfSToomas Soome   If the conversion contains more than Width characters, this function returns
223*f334afcfSToomas Soome   the first Width characters in the conversion, along with the total number of characters in the conversion.
224*f334afcfSToomas Soome   Additional conversion parameters are specified in Flags.
225*f334afcfSToomas Soome 
226*f334afcfSToomas Soome   The Flags bit LEFT_JUSTIFY is always ignored.
227*f334afcfSToomas Soome   All conversions are left justified in Buffer.
228*f334afcfSToomas Soome   If Width is 0, PREFIX_ZERO is ignored in Flags.
229*f334afcfSToomas Soome   If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and commas
230*f334afcfSToomas Soome   are inserted every 3rd digit starting from the right.
231*f334afcfSToomas Soome   If RADIX_HEX is set in Flags, then the output buffer will be
232*f334afcfSToomas Soome   formatted in hexadecimal format.
233*f334afcfSToomas Soome   If Value is < 0 and RADIX_HEX is not set in Flags, then the fist character in Buffer is a '-'.
234*f334afcfSToomas Soome   If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored,
235*f334afcfSToomas Soome   then Buffer is padded with '0' characters so the combination of the optional '-'
236*f334afcfSToomas Soome   sign character, '0' characters, digit characters for Value, and the Null-terminator
237*f334afcfSToomas Soome   add up to Width characters.
238*f334afcfSToomas Soome   If both COMMA_TYPE and RADIX_HEX are set in Flags, then ASSERT().
239*f334afcfSToomas Soome   If Buffer is NULL, then ASSERT().
240*f334afcfSToomas Soome   If Buffer is not aligned on a 16-bit boundary, then ASSERT().
241*f334afcfSToomas Soome   If unsupported bits are set in Flags, then ASSERT().
242*f334afcfSToomas Soome   If both COMMA_TYPE and RADIX_HEX are set in Flags, then ASSERT().
243*f334afcfSToomas Soome   If Width >= MAXIMUM_VALUE_CHARACTERS, then ASSERT()
244*f334afcfSToomas Soome 
245*f334afcfSToomas Soome   @param  Buffer  The pointer to the output buffer for the produced Null-terminated
246*f334afcfSToomas Soome                   Unicode string.
247*f334afcfSToomas Soome   @param  Flags   The bitmask of flags that specify left justification, zero pad, and commas.
248*f334afcfSToomas Soome   @param  Value   The 64-bit signed value to convert to a string.
249*f334afcfSToomas Soome   @param  Width   The maximum number of Unicode characters to place in Buffer, not including
250*f334afcfSToomas Soome                   the Null-terminator.
251*f334afcfSToomas Soome 
252*f334afcfSToomas Soome   @return The number of Unicode characters in Buffer not including the Null-terminator.
253*f334afcfSToomas Soome 
254*f334afcfSToomas Soome **/
255*f334afcfSToomas Soome typedef
256*f334afcfSToomas Soome UINTN
257*f334afcfSToomas Soome (EFIAPI *UNICODE_VALUE_TO_STRING)(
258*f334afcfSToomas Soome   IN OUT CHAR16  *Buffer,
259*f334afcfSToomas Soome   IN UINTN       Flags,
260*f334afcfSToomas Soome   IN INT64       Value,
261*f334afcfSToomas Soome   IN UINTN       Width
262*f334afcfSToomas Soome   );
263*f334afcfSToomas Soome 
264*f334afcfSToomas Soome /**
265*f334afcfSToomas Soome   Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
266*f334afcfSToomas Soome   ASCII format string and a BASE_LIST argument list.
267*f334afcfSToomas Soome 
268*f334afcfSToomas Soome   Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
269*f334afcfSToomas Soome   and BufferSize.
270*f334afcfSToomas Soome   The ASCII string is produced by parsing the format string specified by FormatString.
271*f334afcfSToomas Soome   Arguments are pulled from the variable argument list specified by Marker based on
272*f334afcfSToomas Soome   the contents of the format string.
273*f334afcfSToomas Soome   The number of ASCII characters in the produced output buffer is returned not including
274*f334afcfSToomas Soome   the Null-terminator.
275*f334afcfSToomas Soome 
276*f334afcfSToomas Soome   If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is
277*f334afcfSToomas Soome   unmodified and 0 is returned.
278*f334afcfSToomas Soome   If BufferSize > 0 and FormatString is NULL, then ASSERT(). Also, the output buffer is
279*f334afcfSToomas Soome   unmodified and 0 is returned.
280*f334afcfSToomas Soome   If PcdMaximumAsciiStringLength is not zero, and BufferSize >
281*f334afcfSToomas Soome   (PcdMaximumAsciiStringLength * sizeof (CHAR8)), then ASSERT(). Also, the output buffer
282*f334afcfSToomas Soome   is unmodified and 0 is returned.
283*f334afcfSToomas Soome   If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
284*f334afcfSToomas Soome   PcdMaximumAsciiStringLength Ascii characters not including the Null-terminator, then
285*f334afcfSToomas Soome   ASSERT(). Also, the output buffer is unmodified and 0 is returned.
286*f334afcfSToomas Soome 
287*f334afcfSToomas Soome   If BufferSize is 0, then no output buffer is produced and 0 is returned.
288*f334afcfSToomas Soome 
289*f334afcfSToomas Soome   @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated
290*f334afcfSToomas Soome                           ASCII string.
291*f334afcfSToomas Soome   @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.
292*f334afcfSToomas Soome   @param  FormatString    A Null-terminated ASCII format string.
293*f334afcfSToomas Soome   @param  Marker          BASE_LIST marker for the variable argument list.
294*f334afcfSToomas Soome 
295*f334afcfSToomas Soome   @return The number of ASCII characters in the produced output buffer not including the
296*f334afcfSToomas Soome           Null-terminator.
297*f334afcfSToomas Soome 
298*f334afcfSToomas Soome **/
299*f334afcfSToomas Soome typedef
300*f334afcfSToomas Soome UINTN
301*f334afcfSToomas Soome (EFIAPI *ASCII_BS_PRINT)(
302*f334afcfSToomas Soome   OUT CHAR8         *StartOfBuffer,
303*f334afcfSToomas Soome   IN  UINTN         BufferSize,
304*f334afcfSToomas Soome   IN  CONST CHAR8   *FormatString,
305*f334afcfSToomas Soome   IN  BASE_LIST     Marker
306*f334afcfSToomas Soome   );
307*f334afcfSToomas Soome 
308*f334afcfSToomas Soome /**
309*f334afcfSToomas Soome   Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
310*f334afcfSToomas Soome   ASCII format string and  variable argument list.
311*f334afcfSToomas Soome 
312*f334afcfSToomas Soome   This function is similar as snprintf_s defined in C11.
313*f334afcfSToomas Soome 
314*f334afcfSToomas Soome   Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
315*f334afcfSToomas Soome   and BufferSize.
316*f334afcfSToomas Soome   The ASCII string is produced by parsing the format string specified by FormatString.
317*f334afcfSToomas Soome   Arguments are pulled from the variable argument list based on the contents of the
318*f334afcfSToomas Soome   format string.
319*f334afcfSToomas Soome   The number of ASCII characters in the produced output buffer is returned not including
320*f334afcfSToomas Soome   the Null-terminator.
321*f334afcfSToomas Soome 
322*f334afcfSToomas Soome   If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is
323*f334afcfSToomas Soome   unmodified and 0 is returned.
324*f334afcfSToomas Soome   If BufferSize > 0 and FormatString is NULL, then ASSERT(). Also, the output buffer is
325*f334afcfSToomas Soome   unmodified and 0 is returned.
326*f334afcfSToomas Soome   If PcdMaximumAsciiStringLength is not zero, and BufferSize >
327*f334afcfSToomas Soome   (PcdMaximumAsciiStringLength * sizeof (CHAR8)), then ASSERT(). Also, the output buffer
328*f334afcfSToomas Soome   is unmodified and 0 is returned.
329*f334afcfSToomas Soome   If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
330*f334afcfSToomas Soome   PcdMaximumAsciiStringLength Ascii characters not including the Null-terminator, then
331*f334afcfSToomas Soome   ASSERT(). Also, the output buffer is unmodified and 0 is returned.
332*f334afcfSToomas Soome 
333*f334afcfSToomas Soome   If BufferSize is 0, then no output buffer is produced and 0 is returned.
334*f334afcfSToomas Soome 
335*f334afcfSToomas Soome   @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated
336*f334afcfSToomas Soome                           ASCII string.
337*f334afcfSToomas Soome   @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.
338*f334afcfSToomas Soome   @param  FormatString    A Null-terminated ASCII format string.
339*f334afcfSToomas Soome   @param  ...             Variable argument list whose contents are accessed based on the
340*f334afcfSToomas Soome                           format string specified by FormatString.
341*f334afcfSToomas Soome 
342*f334afcfSToomas Soome   @return The number of ASCII characters in the produced output buffer not including the
343*f334afcfSToomas Soome           Null-terminator.
344*f334afcfSToomas Soome 
345*f334afcfSToomas Soome **/
346*f334afcfSToomas Soome typedef
347*f334afcfSToomas Soome UINTN
348*f334afcfSToomas Soome (EFIAPI *ASCII_S_PRINT)(
349*f334afcfSToomas Soome   OUT CHAR8        *StartOfBuffer,
350*f334afcfSToomas Soome   IN  UINTN        BufferSize,
351*f334afcfSToomas Soome   IN  CONST CHAR8  *FormatString,
352*f334afcfSToomas Soome   ...
353*f334afcfSToomas Soome   );
354*f334afcfSToomas Soome 
355*f334afcfSToomas Soome /**
356*f334afcfSToomas Soome   Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
357*f334afcfSToomas Soome   Unicode format string and a BASE_LIST argument list.
358*f334afcfSToomas Soome 
359*f334afcfSToomas Soome   Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
360*f334afcfSToomas Soome   and BufferSize.
361*f334afcfSToomas Soome   The ASCII string is produced by parsing the format string specified by FormatString.
362*f334afcfSToomas Soome   Arguments are pulled from the variable argument list specified by Marker based on
363*f334afcfSToomas Soome   the contents of the format string.
364*f334afcfSToomas Soome   The number of ASCII characters in the produced output buffer is returned not including
365*f334afcfSToomas Soome   the Null-terminator.
366*f334afcfSToomas Soome 
367*f334afcfSToomas Soome   If FormatString is not aligned on a 16-bit boundary, then ASSERT().
368*f334afcfSToomas Soome 
369*f334afcfSToomas Soome   If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is
370*f334afcfSToomas Soome   unmodified and 0 is returned.
371*f334afcfSToomas Soome   If BufferSize > 0 and FormatString is NULL, then ASSERT(). Also, the output buffer is
372*f334afcfSToomas Soome   unmodified and 0 is returned.
373*f334afcfSToomas Soome   If PcdMaximumAsciiStringLength is not zero, and BufferSize >
374*f334afcfSToomas Soome   (PcdMaximumAsciiStringLength * sizeof (CHAR8)), then ASSERT(). Also, the output buffer
375*f334afcfSToomas Soome   is unmodified and 0 is returned.
376*f334afcfSToomas Soome   If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
377*f334afcfSToomas Soome   PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
378*f334afcfSToomas Soome   ASSERT(). Also, the output buffer is unmodified and 0 is returned.
379*f334afcfSToomas Soome 
380*f334afcfSToomas Soome   If BufferSize is 0, then no output buffer is produced and 0 is returned.
381*f334afcfSToomas Soome 
382*f334afcfSToomas Soome   @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated
383*f334afcfSToomas Soome                           ASCII string.
384*f334afcfSToomas Soome   @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.
385*f334afcfSToomas Soome   @param  FormatString    A Null-terminated Unicode format string.
386*f334afcfSToomas Soome   @param  Marker          BASE_LIST marker for the variable argument list.
387*f334afcfSToomas Soome 
388*f334afcfSToomas Soome   @return The number of ASCII characters in the produced output buffer not including the
389*f334afcfSToomas Soome           Null-terminator.
390*f334afcfSToomas Soome 
391*f334afcfSToomas Soome **/
392*f334afcfSToomas Soome typedef
393*f334afcfSToomas Soome UINTN
394*f334afcfSToomas Soome (EFIAPI *ASCII_BS_PRINT_UNICODE_FORMAT)(
395*f334afcfSToomas Soome   OUT CHAR8         *StartOfBuffer,
396*f334afcfSToomas Soome   IN  UINTN         BufferSize,
397*f334afcfSToomas Soome   IN  CONST CHAR16  *FormatString,
398*f334afcfSToomas Soome   IN  BASE_LIST     Marker
399*f334afcfSToomas Soome   );
400*f334afcfSToomas Soome 
401*f334afcfSToomas Soome /**
402*f334afcfSToomas Soome   Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
403*f334afcfSToomas Soome   Unicode format string and  variable argument list.
404*f334afcfSToomas Soome 
405*f334afcfSToomas Soome   This function is similar as snprintf_s defined in C11.
406*f334afcfSToomas Soome 
407*f334afcfSToomas Soome   Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
408*f334afcfSToomas Soome   and BufferSize.
409*f334afcfSToomas Soome   The ASCII string is produced by parsing the format string specified by FormatString.
410*f334afcfSToomas Soome   Arguments are pulled from the variable argument list based on the contents of the
411*f334afcfSToomas Soome   format string.
412*f334afcfSToomas Soome   The number of ASCII characters in the produced output buffer is returned not including
413*f334afcfSToomas Soome   the Null-terminator.
414*f334afcfSToomas Soome 
415*f334afcfSToomas Soome   If FormatString is not aligned on a 16-bit boundary, then ASSERT().
416*f334afcfSToomas Soome 
417*f334afcfSToomas Soome   If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is
418*f334afcfSToomas Soome   unmodified and 0 is returned.
419*f334afcfSToomas Soome   If BufferSize > 0 and FormatString is NULL, then ASSERT(). Also, the output buffer is
420*f334afcfSToomas Soome   unmodified and 0 is returned.
421*f334afcfSToomas Soome   If PcdMaximumAsciiStringLength is not zero, and BufferSize >
422*f334afcfSToomas Soome   (PcdMaximumAsciiStringLength * sizeof (CHAR8)), then ASSERT(). Also, the output buffer
423*f334afcfSToomas Soome   is unmodified and 0 is returned.
424*f334afcfSToomas Soome   If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
425*f334afcfSToomas Soome   PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
426*f334afcfSToomas Soome   ASSERT(). Also, the output buffer is unmodified and 0 is returned.
427*f334afcfSToomas Soome 
428*f334afcfSToomas Soome   If BufferSize is 0, then no output buffer is produced and 0 is returned.
429*f334afcfSToomas Soome 
430*f334afcfSToomas Soome   @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated
431*f334afcfSToomas Soome                           ASCII string.
432*f334afcfSToomas Soome   @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.
433*f334afcfSToomas Soome   @param  FormatString    A Null-terminated Unicode format string.
434*f334afcfSToomas Soome   @param  ...             Variable argument list whose contents are accessed based on the
435*f334afcfSToomas Soome                           format string specified by FormatString.
436*f334afcfSToomas Soome 
437*f334afcfSToomas Soome   @return The number of ASCII characters in the produced output buffer not including the
438*f334afcfSToomas Soome           Null-terminator.
439*f334afcfSToomas Soome 
440*f334afcfSToomas Soome **/
441*f334afcfSToomas Soome typedef
442*f334afcfSToomas Soome UINTN
443*f334afcfSToomas Soome (EFIAPI *ASCII_S_PRINT_UNICODE_FORMAT)(
444*f334afcfSToomas Soome   OUT CHAR8         *StartOfBuffer,
445*f334afcfSToomas Soome   IN  UINTN         BufferSize,
446*f334afcfSToomas Soome   IN  CONST CHAR16  *FormatString,
447*f334afcfSToomas Soome   ...
448*f334afcfSToomas Soome   );
449*f334afcfSToomas Soome 
450*f334afcfSToomas Soome /**
451*f334afcfSToomas Soome   Converts a decimal value to a Null-terminated ASCII string.
452*f334afcfSToomas Soome 
453*f334afcfSToomas Soome   Converts the decimal number specified by Value to a Null-terminated ASCII string
454*f334afcfSToomas Soome   specified by Buffer containing at most Width characters. No padding of spaces is ever performed.
455*f334afcfSToomas Soome   If Width is 0 then a width of MAXIMUM_VALUE_CHARACTERS is assumed.
456*f334afcfSToomas Soome   The number of ASCII characters in Buffer is returned not including the Null-terminator.
457*f334afcfSToomas Soome   If the conversion contains more than Width characters, then only the first Width
458*f334afcfSToomas Soome   characters are returned, and the total number of characters required to perform
459*f334afcfSToomas Soome   the conversion is returned.
460*f334afcfSToomas Soome   Additional conversion parameters are specified in Flags.
461*f334afcfSToomas Soome   The Flags bit LEFT_JUSTIFY is always ignored.
462*f334afcfSToomas Soome   All conversions are left justified in Buffer.
463*f334afcfSToomas Soome   If Width is 0, PREFIX_ZERO is ignored in Flags.
464*f334afcfSToomas Soome   If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and commas
465*f334afcfSToomas Soome   are inserted every 3rd digit starting from the right.
466*f334afcfSToomas Soome   If RADIX_HEX is set in Flags, then the output buffer will be
467*f334afcfSToomas Soome   formatted in hexadecimal format.
468*f334afcfSToomas Soome   If Value is < 0 and RADIX_HEX is not set in Flags, then the fist character in Buffer is a '-'.
469*f334afcfSToomas Soome   If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored,
470*f334afcfSToomas Soome   then Buffer is padded with '0' characters so the combination of the optional '-'
471*f334afcfSToomas Soome   sign character, '0' characters, digit characters for Value, and the Null-terminator
472*f334afcfSToomas Soome   add up to Width characters.
473*f334afcfSToomas Soome 
474*f334afcfSToomas Soome   If Buffer is NULL, then ASSERT().
475*f334afcfSToomas Soome   If unsupported bits are set in Flags, then ASSERT().
476*f334afcfSToomas Soome   If both COMMA_TYPE and RADIX_HEX are set in Flags, then ASSERT().
477*f334afcfSToomas Soome   If Width >= MAXIMUM_VALUE_CHARACTERS, then ASSERT()
478*f334afcfSToomas Soome 
479*f334afcfSToomas Soome   @param  Buffer  The pointer to the output buffer for the produced Null-terminated
480*f334afcfSToomas Soome                   ASCII string.
481*f334afcfSToomas Soome   @param  Flags   The bitmask of flags that specify left justification, zero pad, and commas.
482*f334afcfSToomas Soome   @param  Value   The 64-bit signed value to convert to a string.
483*f334afcfSToomas Soome   @param  Width   The maximum number of ASCII characters to place in Buffer, not including
484*f334afcfSToomas Soome                   the Null-terminator.
485*f334afcfSToomas Soome 
486*f334afcfSToomas Soome   @return The number of ASCII characters in Buffer not including the Null-terminator.
487*f334afcfSToomas Soome 
488*f334afcfSToomas Soome **/
489*f334afcfSToomas Soome typedef
490*f334afcfSToomas Soome UINTN
491*f334afcfSToomas Soome (EFIAPI *ASCII_VALUE_TO_STRING)(
492*f334afcfSToomas Soome   OUT CHAR8      *Buffer,
493*f334afcfSToomas Soome   IN  UINTN      Flags,
494*f334afcfSToomas Soome   IN  INT64      Value,
495*f334afcfSToomas Soome   IN  UINTN      Width
496*f334afcfSToomas Soome   );
497*f334afcfSToomas Soome 
498*f334afcfSToomas Soome struct _EFI_PRINT2_PROTOCOL {
499*f334afcfSToomas Soome   UNICODE_BS_PRINT                 UnicodeBSPrint;
500*f334afcfSToomas Soome   UNICODE_S_PRINT                  UnicodeSPrint;
501*f334afcfSToomas Soome   UNICODE_BS_PRINT_ASCII_FORMAT    UnicodeBSPrintAsciiFormat;
502*f334afcfSToomas Soome   UNICODE_S_PRINT_ASCII_FORMAT     UnicodeSPrintAsciiFormat;
503*f334afcfSToomas Soome   UNICODE_VALUE_TO_STRING          UnicodeValueToString;
504*f334afcfSToomas Soome   ASCII_BS_PRINT                   AsciiBSPrint;
505*f334afcfSToomas Soome   ASCII_S_PRINT                    AsciiSPrint;
506*f334afcfSToomas Soome   ASCII_BS_PRINT_UNICODE_FORMAT    AsciiBSPrintUnicodeFormat;
507*f334afcfSToomas Soome   ASCII_S_PRINT_UNICODE_FORMAT     AsciiSPrintUnicodeFormat;
508*f334afcfSToomas Soome   ASCII_VALUE_TO_STRING            AsciiValueToString;
509*f334afcfSToomas Soome };
510*f334afcfSToomas Soome 
511*f334afcfSToomas Soome extern EFI_GUID  gEfiPrint2ProtocolGuid;
512*f334afcfSToomas Soome 
513*f334afcfSToomas Soome #define EFI_PRINT2S_PROTOCOL_GUID  \
514*f334afcfSToomas Soome   { 0xcc252d2, 0xc106, 0x4661, { 0xb5, 0xbd, 0x31, 0x47, 0xa4, 0xf8, 0x1f, 0x92 } }
515*f334afcfSToomas Soome 
516*f334afcfSToomas Soome //
517*f334afcfSToomas Soome // Forward reference for pure ANSI compatability
518*f334afcfSToomas Soome //
519*f334afcfSToomas Soome typedef struct _EFI_PRINT2S_PROTOCOL EFI_PRINT2S_PROTOCOL;
520*f334afcfSToomas Soome 
521*f334afcfSToomas Soome /**
522*f334afcfSToomas Soome   Converts a decimal value to a Null-terminated Unicode string.
523*f334afcfSToomas Soome 
524*f334afcfSToomas Soome   Converts the decimal number specified by Value to a Null-terminated Unicode
525*f334afcfSToomas Soome   string specified by Buffer containing at most Width characters. No padding of
526*f334afcfSToomas Soome   spaces is ever performed. If Width is 0 then a width of
527*f334afcfSToomas Soome   MAXIMUM_VALUE_CHARACTERS is assumed. If the conversion contains more than
528*f334afcfSToomas Soome   Width characters, then only the first Width characters are placed in Buffer.
529*f334afcfSToomas Soome   Additional conversion parameters are specified in Flags.
530*f334afcfSToomas Soome 
531*f334afcfSToomas Soome   The Flags bit LEFT_JUSTIFY is always ignored.
532*f334afcfSToomas Soome   All conversions are left justified in Buffer.
533*f334afcfSToomas Soome   If Width is 0, PREFIX_ZERO is ignored in Flags.
534*f334afcfSToomas Soome   If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and
535*f334afcfSToomas Soome   commas are inserted every 3rd digit starting from the right.
536*f334afcfSToomas Soome   If RADIX_HEX is set in Flags, then the output buffer will be formatted in
537*f334afcfSToomas Soome   hexadecimal format.
538*f334afcfSToomas Soome   If Value is < 0 and RADIX_HEX is not set in Flags, then the fist character in
539*f334afcfSToomas Soome   Buffer is a '-'.
540*f334afcfSToomas Soome   If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored, then
541*f334afcfSToomas Soome   Buffer is padded with '0' characters so the combination of the optional '-'
542*f334afcfSToomas Soome   sign character, '0' characters, digit characters for Value, and the
543*f334afcfSToomas Soome   Null-terminator add up to Width characters.
544*f334afcfSToomas Soome 
545*f334afcfSToomas Soome   If Buffer is not aligned on a 16-bit boundary, then ASSERT().
546*f334afcfSToomas Soome   If an error would be returned, then the function will also ASSERT().
547*f334afcfSToomas Soome 
548*f334afcfSToomas Soome   @param  Buffer      The pointer to the output buffer for the produced
549*f334afcfSToomas Soome                       Null-terminated Unicode string.
550*f334afcfSToomas Soome   @param  BufferSize  The size of Buffer in bytes, including the
551*f334afcfSToomas Soome                       Null-terminator.
552*f334afcfSToomas Soome   @param  Flags       The bitmask of flags that specify left justification,
553*f334afcfSToomas Soome                       zero pad, and commas.
554*f334afcfSToomas Soome   @param  Value       The 64-bit signed value to convert to a string.
555*f334afcfSToomas Soome   @param  Width       The maximum number of Unicode characters to place in
556*f334afcfSToomas Soome                       Buffer, not including the Null-terminator.
557*f334afcfSToomas Soome 
558*f334afcfSToomas Soome   @retval RETURN_SUCCESS           The decimal value is converted.
559*f334afcfSToomas Soome   @retval RETURN_BUFFER_TOO_SMALL  If BufferSize cannot hold the converted
560*f334afcfSToomas Soome                                    value.
561*f334afcfSToomas Soome   @retval RETURN_INVALID_PARAMETER If Buffer is NULL.
562*f334afcfSToomas Soome                                    If PcdMaximumUnicodeStringLength is not
563*f334afcfSToomas Soome                                    zero, and BufferSize is greater than
564*f334afcfSToomas Soome                                    (PcdMaximumUnicodeStringLength *
565*f334afcfSToomas Soome                                    sizeof (CHAR16) + 1).
566*f334afcfSToomas Soome                                    If unsupported bits are set in Flags.
567*f334afcfSToomas Soome                                    If both COMMA_TYPE and RADIX_HEX are set in
568*f334afcfSToomas Soome                                    Flags.
569*f334afcfSToomas Soome                                    If Width >= MAXIMUM_VALUE_CHARACTERS.
570*f334afcfSToomas Soome 
571*f334afcfSToomas Soome **/
572*f334afcfSToomas Soome typedef
573*f334afcfSToomas Soome RETURN_STATUS
574*f334afcfSToomas Soome (EFIAPI *UNICODE_VALUE_TO_STRING_S)(
575*f334afcfSToomas Soome   IN OUT CHAR16  *Buffer,
576*f334afcfSToomas Soome   IN UINTN       BufferSize,
577*f334afcfSToomas Soome   IN UINTN       Flags,
578*f334afcfSToomas Soome   IN INT64       Value,
579*f334afcfSToomas Soome   IN UINTN       Width
580*f334afcfSToomas Soome   );
581*f334afcfSToomas Soome 
582*f334afcfSToomas Soome /**
583*f334afcfSToomas Soome   Converts a decimal value to a Null-terminated Ascii string.
584*f334afcfSToomas Soome 
585*f334afcfSToomas Soome   Converts the decimal number specified by Value to a Null-terminated Ascii
586*f334afcfSToomas Soome   string specified by Buffer containing at most Width characters. No padding of
587*f334afcfSToomas Soome   spaces is ever performed. If Width is 0 then a width of
588*f334afcfSToomas Soome   MAXIMUM_VALUE_CHARACTERS is assumed. If the conversion contains more than
589*f334afcfSToomas Soome   Width characters, then only the first Width characters are placed in Buffer.
590*f334afcfSToomas Soome   Additional conversion parameters are specified in Flags.
591*f334afcfSToomas Soome 
592*f334afcfSToomas Soome   The Flags bit LEFT_JUSTIFY is always ignored.
593*f334afcfSToomas Soome   All conversions are left justified in Buffer.
594*f334afcfSToomas Soome   If Width is 0, PREFIX_ZERO is ignored in Flags.
595*f334afcfSToomas Soome   If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and
596*f334afcfSToomas Soome   commas are inserted every 3rd digit starting from the right.
597*f334afcfSToomas Soome   If RADIX_HEX is set in Flags, then the output buffer will be formatted in
598*f334afcfSToomas Soome   hexadecimal format.
599*f334afcfSToomas Soome   If Value is < 0 and RADIX_HEX is not set in Flags, then the fist character in
600*f334afcfSToomas Soome   Buffer is a '-'.
601*f334afcfSToomas Soome   If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored, then
602*f334afcfSToomas Soome   Buffer is padded with '0' characters so the combination of the optional '-'
603*f334afcfSToomas Soome   sign character, '0' characters, digit characters for Value, and the
604*f334afcfSToomas Soome   Null-terminator add up to Width characters.
605*f334afcfSToomas Soome 
606*f334afcfSToomas Soome   If an error would be returned, then the function will ASSERT().
607*f334afcfSToomas Soome 
608*f334afcfSToomas Soome   @param  Buffer      The pointer to the output buffer for the produced
609*f334afcfSToomas Soome                       Null-terminated Ascii string.
610*f334afcfSToomas Soome   @param  BufferSize  The size of Buffer in bytes, including the
611*f334afcfSToomas Soome                       Null-terminator.
612*f334afcfSToomas Soome   @param  Flags       The bitmask of flags that specify left justification,
613*f334afcfSToomas Soome                       zero pad, and commas.
614*f334afcfSToomas Soome   @param  Value       The 64-bit signed value to convert to a string.
615*f334afcfSToomas Soome   @param  Width       The maximum number of Ascii characters to place in
616*f334afcfSToomas Soome                       Buffer, not including the Null-terminator.
617*f334afcfSToomas Soome 
618*f334afcfSToomas Soome   @retval RETURN_SUCCESS           The decimal value is converted.
619*f334afcfSToomas Soome   @retval RETURN_BUFFER_TOO_SMALL  If BufferSize cannot hold the converted
620*f334afcfSToomas Soome                                    value.
621*f334afcfSToomas Soome   @retval RETURN_INVALID_PARAMETER If Buffer is NULL.
622*f334afcfSToomas Soome                                    If PcdMaximumAsciiStringLength is not
623*f334afcfSToomas Soome                                    zero, and BufferSize is greater than
624*f334afcfSToomas Soome                                    PcdMaximumAsciiStringLength.
625*f334afcfSToomas Soome                                    If unsupported bits are set in Flags.
626*f334afcfSToomas Soome                                    If both COMMA_TYPE and RADIX_HEX are set in
627*f334afcfSToomas Soome                                    Flags.
628*f334afcfSToomas Soome                                    If Width >= MAXIMUM_VALUE_CHARACTERS.
629*f334afcfSToomas Soome 
630*f334afcfSToomas Soome **/
631*f334afcfSToomas Soome typedef
632*f334afcfSToomas Soome RETURN_STATUS
633*f334afcfSToomas Soome (EFIAPI *ASCII_VALUE_TO_STRING_S)(
634*f334afcfSToomas Soome   IN OUT CHAR8   *Buffer,
635*f334afcfSToomas Soome   IN  UINTN      BufferSize,
636*f334afcfSToomas Soome   IN  UINTN      Flags,
637*f334afcfSToomas Soome   IN  INT64      Value,
638*f334afcfSToomas Soome   IN  UINTN      Width
639*f334afcfSToomas Soome   );
640*f334afcfSToomas Soome 
641*f334afcfSToomas Soome struct _EFI_PRINT2S_PROTOCOL {
642*f334afcfSToomas Soome   UNICODE_BS_PRINT                 UnicodeBSPrint;
643*f334afcfSToomas Soome   UNICODE_S_PRINT                  UnicodeSPrint;
644*f334afcfSToomas Soome   UNICODE_BS_PRINT_ASCII_FORMAT    UnicodeBSPrintAsciiFormat;
645*f334afcfSToomas Soome   UNICODE_S_PRINT_ASCII_FORMAT     UnicodeSPrintAsciiFormat;
646*f334afcfSToomas Soome   UNICODE_VALUE_TO_STRING_S        UnicodeValueToStringS;
647*f334afcfSToomas Soome   ASCII_BS_PRINT                   AsciiBSPrint;
648*f334afcfSToomas Soome   ASCII_S_PRINT                    AsciiSPrint;
649*f334afcfSToomas Soome   ASCII_BS_PRINT_UNICODE_FORMAT    AsciiBSPrintUnicodeFormat;
650*f334afcfSToomas Soome   ASCII_S_PRINT_UNICODE_FORMAT     AsciiSPrintUnicodeFormat;
651*f334afcfSToomas Soome   ASCII_VALUE_TO_STRING_S          AsciiValueToStringS;
652*f334afcfSToomas Soome };
653*f334afcfSToomas Soome 
654*f334afcfSToomas Soome extern EFI_GUID  gEfiPrint2SProtocolGuid;
655*f334afcfSToomas Soome 
656*f334afcfSToomas Soome #endif
657