]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkCompatibilityPkg/Sample/Tools/Source/StrGather/StringDB.c
Sync all bug fixes between EDK1.04 and EDK1.06 into EdkCompatibilityPkg.
[mirror_edk2.git] / EdkCompatibilityPkg / Sample / Tools / Source / StrGather / StringDB.c
index 6b17f48c6d7ef41bbec278e0f90cdc7a17b9d0a5..08afd83fb31cba9a20ad0979f4042425427e666e 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -2508,7 +2508,8 @@ Returns:
 --*/\r
 STATUS\r
 StringDBCreateHiiExportPack (\r
-  INT8                        *FileName\r
+  INT8                        *FileName,\r
+  WCHAR_STRING_LIST           *LanguagesOfInterest\r
   )\r
 {\r
   FILE                        *Fptr;\r
@@ -2524,6 +2525,9 @@ StringDBCreateHiiExportPack (
   WCHAR                       *TempStringPtr;\r
   WCHAR                       *LangName;\r
   STRING_IDENTIFIER           *StringIdentifier;\r
+  WCHAR_STRING_LIST           *LOIPtr;\r
+  BOOLEAN                     LanguageOk;\r
+\r
 \r
   if ((Fptr = fopen (FileName, "wb")) == NULL) {\r
     Error (NULL, 0, 0, FileName, "failed to open output HII export file");\r
@@ -2544,6 +2548,25 @@ StringDBCreateHiiExportPack (
   //\r
   ZeroString[0] = 0;\r
   for (Lang = mDBData.LanguageList; Lang != NULL; Lang = Lang->Next) {\r
+    //\r
+    // If we have a language list, then make sure this language is in that\r
+    // list.\r
+    //\r
+    LanguageOk  = TRUE;\r
+    if (LanguagesOfInterest != NULL) {\r
+      LanguageOk = FALSE;\r
+      for (LOIPtr = LanguagesOfInterest; LOIPtr != NULL; LOIPtr = LOIPtr->Next) {\r
+        if (wcsncmp (LOIPtr->Str, Lang->LanguageName, LANGUAGE_IDENTIFIER_NAME_LEN) == 0) {\r
+          LanguageOk  = TRUE;\r
+          break;\r
+        }\r
+      }\r
+    }\r
+\r
+    if (!LanguageOk) {\r
+      continue;\r
+    }\r
+\r
     //\r
     // Process each string for this language. We have to make 3 passes on the strings:\r
     //   Pass1: computes sizes and fill in the string pack header\r