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 --- .../Universal/BdsDxe/FrontPage.c | 4 +-- .../Universal/BdsDxe/Language.c | 41 ++++++++++++++++++++++ .../Universal/BdsDxe/Language.h | 19 ++++++++++ 3 files changed, 62 insertions(+), 2 deletions(-) (limited to 'IntelFrameworkModulePkg/Universal') diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c index 99abf1460a..2719a723fb 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 5b154e98ee..ea66006b4c 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/Language.c +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/Language.c @@ -448,6 +448,47 @@ ConvertRfc3066LanguageToIso639Language ( return EFI_NOT_FOUND; } +/** + 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 91bbe9b90d..3ec8aad68d 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/Language.h +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/Language.h @@ -34,6 +34,25 @@ ConvertRfc3066LanguageToIso639Language ( OUT CHAR8 *LanguageIso639 ); +/** + 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. -- cgit v1.2.3