MdePkg/Library/UefiLib/UefiLibPrint.c File Reference


Functions

UINTN InternalPrint (IN CONST CHAR16 *Format, IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *Console, IN VA_LIST Marker)
UINTN EFIAPI Print (IN CONST CHAR16 *Format,...)
UINTN EFIAPI ErrorPrint (IN CONST CHAR16 *Format,...)
UINTN AsciiInternalPrint (IN CONST CHAR8 *Format, IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *Console, IN VA_LIST Marker)
UINTN EFIAPI AsciiPrint (IN CONST CHAR8 *Format,...)
UINTN EFIAPI AsciiErrorPrint (IN CONST CHAR8 *Format,...)
UINTN InternalPrintGraphic (IN UINTN PointX, IN UINTN PointY, IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Foreground, IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Background, IN CHAR16 *Buffer, IN UINTN PrintNum)
UINTN EFIAPI PrintXY (IN UINTN PointX, IN UINTN PointY, IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *ForeGround, IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BackGround, IN CONST CHAR16 *Format,...)
UINTN EFIAPI AsciiPrintXY (IN UINTN PointX, IN UINTN PointY, IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *ForeGround, IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BackGround, IN CONST CHAR8 *Format,...)
CHAR16 *EFIAPI CatVSPrint (IN CHAR16 *String, IN CONST CHAR16 *FormatString, IN VA_LIST Marker)
CHAR16 *EFIAPI CatSPrint (IN CHAR16 *String, IN CONST CHAR16 *FormatString,...)

Variables

GLOBAL_REMOVE_IF_UNREFERENCED
EFI_GRAPHICS_OUTPUT_BLT_PIXEL 
mEfiColors [16]

Detailed Description

Mde UEFI library API implementation. Print to StdErr or ConOut defined in EFI_SYSTEM_TABLE

Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php.

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.


Function Documentation

UINTN EFIAPI AsciiErrorPrint ( IN CONST CHAR8 Format,
  ... 
)

Prints a formatted ASCII string to the console output device specified by StdErr defined in the EFI_SYSTEM_TABLE.

This function prints a formatted ASCII string to the console output device specified by StdErr in EFI_SYSTEM_TABLE and returns the number of ASCII characters that printed to StdErr. If the length of the formatted ASCII string is greater than PcdUefiLibMaxPrintBufferSize, then only the first PcdUefiLibMaxPrintBufferSize characters are sent to StdErr. If Format is NULL, then ASSERT(). If gST->StdErr is NULL, then ASSERT().

Parameters:
Format A Null-terminated ASCII format string.
... Variable argument list whose contents are accessed based on the format string specified by Format.
Returns:
The number of ASCII characters printed to ConErr.

References AsciiInternalPrint(), ASSERT, gST, NULL, EFI_SYSTEM_TABLE::StdErr, VA_END, and VA_START.

UINTN AsciiInternalPrint ( IN CONST CHAR8 Format,
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL Console,
IN VA_LIST  Marker 
)

Internal function which prints a formatted ASCII string to the console output device specified by Console

This function prints a formatted ASCII string to the console output device specified by Console and returns the number of ASCII characters that printed to it. If the length of the formatted ASCII string is greater than PcdUefiLibMaxPrintBufferSize, then only the first PcdUefiLibMaxPrintBufferSize characters are sent to Console.

If Format is NULL, then ASSERT().

Parameters:
Format A Null-terminated ASCII format string.
Console The output console.
Marker VA_LIST marker for the variable argument list.
Returns:
The number of Unicode characters in the produced output buffer not including the Null-terminator.

References AllocatePool(), ASSERT, EFI_ERROR, FreePool(), NULL, PcdGet32, and UnicodeVSPrintAsciiFormat().

Referenced by AsciiErrorPrint(), and AsciiPrint().

UINTN EFIAPI AsciiPrint ( IN CONST CHAR8 Format,
  ... 
)

