OpenCore
1.0.4
OpenCore Bootloader
|
#include "HiiDatabase.h"
Go to the source code of this file.
Functions | |
BOOLEAN | ReferFontInfoLocally (IN HII_DATABASE_PRIVATE_DATA *Private, IN HII_STRING_PACKAGE_INSTANCE *StringPackage, IN UINT8 FontId, IN BOOLEAN DuplicateEnable, IN HII_GLOBAL_FONT_INFO *GlobalFontInfo, OUT HII_FONT_INFO **LocalFontInfo) |
EFI_STATUS | ConvertToUnicodeText (OUT EFI_STRING StringDest, IN CHAR8 *StringSrc, IN OUT UINTN *BufferSize) |
EFI_STATUS | GetUnicodeStringTextOrSize (OUT EFI_STRING StringDest, OPTIONAL IN UINT8 *StringSrc, IN OUT UINTN *BufferSize) |
EFI_STATUS | GetStringFontInfo (IN HII_STRING_PACKAGE_INSTANCE *StringPackage, IN UINT8 FontId, OUT EFI_FONT_INFO **StringFontInfo) |
EFI_STATUS | FindStringBlock (IN HII_DATABASE_PRIVATE_DATA *Private, IN HII_STRING_PACKAGE_INSTANCE *StringPackage, IN EFI_STRING_ID StringId, OUT UINT8 *BlockType, OPTIONAL OUT UINT8 **StringBlockAddr, OPTIONAL OUT UINTN *StringTextOffset, OPTIONAL OUT EFI_STRING_ID *LastStringId, OPTIONAL OUT EFI_STRING_ID *StartStringId OPTIONAL) |
EFI_STATUS | GetStringWorker (IN HII_DATABASE_PRIVATE_DATA *Private, IN HII_STRING_PACKAGE_INSTANCE *StringPackage, IN EFI_STRING_ID StringId, OUT EFI_STRING String, IN OUT UINTN *StringSize, OPTIONAL OUT EFI_FONT_INFO **StringFontInfo OPTIONAL) |
EFI_STATUS | InsertLackStringBlock (IN OUT HII_STRING_PACKAGE_INSTANCE *StringPackage, IN EFI_STRING_ID StartStringId, IN EFI_STRING_ID StringId, IN OUT UINT8 *BlockType, IN OUT UINT8 **StringBlockAddr, IN BOOLEAN FontBlock) |
EFI_STATUS | SetStringWorker (IN HII_DATABASE_PRIVATE_DATA *Private, IN OUT HII_STRING_PACKAGE_INSTANCE *StringPackage, IN EFI_STRING_ID StringId, IN EFI_STRING String, IN EFI_FONT_INFO *StringFontInfo OPTIONAL) |
EFI_STATUS EFIAPI | HiiNewString (IN CONST EFI_HII_STRING_PROTOCOL *This, IN EFI_HII_HANDLE PackageList, OUT EFI_STRING_ID *StringId, IN CONST CHAR8 *Language, IN CONST CHAR16 *LanguageName, OPTIONAL IN CONST EFI_STRING String, IN CONST EFI_FONT_INFO *StringFontInfo OPTIONAL) |
EFI_STATUS EFIAPI | InternalHiiGetString (IN CONST EFI_HII_STRING_PROTOCOL *This, IN CONST CHAR8 *Language, IN EFI_HII_HANDLE PackageList, IN EFI_STRING_ID StringId, OUT EFI_STRING String, IN OUT UINTN *StringSize, OUT EFI_FONT_INFO **StringFontInfo OPTIONAL) |
EFI_STATUS EFIAPI | InternalHiiSetString (IN CONST EFI_HII_STRING_PROTOCOL *This, IN EFI_HII_HANDLE PackageList, IN EFI_STRING_ID StringId, IN CONST CHAR8 *Language, IN CONST EFI_STRING String, IN CONST EFI_FONT_INFO *StringFontInfo OPTIONAL) |
EFI_STATUS EFIAPI | HiiGetLanguages (IN CONST EFI_HII_STRING_PROTOCOL *This, IN EFI_HII_HANDLE PackageList, IN OUT CHAR8 *Languages, IN OUT UINTN *LanguagesSize) |
EFI_STATUS EFIAPI | HiiGetSecondaryLanguages (IN CONST EFI_HII_STRING_PROTOCOL *This, IN EFI_HII_HANDLE PackageList, IN CONST CHAR8 *PrimaryLanguage, IN OUT CHAR8 *SecondaryLanguages, IN OUT UINTN *SecondaryLanguagesSize) |
VOID EFIAPI | AsciiHiiToLower (IN CHAR8 *ConfigString) |
BOOLEAN | HiiCompareLanguage (IN CHAR8 *Language1, IN CHAR8 *Language2) |
Variables | |
CHAR16 | mLanguageWindow [16] |
Implementation for EFI_HII_STRING_PROTOCOL.
Copyright (c) 2007 - 2020, Intel Corporation. All rights reserved.
(C) Copyright 2016 Hewlett Packard Enterprise Development LP
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file String.c.
VOID EFIAPI AsciiHiiToLower | ( | IN CHAR8 * | ConfigString | ) |
EFI_STATUS ConvertToUnicodeText | ( | OUT EFI_STRING | StringDest, |
IN CHAR8 * | StringSrc, | ||
IN OUT UINTN * | BufferSize ) |
Convert Ascii string text to unicode string test.
This is a internal function.
StringDest | Buffer to store the string text. If it is NULL, only the size will be returned. |
StringSrc | Points to current null-terminated string. |
BufferSize | Length of the buffer. |
EFI_SUCCESS | The string text was outputted successfully. |
EFI_BUFFER_TOO_SMALL | Buffer is insufficient to store the found string text. BufferSize is updated to the required buffer size. |
EFI_STATUS FindStringBlock | ( | IN HII_DATABASE_PRIVATE_DATA * | Private, |
IN HII_STRING_PACKAGE_INSTANCE * | StringPackage, | ||
IN EFI_STRING_ID | StringId, | ||
OUT UINT8 * | BlockType, | ||
OPTIONAL OUT UINT8 ** | StringBlockAddr, | ||
OPTIONAL OUT UINTN * | StringTextOffset, | ||
OPTIONAL OUT EFI_STRING_ID * | LastStringId, | ||
OPTIONAL OUT EFI_STRING_ID *StartStringId | OPTIONAL ) |
Parse all string blocks to find a String block specified by StringId. If StringId = (EFI_STRING_ID) (-1), find out all EFI_HII_SIBT_FONT blocks within this string package and backup its information. If LastStringId is specified, the string id of last string block will also be output. If StringId = 0, output the string id of last string block (EFI_HII_SIBT_STRING).
Private | Hii database private structure. |
StringPackage | Hii string package instance. |
StringId | The string's id, which is unique within PackageList. |
BlockType | Output the block type of found string block. |
StringBlockAddr | Output the block address of found string block. |
StringTextOffset | Offset, relative to the found block address, of the string text information. |
LastStringId | Output the last string id when StringId = 0 or StringId = -1. |
StartStringId | The first id in the skip block which StringId in the block. |
EFI_SUCCESS | The string text and font is retrieved successfully. |
EFI_NOT_FOUND | The specified text or font info can not be found out. |
EFI_OUT_OF_RESOURCES | The system is out of resources to accomplish the task. |
EFI_STATUS GetStringFontInfo | ( | IN HII_STRING_PACKAGE_INSTANCE * | StringPackage, |
IN UINT8 | FontId, | ||
OUT EFI_FONT_INFO ** | StringFontInfo ) |
Copy string font info to a buffer.
This is a internal function.
StringPackage | Hii string package instance. |
FontId | Font identifier which is unique in a string package. |
StringFontInfo | Buffer to record the output font info. It's caller's responsibility to free this buffer. |
EFI_SUCCESS | The string font is outputted successfully. |
EFI_NOT_FOUND | The specified font id does not exist. |
EFI_STATUS GetStringWorker | ( | IN HII_DATABASE_PRIVATE_DATA * | Private, |
IN HII_STRING_PACKAGE_INSTANCE * | StringPackage, | ||
IN EFI_STRING_ID | StringId, | ||
OUT EFI_STRING | String, | ||
IN OUT UINTN * | StringSize, | ||
OPTIONAL OUT EFI_FONT_INFO **StringFontInfo | OPTIONAL ) |
Parse all string blocks to get a string specified by StringId.
This is a internal function.
Private | Hii database private structure. |
StringPackage | Hii string package instance. |
StringId | The string's id, which is unique within PackageList. |
String | Points to retrieved null-terminated string. |
StringSize | On entry, points to the size of the buffer pointed to by String, in bytes. On return, points to the length of the string, in bytes. |
StringFontInfo | If not NULL, allocate a buffer to record the output font info. It's caller's responsibility to free this buffer. |
EFI_SUCCESS | The string text and font is retrieved successfully. |
EFI_NOT_FOUND | The specified text or font info can not be found out. |
EFI_BUFFER_TOO_SMALL | The buffer specified by StringSize is too small to hold the string. |
EFI_STATUS GetUnicodeStringTextOrSize | ( | OUT EFI_STRING | StringDest, |
OPTIONAL IN UINT8 * | StringSrc, | ||
IN OUT UINTN * | BufferSize ) |
Calculate the size of StringSrc and output it. If StringDest is not NULL, copy string text from src to dest.
This is a internal function.
StringDest | Buffer to store the string text. If it is NULL, only the size will be returned. |
StringSrc | Points to current null-terminated string. |
BufferSize | Length of the buffer. |
EFI_SUCCESS | The string text was outputted successfully. |
EFI_BUFFER_TOO_SMALL | Buffer is insufficient to store the found string text. BufferSize is updated to the required buffer size. |
BOOLEAN HiiCompareLanguage | ( | IN CHAR8 * | Language1, |
IN CHAR8 * | Language2 ) |
EFI_STATUS EFIAPI HiiGetLanguages | ( | IN CONST EFI_HII_STRING_PROTOCOL * | This, |
IN EFI_HII_HANDLE | PackageList, | ||
IN OUT CHAR8 * | Languages, | ||
IN OUT UINTN * | LanguagesSize ) |
This function returns the list of supported languages, in the format specified in Appendix M of UEFI 2.1 spec.
This | A pointer to the EFI_HII_STRING_PROTOCOL instance. |
PackageList | The package list to examine. |
Languages | Points to the buffer to hold the returned null-terminated ASCII string. |
LanguagesSize | On entry, points to the size of the buffer pointed to by Languages, in bytes. On return, points to the length of Languages, in bytes. |
EFI_SUCCESS | The languages were returned successfully. |
EFI_INVALID_PARAMETER | The LanguagesSize was NULL. |
EFI_INVALID_PARAMETER | The value referenced by LanguagesSize is not zero and Languages is NULL. |
EFI_BUFFER_TOO_SMALL | The LanguagesSize is too small to hold the list of supported languages. LanguageSize is updated to contain the required size. |
EFI_NOT_FOUND | Could not find string package in specified packagelist. |
EFI_STATUS EFIAPI HiiGetSecondaryLanguages | ( | IN CONST EFI_HII_STRING_PROTOCOL * | This, |
IN EFI_HII_HANDLE | PackageList, | ||
IN CONST CHAR8 * | PrimaryLanguage, | ||
IN OUT CHAR8 * | SecondaryLanguages, | ||
IN OUT UINTN * | SecondaryLanguagesSize ) |
Each string package has associated with it a single primary language and zero or more secondary languages. This routine returns the secondary languages associated with a package list.
This | A pointer to the EFI_HII_STRING_PROTOCOL instance. |
PackageList | The package list to examine. |
PrimaryLanguage | Points to the null-terminated ASCII string that specifies the primary language. Languages are specified in the format specified in Appendix M of the UEFI 2.0 specification. |
SecondaryLanguages | Points to the buffer to hold the returned null-terminated ASCII string that describes the list of secondary languages for the specified PrimaryLanguage. If there are no secondary languages, the function returns successfully, but this is set to NULL. |
SecondaryLanguagesSize | On entry, points to the size of the buffer pointed to by SecondaryLanguages, in bytes. On return, points to the length of SecondaryLanguages in bytes. |
EFI_SUCCESS | Secondary languages were correctly returned. |
EFI_INVALID_PARAMETER | PrimaryLanguage or SecondaryLanguagesSize was NULL. |
EFI_INVALID_PARAMETER | The value referenced by SecondaryLanguagesSize is not zero and SecondaryLanguages is NULL. |
EFI_BUFFER_TOO_SMALL | The buffer specified by SecondaryLanguagesSize is too small to hold the returned information. SecondaryLanguageSize is updated to hold the size of the buffer required. |
EFI_INVALID_LANGUAGE | The language specified by PrimaryLanguage is not present in the specified package list. |
EFI_NOT_FOUND | The specified PackageList is not in the Database. |
EFI_STATUS EFIAPI HiiNewString | ( | IN CONST EFI_HII_STRING_PROTOCOL * | This, |
IN EFI_HII_HANDLE | PackageList, | ||
OUT EFI_STRING_ID * | StringId, | ||
IN CONST CHAR8 * | Language, | ||
IN CONST CHAR16 * | LanguageName, | ||
OPTIONAL IN CONST EFI_STRING | String, | ||
IN CONST EFI_FONT_INFO *StringFontInfo | OPTIONAL ) |
This function adds the string String to the group of strings owned by PackageList, with the specified font information StringFontInfo and returns a new string id. The new string identifier is guaranteed to be unique within the package list. That new string identifier is reserved for all languages in the package list.
This | A pointer to the EFI_HII_STRING_PROTOCOL instance. |
PackageList | Handle of the package list where this string will be added. |
StringId | On return, contains the new strings id, which is unique within PackageList. |
Language | Points to the language for the new string. |
LanguageName | Points to the printable language name to associate with the passed in Language field.If LanguageName is not NULL and the string package header's LanguageName associated with a given Language is not zero, the LanguageName being passed in will be ignored. |
String | Points to the new null-terminated string. |
StringFontInfo | Points to the new string's font information or NULL if the string should have the default system font, size and style. |
EFI_SUCCESS | The new string was added successfully. |
EFI_NOT_FOUND | The specified PackageList could not be found in database. |
EFI_OUT_OF_RESOURCES | Could not add the string due to lack of resources. |
EFI_INVALID_PARAMETER | String is NULL or StringId is NULL or Language is NULL. |
EFI_INVALID_PARAMETER | The specified StringFontInfo does not exist in current database. |
EFI_STATUS InsertLackStringBlock | ( | IN OUT HII_STRING_PACKAGE_INSTANCE * | StringPackage, |
IN EFI_STRING_ID | StartStringId, | ||
IN EFI_STRING_ID | StringId, | ||
IN OUT UINT8 * | BlockType, | ||
IN OUT UINT8 ** | StringBlockAddr, | ||
IN BOOLEAN | FontBlock ) |
If GetStringBlock find the StringId's string is not saved in the exist string block, this function will create the UCS2 string block to save the string; also split the skip block into two or one skip block.
This is a internal function.
StringPackage | Hii string package instance. |
StartStringId | The first id in the skip block which StringId in the block. |
StringId | The string's id, which is unique within PackageList. |
BlockType | Output the block type of found string block. |
StringBlockAddr | Output the block address of found string block. |
FontBlock | whether this string block has font info. |
EFI_SUCCESS | The string font is outputted successfully. |
EFI_OUT_OF_RESOURCES | NO resource for the memory to save the new string block. |
EFI_STATUS EFIAPI InternalHiiGetString | ( | IN CONST EFI_HII_STRING_PROTOCOL * | This, |
IN CONST CHAR8 * | Language, | ||
IN EFI_HII_HANDLE | PackageList, | ||
IN EFI_STRING_ID | StringId, | ||
OUT EFI_STRING | String, | ||
IN OUT UINTN * | StringSize, | ||
OUT EFI_FONT_INFO **StringFontInfo | OPTIONAL ) |
This function retrieves the string specified by StringId which is associated with the specified PackageList in the language Language and copies it into the buffer specified by String.
This | A pointer to the EFI_HII_STRING_PROTOCOL instance. |
Language | Points to the language for the retrieved string. |
PackageList | The package list in the HII database to search for the specified string. |
StringId | The string's id, which is unique within PackageList. |
String | Points to the new null-terminated string. |
StringSize | On entry, points to the size of the buffer pointed to by String, in bytes. On return, points to the length of the string, in bytes. |
StringFontInfo | If not NULL, points to the string's font information. It's caller's responsibility to free this buffer. |
EFI_SUCCESS | The string was returned successfully. |
EFI_NOT_FOUND | The string specified by StringId is not available. |
EFI_NOT_FOUND | The string specified by StringId is available but not in the specified language. The specified PackageList is not in the database. |
EFI_INVALID_LANGUAGE | - The string specified by StringId is available but |
EFI_BUFFER_TOO_SMALL | The buffer specified by StringSize is too small to hold the string. |
EFI_INVALID_PARAMETER | The Language or StringSize was NULL. |
EFI_INVALID_PARAMETER | The value referenced by StringSize was not zero and String was NULL. |
EFI_OUT_OF_RESOURCES | There were insufficient resources to complete the request. |
EFI_STATUS EFIAPI InternalHiiSetString | ( | IN CONST EFI_HII_STRING_PROTOCOL * | This, |
IN EFI_HII_HANDLE | PackageList, | ||
IN EFI_STRING_ID | StringId, | ||
IN CONST CHAR8 * | Language, | ||
IN CONST EFI_STRING | String, | ||
IN CONST EFI_FONT_INFO *StringFontInfo | OPTIONAL ) |
This function updates the string specified by StringId in the specified PackageList to the text specified by String and, optionally, the font information specified by StringFontInfo.
This | A pointer to the EFI_HII_STRING_PROTOCOL instance. |
PackageList | The package list containing the strings. |
StringId | The string's id, which is unique within PackageList. |
Language | Points to the language for the updated string. |
String | Points to the new null-terminated string. |
StringFontInfo | Points to the string's font information or NULL if the string font information is not changed. |
EFI_SUCCESS | The string was updated successfully. |
EFI_NOT_FOUND | The string specified by StringId is not in the database. |
EFI_INVALID_PARAMETER | The String or Language was NULL. |
EFI_INVALID_PARAMETER | The specified StringFontInfo does not exist in current database. |
EFI_OUT_OF_RESOURCES | The system is out of resources to accomplish the task. |
BOOLEAN ReferFontInfoLocally | ( | IN HII_DATABASE_PRIVATE_DATA * | Private, |
IN HII_STRING_PACKAGE_INSTANCE * | StringPackage, | ||
IN UINT8 | FontId, | ||
IN BOOLEAN | DuplicateEnable, | ||
IN HII_GLOBAL_FONT_INFO * | GlobalFontInfo, | ||
OUT HII_FONT_INFO ** | LocalFontInfo ) |
This function checks whether a global font info is referred by local font info list or not. (i.e. HII_FONT_INFO is generated.) If not, create a HII_FONT_INFO to refer it locally.
This is a internal function.
Private | Hii database private structure. |
StringPackage | HII string package instance. |
FontId | Font identifer, which must be unique within the string package. |
DuplicateEnable | If true, duplicate HII_FONT_INFO which refers to the same EFI_FONT_INFO is permitted. Otherwise it is not allowed. |
GlobalFontInfo | Input a global font info which specify a EFI_FONT_INFO. |
LocalFontInfo | Output a local font info which refers to a EFI_FONT_INFO. |
TRUE | Already referred before calling this function. |
FALSE | Not referred before calling this function. |
EFI_STATUS SetStringWorker | ( | IN HII_DATABASE_PRIVATE_DATA * | Private, |
IN OUT HII_STRING_PACKAGE_INSTANCE * | StringPackage, | ||
IN EFI_STRING_ID | StringId, | ||
IN EFI_STRING | String, | ||
IN EFI_FONT_INFO *StringFontInfo | OPTIONAL ) |
Parse all string blocks to set a String specified by StringId.
This is a internal function.
Private | HII database driver private structure. |
StringPackage | HII string package instance. |
StringId | The string's id, which is unique within PackageList. |
String | Points to the new null-terminated string. |
StringFontInfo | Points to the input font info. |
EFI_SUCCESS | The string was updated successfully. |
EFI_NOT_FOUND | The string specified by StringId is not in the database. |
EFI_INVALID_PARAMETER | The String or Language was NULL. |
EFI_INVALID_PARAMETER | The specified StringFontInfo does not exist in current database. |
EFI_OUT_OF_RESOURCES | The system is out of resources to accomplish the task. |