]> git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Compatibility/Include/Protocol/Print.h
d6ccc50d3b8044157c808e6d83c8975b0a47eaa2
[mirror_edk2.git] / EdkCompatibilityPkg / Compatibility / Include / Protocol / Print.h
1 /** @file
2
3 The lite print protocol defines only one print function to
4 print the format unicode string.
5
6 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved<BR>
7 Portions copyright (c) 2008-2009 Apple Inc. All rights reserved.<BR>
8 All rights reserved. This program and the accompanying materials
9 are licensed and made available under the terms and conditions of the BSD License
10 which accompanies this distribution. The full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php.
12
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15
16 **/
17
18 #ifndef __PPRINT_H__
19 #define __PPRINT_H__
20
21 #define EFI_PRINT_PROTOCOL_GUID \
22 { 0xdf2d868e, 0x32fc, 0x4cf0, {0x8e, 0x6b, 0xff, 0xd9, 0x5d, 0x13, 0x43, 0xd0} }
23
24 //
25 // Forward reference for pure ANSI compatability
26 //
27 typedef struct _EFI_PRINT_PROTOCOL EFI_PRINT_PROTOCOL;
28
29 /**
30 Produces a Null-terminated Unicode string in an output buffer, based on
31 a Null-terminated Unicode format string and a VA_LIST argument list.
32
33 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
34 and BufferSize.
35 The Unicode string is produced by parsing the format string specified by FormatString.
36 Arguments are pulled from the variable argument list specified by Marker based on the
37 contents of the format string.
38 The number of Unicode characters in the produced output buffer is returned, not including
39 the Null-terminator.
40 If BufferSize is 0 or 1, then no output buffer is produced, and 0 is returned.
41
42 If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
43 If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
44 If BufferSize > 1 and FormatString is NULL, then ASSERT().
45 If BufferSize > 1 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
46 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
47 PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
48 ASSERT().
49 If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
50 contains more than PcdMaximumUnicodeStringLength Unicode characters, not including the
51 Null-terminator, then ASSERT().
52
53 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
54 Unicode string.
55 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
56 @param FormatString A Null-terminated Unicode format string.
57 @param Marker VA_LIST marker for the variable argument list.
58
59 @return The number of Unicode characters in the produced output buffer not including the
60 Null-terminator.
61
62 **/
63 typedef
64 UINTN
65 (EFIAPI *UNI_VSPRINT)(
66 OUT CHAR16 *StartOfBuffer,
67 IN UINTN BufferSize,
68 IN CONST CHAR16 *FormatString,
69 IN VA_LIST Marker
70 );
71
72 /**
73 EFI_PRINT_PROTOCOL provides one service to produce a Null-terminated Unicode string,
74 based on a Null-terminated Unicode format string and a VA_LIST argument list, and fills into
75 the buffer as output.
76 **/
77 struct _EFI_PRINT_PROTOCOL {
78 UNI_VSPRINT VSPrint;
79 };
80
81 extern EFI_GUID gEfiPrintProtocolGuid;
82
83 #endif