Prints a formatted ASCII string to the console output device specified by ConOut defined in the EFI_SYSTEM_TABLE.

This function prints a formatted ASCII string to the console output device specified by ConOut in EFI_SYSTEM_TABLE and returns the number of ASCII characters that printed to ConOut. If the length of the formatted ASCII string is greater than PcdUefiLibMaxPrintBufferSize, then only the first PcdUefiLibMaxPrintBufferSize characters are sent to ConOut. If Format is NULL, then ASSERT(). If gST->ConOut is NULL, then ASSERT().

Parameters:
Format A Null-terminated ASCII format string.
... Variable argument list whose contents are accessed based on the format string specified by Format.
Returns:
The number of ASCII characters printed to ConOut.

References AsciiInternalPrint(), ASSERT, EFI_SYSTEM_TABLE::ConOut, gST, NULL, VA_END, and VA_START.

UINTN EFIAPI AsciiPrintXY ( IN UINTN  PointX,
IN UINTN  PointY,
IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL ForeGround,
IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL BackGround,
IN CONST CHAR8 Format,
  ... 
)

Prints a formatted ASCII string to a graphics console device specified by ConsoleOutputHandle defined in the EFI_SYSTEM_TABLE at the given (X,Y) coordinates.

This function prints a formatted ASCII string to the graphics console device specified by ConsoleOutputHandle in EFI_SYSTEM_TABLE and returns the number of ASCII characters displayed, not including partial characters that may be clipped by the right edge of the display. If the length of the formatted ASCII string is greater than PcdUefiLibMaxPrintBufferSize, then at most the first PcdUefiLibMaxPrintBufferSize characters are printed.The EFI_HII_FONT_PROTOCOL StringToImage() service is used to convert the string to a bitmap using the glyphs registered with the HII database. No wrapping is performed, so any portions of the string the fall outside the active display region will not be displayed. Please see Section 27.2.6 of the UEFI Specification for a description of the supported string format including the set of control codes supported by the StringToImage() service.

If a graphics console device is not associated with the ConsoleOutputHandle defined in the EFI_SYSTEM_TABLE then no string is printed, and 0 is returned. If the EFI_HII_FONT_PROTOCOL is not present in the handle database, then no string is printed, and 0 is returned. If Format is NULL, then ASSERT(). If gST->ConsoleOutputHandle is NULL, then ASSERT().

Parameters:
PointX An X coordinate to print the string.
PointY A Y coordinate to print the string.
ForeGround The foreground color of the string being printed. This is an optional parameter that may be NULL. If it is NULL, then the foreground color of the current ConOut device in the EFI_SYSTEM_TABLE is used.
BackGround The background color of the string being printed. This is an optional parameter that may be NULL. If it is NULL, then the background color of the current ConOut device in the EFI_SYSTEM_TABLE is used.
Format A Null-terminated ASCII format string. See Print Library for the supported format string syntax.
... Variable argument list whose contents are accessed based on the format string specified by Format.
Returns:
The number of ASCII characters printed.

References AllocatePool(), ASSERT, FreePool(), InternalPrintGraphic(), NULL, PcdGet32, UnicodeSPrintAsciiFormat(), VA_END, and VA_START.

CHAR16* EFIAPI CatSPrint ( IN CHAR16 String,
IN CONST CHAR16 FormatString,
  ... 
)

Appends a formatted Unicode string to a Null-terminated Unicode string

This function appends a formatted Unicode string to the Null-terminated Unicode string specified by String. String is optional and may be NULL. Storage for the formatted Unicode string returned is allocated using AllocatePool(). The pointer to the appended string is returned. The caller is responsible for freeing the returned string.

If String is not NULL and not aligned on a 16-bit boundary, then ASSERT(). If FormatString is NULL, then ASSERT(). If FormatString is not aligned on a 16-bit boundary, then ASSERT().

