From 0f2685219d6acfbb308cd9c795e2fbb2f6b2371a Mon Sep 17 00:00:00 2001 From: rsun3 Date: Fri, 17 Apr 2009 02:38:11 +0000 Subject: Retire HiiLibGetNextLanguage() API from HII Library class. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8109 6f19259b-4bc3-4df7-8a09-765794883524 --- .../FrameworkHiiOnUefiHiiThunk/HiiDatabase.c | 4 +-- .../FrameworkHiiOnUefiHiiThunk/HiiDatabase.h | 20 +++++++++++ .../FrameworkHiiOnUefiHiiThunk/Strings.c | 41 +++++++++++++++++++++ .../Universal/BdsDxe/FrontPage.c | 4 +-- .../Universal/BdsDxe/Language.c | 41 +++++++++++++++++++++ .../Universal/BdsDxe/Language.h | 19 ++++++++++ MdeModulePkg/Include/Library/HiiLib.h | 20 ----------- MdeModulePkg/Library/UefiHiiLib/HiiLanguage.c | 42 ---------------------- 8 files changed, 125 insertions(+), 66 deletions(-) diff --git a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/HiiDatabase.c b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/HiiDatabase.c index 5a3df71..74ddad0 100644 --- a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/HiiDatabase.c +++ b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/HiiDatabase.c @@ -334,7 +334,7 @@ LangCodes3066To639 ( Index = 0; AsciiLangCodes = LangCodes3066; while (AsciiStrLen (AsciiLangCodes) != 0) { - HiiLibGetNextLanguage (&AsciiLangCodes, Lang); + GetNextLanguage (&AsciiLangCodes, Lang); Index++; } @@ -352,7 +352,7 @@ LangCodes3066To639 ( AsciiLangCodes = LangCodes3066; for (Index = 0; Index < Count; Index++) { - HiiLibGetNextLanguage (&AsciiLangCodes, Lang); + GetNextLanguage (&AsciiLangCodes, Lang); Status = ConvertRfc3066LanguageToIso639Language (Lang, *LangCodes639 + Index * ISO_639_2_ENTRY_SIZE); ASSERT_EFI_ERROR (Status); } diff --git a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/HiiDatabase.h b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/HiiDatabase.h index 1583745..8a999b3 100644 --- a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/HiiDatabase.h +++ b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/HiiDatabase.h @@ -529,6 +529,26 @@ ConvertIso639LanguageToRfc3066Language ( ) ; +/** + Get next language from language code list (with separator ';'). + + If LangCode is NULL, then ASSERT. + If Lang is NULL, then ASSERT. + + @param LangCode On input: point to first language in the list. On + output: point to next language in the list, or + NULL if no more language in the list. + @param Lang The first language in the list. + +**/ +VOID +EFIAPI +GetNextLanguage ( + IN OUT CHAR8 **LangCode, + OUT CHAR8 *Lang + ) +; + #include "Utility.h" #include "ConfigAccess.h" diff --git a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Strings.c b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Strings.c index caa702d..3fab323 100644 --- a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Strings.c +++ b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Strings.c @@ -268,6 +268,47 @@ ConvertIso639LanguageToRfc3066Language ( } /** + Get next language from language code list (with separator ';'). + + If LangCode is NULL, then ASSERT. + If Lang is NULL, then ASSERT. + + @param LangCode On input: point to first language in the list. On + output: point to next language in the list, or + NULL if no more language in the list. + @param Lang The first language in the list. + +**/ +VOID +EFIAPI +GetNextLanguage ( + IN OUT CHAR8 **LangCode, + OUT CHAR8 *Lang + ) +{ + UINTN Index; + CHAR8 *StringPtr; + + ASSERT (LangCode != NULL); + ASSERT (*LangCode != NULL); + ASSERT (Lang != NULL); + + Index = 0; + StringPtr = *LangCode; + while (StringPtr[Index] != 0 && StringPtr[Index] != ';') { + Index++; + } + + CopyMem (Lang, StringPtr, Index); + Lang[Index] = 0; + + if (StringPtr[Index] == ';') { + Index++; + } + *LangCode = StringPtr + Index; +} + +/** Test if all of the characters in a string have corresponding font characters. This is a deprecated API. No Framework HII module is calling it. This function will ASSERT and diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c index 99abf14..2719a72 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c @@ -195,7 +195,7 @@ FrontPageCallback ( Index = 0; LangCode = LanguageString; while (*LangCode != 0) { - HiiLibGetNextLanguage (&LangCode, Lang); + GetNextLanguage (&LangCode, Lang); if (Index == Value->u8) { break; @@ -419,7 +419,7 @@ InitializeFrontPage ( OptionCount = 0; LangCode = LanguageString; while (*LangCode != 0) { - HiiLibGetNextLanguage (&LangCode, Lang); + GetNextLanguage (&LangCode, Lang); if (gFrontPagePrivate.LanguageToken == NULL) { // diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/Language.c b/IntelFrameworkModulePkg/Universal/BdsDxe/Language.c index 5b154e9..ea66006 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/Language.c +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/Language.c @@ -449,6 +449,47 @@ ConvertRfc3066LanguageToIso639Language ( } /** + Get next language from language code list (with separator ';'). + + If LangCode is NULL, then ASSERT. + If Lang is NULL, then ASSERT. + + @param LangCode On input: point to first language in the list. On + output: point to next language in the list, or + NULL if no more language in the list. + @param Lang The first language in the list. + +**/ +VOID +EFIAPI +GetNextLanguage ( + IN OUT CHAR8 **LangCode, + OUT CHAR8 *Lang + ) +{ + UINTN Index; + CHAR8 *StringPtr; + + ASSERT (LangCode != NULL); + ASSERT (*LangCode != NULL); + ASSERT (Lang != NULL); + + Index = 0; + StringPtr = *LangCode; + while (StringPtr[Index] != 0 && StringPtr[Index] != ';') { + Index++; + } + + CopyMem (Lang, StringPtr, Index); + Lang[Index] = 0; + + if (StringPtr[Index] == ';') { + Index++; + } + *LangCode = StringPtr + Index; +} + +/** Determine the current language that will be used based on language related EFI Variables. diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/Language.h b/IntelFrameworkModulePkg/Universal/BdsDxe/Language.h index 91bbe9b..3ec8aad 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/Language.h +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/Language.h @@ -35,6 +35,25 @@ ConvertRfc3066LanguageToIso639Language ( ); /** + Get next language from language code list (with separator ';'). + + If LangCode is NULL, then ASSERT. + If Lang is NULL, then ASSERT. + + @param LangCode On input: point to first language in the list. On + output: point to next language in the list, or + NULL if no more language in the list. + @param Lang The first language in the list. + +**/ +VOID +EFIAPI +GetNextLanguage ( + IN OUT CHAR8 **LangCode, + OUT CHAR8 *Lang + ); + +/** Determine the current language that will be used based on language related EFI Variables. diff --git a/MdeModulePkg/Include/Library/HiiLib.h b/MdeModulePkg/Include/Library/HiiLib.h index 17420b4..3f0e096 100644 --- a/MdeModulePkg/Include/Library/HiiLib.h +++ b/MdeModulePkg/Include/Library/HiiLib.h @@ -224,26 +224,6 @@ HiiGetHiiHandles ( ; /** - Get next language from language code list (with separator ';'). - - If LangCode is NULL, then ASSERT. - If Lang is NULL, then ASSERT. - - @param LangCode On input: point to first language in the list. On - output: point to next language in the list, or - NULL if no more language in the list. - @param Lang The first language in the list. - -**/ -VOID -EFIAPI -HiiLibGetNextLanguage ( - IN OUT CHAR8 **LangCode, - OUT CHAR8 *Lang - ) -; - -/** Retrieves a pointer to the a Null-terminated ASCII string containing the list of languages that an HII handle in the HII Database supports. The returned string is allocated using AllocatePool(). The caller is responsible for freeing diff --git a/MdeModulePkg/Library/UefiHiiLib/HiiLanguage.c b/MdeModulePkg/Library/UefiHiiLib/HiiLanguage.c index 45e178c..07fc593 100644 --- a/MdeModulePkg/Library/UefiHiiLib/HiiLanguage.c +++ b/MdeModulePkg/Library/UefiHiiLib/HiiLanguage.c @@ -16,48 +16,6 @@ #include "InternalHiiLib.h" /** - Get next language from language code list (with separator ';'). - - If LangCode is NULL, then ASSERT. - If Lang is NULL, then ASSERT. - - @param LangCode On input: point to first language in the list. On - output: point to next language in the list, or - NULL if no more language in the list. - @param Lang The first language in the list. - -**/ -VOID -EFIAPI -HiiLibGetNextLanguage ( - IN OUT CHAR8 **LangCode, - OUT CHAR8 *Lang - ) -{ - UINTN Index; - CHAR8 *StringPtr; - - ASSERT (LangCode != NULL); - ASSERT (*LangCode != NULL); - ASSERT (Lang != NULL); - - Index = 0; - StringPtr = *LangCode; - while (StringPtr[Index] != 0 && StringPtr[Index] != ';') { - Index++; - } - - CopyMem (Lang, StringPtr, Index); - Lang[Index] = 0; - - if (StringPtr[Index] == ';') { - Index++; - } - *LangCode = StringPtr + Index; -} - - -/** Retrieves a pointer to the a Null-terminated ASCII string containing the list of languages that an HII handle in the HII Database supports. The returned string is allocated using AllocatePool(). The caller is responsible for freeing -- cgit v1.1