X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=EdkCompatibilityPkg%2FCompatibility%2FFrameworkHiiOnUefiHiiThunk%2FStrings.c;fp=EdkCompatibilityPkg%2FCompatibility%2FFrameworkHiiOnUefiHiiThunk%2FStrings.c;h=3fab323dc70c2c9901bff793af16752a7b5fd646;hp=caa702d5dda17b49fb4ee14afc61ffccc93a2947;hb=0f2685219d6acfbb308cd9c795e2fbb2f6b2371a;hpb=bd72aa1a3138c64f9d04ba8f4a93c27173eff7fb diff --git a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Strings.c b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Strings.c index caa702d5dd..3fab323dc7 100644 --- a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Strings.c +++ b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Strings.c @@ -267,6 +267,47 @@ ConvertIso639LanguageToRfc3066Language ( return NULL; } +/** + 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.