Parameters:
[in] String A Null-terminated Unicode string.
[in] FormatString A Null-terminated Unicode format string.
[in] ... The variable argument list whose contents are accessed based on the format string specified by FormatString.
Return values:
NULL There was not enough available memory.
Returns:
Null-terminated Unicode string is that is the formatted string appended to String.

References CatVSPrint(), VA_END, and VA_START.

CHAR16* EFIAPI CatVSPrint ( IN CHAR16 String,
IN CONST CHAR16 FormatString,
IN VA_LIST  Marker 
)

Appends a formatted Unicode string to a Null-terminated Unicode string

This function appends a formatted Unicode string to the Null-terminated Unicode string specified by String. String is optional and may be NULL. Storage for the formatted Unicode string returned is allocated using AllocatePool(). The pointer to the appended string is returned. The caller is responsible for freeing the returned string.

If String is not NULL and not aligned on a 16-bit boundary, then ASSERT(). If FormatString is NULL, then ASSERT(). If FormatString is not aligned on a 16-bit boundary, then ASSERT().

Parameters:
[in] String A Null-terminated Unicode string.
[in] FormatString A Null-terminated Unicode format string.
[in] Marker VA_LIST marker for the variable argument list.
Return values:
NULL There was not enough available memory.
Returns:
Null-terminated Unicode string is that is the formatted string appended to String.

References AllocatePool(), ASSERT, NULL, SPrintLength(), StrCpyS(), StrLen(), StrSize(), UnicodeVSPrint(), VA_COPY, and VA_END.

Referenced by CatSPrint().

UINTN EFIAPI ErrorPrint ( IN CONST CHAR16 Format,
  ... 
)

Prints a formatted Unicode string to the console output device specified by StdErr defined in the EFI_SYSTEM_TABLE.

This function prints a formatted Unicode string to the console output device specified by StdErr in EFI_SYSTEM_TABLE and returns the number of Unicode characters that printed to StdErr. If the length of the formatted Unicode string is greater than PcdUefiLibMaxPrintBufferSize, then only the first PcdUefiLibMaxPrintBufferSize characters are sent to StdErr. If Format is NULL, then ASSERT(). If Format is not aligned on a 16-bit boundary, then ASSERT(). If gST->StdErr is NULL, then ASSERT().

Parameters:
Format A Null-terminated Unicode format string.
... Variable argument list whose contents are accessed based on the format string specified by Format.
Returns:
The number of Unicode characters printed to StdErr.

References gST, InternalPrint(), EFI_SYSTEM_TABLE::StdErr, VA_END, and VA_START.

UINTN InternalPrint ( IN CONST CHAR16 Format,
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL Console,
IN VA_LIST  Marker 
)

Internal function which prints a formatted Unicode string to the console output device specified by Console

This function prints a formatted Unicode string to the console output device specified by Console and returns the number of Unicode characters that printed to it. If the length of the formatted Unicode string is greater than PcdUefiLibMaxPrintBufferSize, then only the first PcdUefiLibMaxPrintBufferSize characters are sent to Console. If Format is NULL, then ASSERT(). If Format is not aligned on a 16-bit boundary, then ASSERT().

Parameters:
Format A Null-terminated Unicode format string.
Console The output console.
Marker A VA_LIST marker for the variable argument list.
Returns:
The number of Unicode characters in the produced output buffer, not including the Null-terminator.

References AllocatePool(), ASSERT, BIT0, EFI_ERROR, FreePool(), NULL, PcdGet32, and UnicodeVSPrint().

Referenced by ErrorPrint(), and Print().

UINTN InternalPrintGraphic ( IN UINTN  PointX,
IN UINTN  PointY,
IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL Foreground,
IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL Background,
IN CHAR16 Buffer,
IN UINTN  PrintNum 
)

Internal function to print a formatted Unicode string to a graphics console device specified by ConsoleOutputHandle defined in the EFI_SYSTEM_TABLE at the given (X,Y) coordinates.

