]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Include/Protocol/Print2.h
Retire Print protocol in MdeModulePkg and update Print2 protocol to provide full...
[mirror_edk2.git] / MdeModulePkg / Include / Protocol / Print2.h
index e38a390826040941164e953e742a8f7d68ba7775..30c01dc4996e3e7967d51bb10d2dc999079c021f 100644 (file)
@@ -3,7 +3,7 @@
   This print protocol defines six basic print functions to \r
   print the format unicode and ascii string.\r
 \r
-Copyright (c) 2006 - 2008, Intel Corporation\r
+Copyright (c) 2006 - 2009, Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -61,13 +61,56 @@ typedef struct _EFI_PRINT2_PROTOCOL  EFI_PRINT2_PROTOCOL;
 **/\r
 typedef\r
 UINTN\r
-(EFIAPI *UNI_VSPRINT2)(\r
+(EFIAPI *UNICODE_VS_PRINT) (\r
   OUT CHAR16        *StartOfBuffer,\r
   IN  UINTN         BufferSize,\r
   IN  CONST CHAR16  *FormatString,\r
   IN  VA_LIST       Marker\r
   );\r
 \r
+/**\r
+  Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated \r
+  Unicode format string and variable argument list.\r
+  \r
+  Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer\r
+  and BufferSize.\r
+  The Unicode string is produced by parsing the format string specified by FormatString.\r
+  Arguments are pulled from the variable argument list based on the contents of the format string.\r
+  The number of Unicode characters in the produced output buffer is returned not including\r
+  the Null-terminator.\r
+  If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.\r
+\r
+  If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().\r
+  If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().\r
+  If BufferSize > 1 and FormatString is NULL, then ASSERT().\r
+  If BufferSize > 1 and FormatString is not aligned on a 16-bit boundary, then ASSERT().\r
+  If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than \r
+  PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then\r
+  ASSERT().\r
+  If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r
+  contains more than PcdMaximumUnicodeStringLength Unicode characters not including the\r
+  Null-terminator, then ASSERT().\r
+\r
+  @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated \r
+                          Unicode string.\r
+  @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.\r
+  @param  FormatString    Null-terminated Unicode format string.\r
+  @param  ...             Variable argument list whose contents are accessed based on the \r
+                          format string specified by FormatString.\r
+  \r
+  @return The number of Unicode characters in the produced output buffer not including the\r
+          Null-terminator.\r
+\r
+**/\r
+typedef\r
+UINTN\r
+(EFIAPI *UNICODE_S_PRINT) (\r
+  OUT CHAR16        *StartOfBuffer,\r
+  IN  UINTN         BufferSize,\r
+  IN  CONST CHAR16  *FormatString,\r
+  ...\r
+  );\r
+\r
 /**\r
   Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated\r
   ASCII format string and a VA_LIST argument list\r
@@ -103,13 +146,56 @@ UINTN
 **/\r
 typedef\r
 UINTN\r
-(EFIAPI *UNI_VSPRINT_ASCII)(\r
+(EFIAPI *UNICODE_VS_PRINT_ASCII_FORMAT) (\r
   OUT CHAR16       *StartOfBuffer,\r
   IN  UINTN        BufferSize,\r
   IN  CONST CHAR8  *FormatString,\r
   IN  VA_LIST      Marker\r
   );\r
 \r
+/**\r
+  Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated \r
+  ASCII format string and  variable argument list.\r
+  \r
+  Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer\r
+  and BufferSize.\r
+  The Unicode string is produced by parsing the format string specified by FormatString.\r
+  Arguments are pulled from the variable argument list based on the contents of the \r
+  format string.\r
+  The number of Unicode characters in the produced output buffer is returned not including\r
+  the Null-terminator.\r
+  If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.\r
+\r
+  If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().\r
+  If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().\r
+  If BufferSize > 1 and FormatString is NULL, then ASSERT().\r
+  If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than\r
+  PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then\r
+  ASSERT().\r
+  If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r
+  contains more than PcdMaximumUnicodeStringLength Unicode characters not including the\r
+  Null-terminator, then ASSERT().\r
+\r
+  @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated \r
+                          Unicode string.\r
+  @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.\r
+  @param  FormatString    Null-terminated ASCII format string.\r
+  @param  ...             Variable argument list whose contents are accessed based on the \r
+                          format string specified by FormatString.\r
+  \r
+  @return The number of Unicode characters in the produced output buffer not including the\r
+          Null-terminator.\r
+\r
+**/\r
+typedef\r
+UINTN\r
+(EFIAPI *UNICODE_S_PRINT_ASCII_FORMAT) (\r
+  OUT CHAR16       *StartOfBuffer,\r
+  IN  UINTN        BufferSize,\r
+  IN  CONST CHAR8  *FormatString,\r
+  ...\r
+  );\r
+\r
 /**\r
   Converts a decimal value to a Null-terminated Unicode string.\r
   \r
@@ -153,7 +239,7 @@ UINTN
 **/\r
 typedef\r
 UINTN\r
-(EFIAPI *VALUE_TO_UNISTRING)(\r
+(EFIAPI *UNICODE_VALUE_TO_STRING) (\r
   IN OUT CHAR16  *Buffer,\r
   IN UINTN       Flags,\r
   IN INT64       Value,\r
@@ -194,13 +280,55 @@ UINTN
 **/\r
 typedef\r
 UINTN\r
-(EFIAPI *ASCII_VSPRINT)(\r
+(EFIAPI *ASCII_VS_PRINT) (\r
   OUT CHAR8         *StartOfBuffer,\r
   IN  UINTN         BufferSize,\r
   IN  CONST CHAR8   *FormatString,\r
   IN  VA_LIST       Marker\r
   );\r
 \r
+/**\r
+  Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated\r
+  ASCII format string and  variable argument list.\r
+  \r
+  Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer\r
+  and BufferSize.\r
+  The ASCII string is produced by parsing the format string specified by FormatString.\r
+  Arguments are pulled from the variable argument list based on the contents of the \r
+  format string.\r
+  The number of ASCII characters in the produced output buffer is returned not including\r
+  the Null-terminator.\r
+  If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
+\r
+  If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().\r
+  If BufferSize > 0 and FormatString is NULL, then ASSERT().\r
+  If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than\r
+  PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then\r
+  ASSERT().\r
+  If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string\r
+  contains more than PcdMaximumAsciiStringLength ASCII characters not including the\r
+  Null-terminator, then ASSERT().\r
+\r
+  @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated \r
+                          ASCII string.\r
+  @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.\r
+  @param  FormatString    Null-terminated ASCII format string.\r
+  @param  ...             Variable argument list whose contents are accessed based on the \r
+                          format string specified by FormatString.\r
+   \r
+  @return The number of ASCII characters in the produced output buffer not including the\r
+          Null-terminator.\r
+\r
+**/\r
+typedef\r
+UINTN\r
+(EFIAPI *ASCII_S_PRINT) (\r
+  OUT CHAR8        *StartOfBuffer,\r
+  IN  UINTN        BufferSize,\r
+  IN  CONST CHAR8  *FormatString,\r
+  ...\r
+  );\r
+\r
 /**\r
   Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated\r
   Unicode format string and a VA_LIST argument list.\r
@@ -236,13 +364,56 @@ UINTN
 **/\r
 typedef\r
 UINTN\r
-(EFIAPI *ASCII_VSPRINT_UNI)(\r
+(EFIAPI *ASCII_VS_PRINT_UNICODE_FORMAT) (\r
   OUT CHAR8         *StartOfBuffer,\r
   IN  UINTN         BufferSize,\r
   IN  CONST CHAR16  *FormatString,\r
   IN  VA_LIST       Marker\r
   );\r
 \r
+/**\r
+  Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated\r
+  Unicode format string and  variable argument list.\r
+  \r
+  Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer\r
+  and BufferSize.\r
+  The ASCII string is produced by parsing the format string specified by FormatString.\r
+  Arguments are pulled from the variable argument list based on the contents of the \r
+  format string.\r
+  The number of ASCII characters in the produced output buffer is returned not including\r
+  the Null-terminator.\r
+  If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
+\r
+  If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().\r
+  If BufferSize > 0 and FormatString is NULL, then ASSERT().\r
+  If BufferSize > 0 and FormatString is not aligned on a 16-bit boundary, then ASSERT().\r
+  If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than\r
+  PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then\r
+  ASSERT().\r
+  If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string\r
+  contains more than PcdMaximumAsciiStringLength ASCII characters not including the\r
+  Null-terminator, then ASSERT().\r
+\r
+  @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated \r
+                          ASCII string.\r
+  @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.\r
+  @param  FormatString    Null-terminated Unicode format string.\r
+  @param  ...             Variable argument list whose contents are accessed based on the \r
+                          format string specified by FormatString.\r
+  \r
+  @return The number of ASCII characters in the produced output buffer not including the\r
+          Null-terminator.\r
+\r
+**/\r
+typedef\r
+UINTN\r
+(EFIAPI *ASCII_S_PRINT_UNICODE_FORMAT) (\r
+  OUT CHAR8         *StartOfBuffer,\r
+  IN  UINTN         BufferSize,\r
+  IN  CONST CHAR16  *FormatString,\r
+  ...\r
+  );\r
+\r
 /**\r
   Converts a decimal value to a Null-terminated ASCII string.\r
   \r
@@ -285,20 +456,24 @@ UINTN
 **/\r
 typedef\r
 UINTN\r
-(EFIAPI *VALUE_TO_ASCIISTRING)(\r
-  IN OUT CHAR8  *Buffer,\r
-  IN UINTN      Flags,\r
-  IN INT64      Value,\r
-  IN UINTN      Width\r
+(EFIAPI *ASCII_VALUE_TO_STRING) (\r
+  OUT CHAR8      *Buffer,\r
+  IN  UINTN      Flags,\r
+  IN  INT64      Value,\r
+  IN  UINTN      Width\r
   );\r
 \r
 struct _EFI_PRINT2_PROTOCOL {\r
-  UNI_VSPRINT2              VSPrint;\r
-  UNI_VSPRINT_ASCII         UniVSPrintAscii;\r
-  VALUE_TO_UNISTRING        UniValueToString;                         \r
-  ASCII_VSPRINT             AsciiVSPrint;          \r
-  ASCII_VSPRINT_UNI         AsciiVSPrintUni;\r
-  VALUE_TO_ASCIISTRING      AsciiValueToString;\r
+  UNICODE_VS_PRINT                 UnicodeVSPrint;\r
+  UNICODE_S_PRINT                  UnicodeSPrint;\r
+  UNICODE_VS_PRINT_ASCII_FORMAT    UnicodeVSPrintAsciiFormat;\r
+  UNICODE_S_PRINT_ASCII_FORMAT     UnicodeSPrintAsciiFormat;\r
+  UNICODE_VALUE_TO_STRING          UnicodeValueToString;\r
+  ASCII_VS_PRINT                   AsciiVSPrint;\r
+  ASCII_S_PRINT                    AsciiSPrint;\r
+  ASCII_VS_PRINT_UNICODE_FORMAT    AsciiVSPrintUnicodeFormat;\r
+  ASCII_S_PRINT_UNICODE_FORMAT     AsciiSPrintUnicodeFormat;\r
+  ASCII_VALUE_TO_STRING            AsciiValueToString;\r
 };\r
 \r
 extern EFI_GUID gEfiPrint2ProtocolGuid;\r