10#define ISO_639_2_ENTRY_SIZE 3
41 IN CHAR8 *SupportedLang,
43 IN BOOLEAN Iso639Language
51 CompareLength = ISO_639_2_ENTRY_SIZE;
52 for (Index = 0; Index <
AsciiStrLen (SupportedLang); Index += CompareLength) {
53 if (
AsciiStrnCmp (Lang, SupportedLang + Index, CompareLength) == 0) {
66 for (LanguageLength = 0; Lang[LanguageLength] !=
'\0'; LanguageLength++) {
69 for ( ; *SupportedLang !=
'\0'; SupportedLang += CompareLength) {
73 for ( ; *SupportedLang !=
'\0' && *SupportedLang ==
';'; SupportedLang++) {
79 for (CompareLength = 0; SupportedLang[CompareLength] !=
'\0' && SupportedLang[CompareLength] !=
';'; CompareLength++) {
82 if ((CompareLength == LanguageLength) &&
83 (
AsciiStrnCmp (Lang, SupportedLang, CompareLength) == 0))
111 IN CHAR8 *SupportedLang,
112 IN CHAR8 *DefaultLang,
113 IN BOOLEAN Iso639Language
135 &gEfiGlobalVariableGuid,
156 BOOLEAN LangCodesSettingRequired
161 CHAR8 *PlatformLangCodes;
163 LangCodes = (CHAR8 *)
PcdGetPtr (PcdUefiVariableDefaultLangCodes);
164 PlatformLangCodes = (CHAR8 *)
PcdGetPtr (PcdUefiVariableDefaultPlatformLangCodes);
165 if (LangCodesSettingRequired) {
170 Status =
gRT->SetVariable (
172 &gEfiGlobalVariableGuid,
173 EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
183 Status =
gRT->SetVariable (
184 L
"PlatformLangCodes",
185 &gEfiGlobalVariableGuid,
186 EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
UINTN EFIAPI AsciiStrLen(IN CONST CHAR8 *String)
INTN EFIAPI AsciiStrnCmp(IN CONST CHAR8 *FirstString, IN CONST CHAR8 *SecondString, IN UINTN Length)
UINTN EFIAPI AsciiStrSize(IN CONST CHAR8 *String)
VOID EFIAPI FreePool(IN VOID *Buffer)
VOID InitializeLangVariable(IN CHAR16 *LangName, IN CHAR8 *SupportedLang, IN CHAR8 *DefaultLang, IN BOOLEAN Iso639Language)
BOOLEAN IsLangInSupportedLangCodes(IN CHAR8 *SupportedLang, IN CHAR8 *Lang, IN BOOLEAN Iso639Language)
VOID InitializeLanguage(BOOLEAN LangCodesSettingRequired)
EFI_RUNTIME_SERVICES * gRT
EFI_STATUS BdsDxeSetVariableAndReportStatusCodeOnError(IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, IN UINT32 Attributes, IN UINTN DataSize, IN VOID *Data)
#define ASSERT_EFI_ERROR(StatusParameter)
#define PcdGetPtr(TokenName)
#define FeaturePcdGet(TokenName)
EFI_STATUS EFIAPI GetEfiGlobalVariable2(IN CONST CHAR16 *Name, OUT VOID **Value, OUT UINTN *Size OPTIONAL)
#define EFI_VARIABLE_NON_VOLATILE