This function prints a formatted Unicode string to the graphics console device specified by ConsoleOutputHandle in EFI_SYSTEM_TABLE and returns the number of Unicode characters printed. The EFI_HII_FONT_PROTOCOL is used to convert the string to a bitmap using the glyphs registered with the HII database. No wrapping is performed, so any portions of the string the fall outside the active display region will not be displayed.

If a graphics console device is not associated with the ConsoleOutputHandle defined in the EFI_SYSTEM_TABLE then no string is printed, and 0 is returned. If the EFI_HII_FONT_PROTOCOL is not present in the handle database, then no string is printed, and 0 is returned.

Parameters:
PointX An X coordinate to print the string.
PointY A Y coordinate to print the string.
Foreground The foreground color of the string being printed. This is an optional parameter that may be NULL. If it is NULL, then the foreground color of the current ConOut device in the EFI_SYSTEM_TABLE is used.
Background The background color of the string being printed. This is an optional parameter that may be NULL. If it is NULL, then the background color of the current ConOut device in the EFI_SYSTEM_TABLE is used.
Buffer A Null-terminated Unicode formatted string.
PrintNum The number of Unicode formatted string to be printed.
Returns:
The number of Unicode Characters printed. Zero means no any character displayed successfully.

References AllocateZeroPool(), ASSERT, _EFI_FONT_DISPLAY_INFO::BackgroundColor, _EFI_IMAGE_OUTPUT::Bitmap, _EFI_UGA_DRAW_PROTOCOL::Blt, EFI_SYSTEM_TABLE::ConsoleOutHandle, CopyMem(), EFI_ERROR, EFI_HII_DIRECT_TO_SCREEN, EFI_HII_IGNORE_IF_NO_GLYPH, EFI_HII_IGNORE_LINE_BREAK, EFI_HII_OUT_FLAG_CLIP, EFI_HII_OUT_FLAG_CLIP_CLEAN_X, EFI_HII_OUT_FLAG_CLIP_CLEAN_Y, EfiUgaBltBufferToVideo, _EFI_HII_ROW_INFO::EndIndex, FeaturePcdGet, _EFI_FONT_DISPLAY_INFO::ForegroundColor, FreePool(), gBS, gEfiGraphicsOutputProtocolGuid, gEfiHiiFontProtocolGuid, gEfiSimpleTextOutProtocolGuid, gEfiUgaDrawProtocolGuid, _EFI_UGA_DRAW_PROTOCOL::GetMode, gST, EFI_BOOT_SERVICES::HandleProtocol, _EFI_IMAGE_OUTPUT::Height, _EFI_IMAGE_OUTPUT::Image, _EFI_HII_ROW_INFO::LineHeight, _EFI_HII_ROW_INFO::LineWidth, EFI_BOOT_SERVICES::LocateProtocol, mEfiColors, NULL, _EFI_IMAGE_OUTPUT::Screen, _EFI_HII_ROW_INFO::StartIndex, VOID, _EFI_IMAGE_OUTPUT::Width, and ZeroMem().

Referenced by AsciiPrintXY(), and PrintXY().

UINTN EFIAPI Print ( IN CONST CHAR16 Format,
  ... 
)

Prints a formatted Unicode string to the console output device specified by ConOut defined in the EFI_SYSTEM_TABLE.

This function prints a formatted Unicode string to the console output device specified by ConOut in EFI_SYSTEM_TABLE and returns the number of Unicode characters that printed to ConOut. If the length of the formatted Unicode string is greater than PcdUefiLibMaxPrintBufferSize, then only the first PcdUefiLibMaxPrintBufferSize characters are sent to ConOut. If Format is NULL, then ASSERT(). If Format is not aligned on a 16-bit boundary, then ASSERT(). If gST->ConOut is NULL, then ASSERT().

Parameters:
Format A Null-terminated Unicode format string.
... A Variable argument list whose contents are accessed based on the format string specified by Format.
Returns:
The number of Unicode characters printed to ConOut.

References EFI_SYSTEM_TABLE::ConOut, gST, InternalPrint(), VA_END, and VA_START.

UINTN EFIAPI PrintXY ( IN UINTN  PointX,
IN UINTN  PointY,
IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL ForeGround,
IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL BackGround,
IN CONST CHAR16 Format,
  ... 
)

Prints a formatted Unicode string to a graphics console device specified by ConsoleOutputHandle defined in the EFI_SYSTEM_TABLE at the given (X,Y) coordinates.

This function prints a formatted Unicode string to the graphics console device specified by ConsoleOutputHandle in EFI_SYSTEM_TABLE and returns the number of Unicode characters displayed, not including partial characters that may be clipped by the right edge of the display. If the length of the formatted Unicode string is greater than PcdUefiLibMaxPrintBufferSize, then at most the first PcdUefiLibMaxPrintBufferSize characters are printed.The EFI_HII_FONT_PROTOCOL StringToImage() service is used to convert the string to a bitmap using the glyphs registered with the HII database. No wrapping is performed, so any portions of the string the fall outside the active display region will not be displayed. Please see Section 27.2.6 of the UEFI Specification for a description of the supported string format including the set of control codes supported by the StringToImage() service.

If a graphics console device is not associated with the ConsoleOutputHandle defined in the EFI_SYSTEM_TABLE then no string is printed, and 0 is returned. If the EFI_HII_FONT_PROTOCOL is not present in the handle database, then no string is printed, and 0 is returned. If Format is NULL, then ASSERT(). If Format is not aligned on a 16-bit boundary, then ASSERT(). If gST->ConsoleOutputHandle is NULL, then ASSERT().

Parameters:
PointX An X coordinate to print the string.
PointY A Y coordinate to print the string.
ForeGround The foreground color of the string being printed. This is an optional parameter that may be NULL. If it is NULL, then the foreground color of the current ConOut device in the EFI_SYSTEM_TABLE is used.
BackGround The background color of the string being printed. This is an optional parameter that may be NULL. If it is NULL, then the background color of the current ConOut device in the EFI_SYSTEM_TABLE is used.
Format A Null-terminated Unicode format string. See Print Library for the supported format string syntax.
... A Variable argument list whose contents are accessed based on the format string specified by Format.
Returns:
The number of Unicode characters printed.

References AllocatePool(), ASSERT, BIT0, FreePool(), InternalPrintGraphic(), NULL, PcdGet32, UnicodeVSPrint(), VA_END, and VA_START.


Variable Documentation

GLOBAL_REMOVE_IF_UNREFERENCED EFI_GRAPHICS_OUTPUT_BLT_PIXEL mEfiColors[16]

Initial value:

 {
  { 0x00, 0x00, 0x00, 0x00 },
  { 0x98, 0x00, 0x00, 0x00 },
  { 0x00, 0x98, 0x00, 0x00 },
  { 0x98, 0x98, 0x00, 0x00 },
  { 0x00, 0x00, 0x98, 0x00 },
  { 0x98, 0x00, 0x98, 0x00 },
  { 0x00, 0x98, 0x98, 0x00 },
  { 0x98, 0x98, 0x98, 0x00 },
  { 0x10, 0x10, 0x10, 0x00 },
  { 0xff, 0x10, 0x10, 0x00 },
  { 0x10, 0xff, 0x10, 0x00 },
  { 0xff, 0xff, 0x10, 0x00 },
  { 0x10, 0x10, 0xff, 0x00 },
  { 0xf0, 0x10, 0xff, 0x00 },
  { 0x10, 0xff, 0xff, 0x00 },
  { 0xff, 0xff, 0xff, 0x00 }
}

Referenced by InternalPrintGraphic().


Generated on Thu Sep 24 23:14:24 2015 for MdePkg[ALL] by  doxygen 1.5.7.1