1 # Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
2 # This program and the accompanying materials
3 # are licensed and made available under the terms and conditions of the BSD License
4 # which accompanies this distribution. The full text of the license may be found at
5 # http://opensource.org/licenses/bsd-license.php
7 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
8 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11 #This file is used to parse a strings file and create or add to a string database file.
18 import Common
.EdkLogger
as EdkLogger
19 from Common
.BuildToolError
import *
20 from UniClassObject
import *
21 from StringIO
import StringIO
22 from struct
import pack
27 EFI_HII_SIBT_END
= '0x00'
28 EFI_HII_SIBT_STRING_SCSU
= '0x10'
29 EFI_HII_SIBT_STRING_SCSU_FONT
= '0x11'
30 EFI_HII_SIBT_STRINGS_SCSU
= '0x12'
31 EFI_HII_SIBT_STRINGS_SCSU_FONT
= '0x13'
32 EFI_HII_SIBT_STRING_UCS2
= '0x14'
33 EFI_HII_SIBT_STRING_UCS2_FONT
= '0x15'
34 EFI_HII_SIBT_STRINGS_UCS2
= '0x16'
35 EFI_HII_SIBT_STRINGS_UCS2_FONT
= '0x17'
36 EFI_HII_SIBT_DUPLICATE
= '0x20'
37 EFI_HII_SIBT_SKIP2
= '0x21'
38 EFI_HII_SIBT_SKIP1
= '0x22'
39 EFI_HII_SIBT_EXT1
= '0x30'
40 EFI_HII_SIBT_EXT2
= '0x31'
41 EFI_HII_SIBT_EXT4
= '0x32'
42 EFI_HII_SIBT_FONT
= '0x40'
44 EFI_HII_PACKAGE_STRINGS
= '0x04'
45 EFI_HII_PACKAGE_FORM
= '0x02'
47 StringPackageType
= EFI_HII_PACKAGE_STRINGS
48 StringPackageForm
= EFI_HII_PACKAGE_FORM
49 StringBlockType
= EFI_HII_SIBT_STRING_UCS2
50 StringSkipType
= EFI_HII_SIBT_SKIP2
55 DEFINE_STR
= '#define'
56 COMMENT_DEFINE_STR
= COMMENT
+ DEFINE_STR
57 NOT_REFERENCED
= 'not referenced'
58 COMMENT_NOT_REFERENCED
= ' ' + COMMENT
+ NOT_REFERENCED
59 CHAR_ARRAY_DEFIN
= 'unsigned char'
60 COMMON_FILE_NAME
= 'Strings'
64 STRING_TOKEN
= re
.compile('STRING_TOKEN *\(([A-Z0-9_]+) *\)', re
.MULTILINE | re
.UNICODE
)
65 COMPATIBLE_STRING_TOKEN
= re
.compile('STRING_TOKEN *\(([A-Za-z0-9_]+) *\)', re
.MULTILINE | re
.UNICODE
)
67 EFI_HII_ARRAY_SIZE_LENGTH
= 4
68 EFI_HII_PACKAGE_HEADER_LENGTH
= 4
69 EFI_HII_HDR_SIZE_LENGTH
= 4
70 EFI_HII_STRING_OFFSET_LENGTH
= 4
72 EFI_STRING_ID_LENGTH
= 2
73 EFI_HII_LANGUAGE_WINDOW
= 0
74 EFI_HII_LANGUAGE_WINDOW_LENGTH
= 2
75 EFI_HII_LANGUAGE_WINDOW_NUMBER
= 16
76 EFI_HII_STRING_PACKAGE_HDR_LENGTH
= EFI_HII_PACKAGE_HEADER_LENGTH
+ EFI_HII_HDR_SIZE_LENGTH
+ EFI_HII_STRING_OFFSET_LENGTH
+ EFI_HII_LANGUAGE_WINDOW_LENGTH
* EFI_HII_LANGUAGE_WINDOW_NUMBER
+ EFI_STRING_ID_LENGTH
78 H_C_FILE_HEADER
= ['//', \
79 '// DO NOT EDIT -- auto-generated file', \
81 '// This file is generated by the StrGather utility', \
83 LANGUAGE_NAME_STRING_NAME
= '$LANGUAGE_NAME'
84 PRINTABLE_LANGUAGE_NAME_STRING_NAME
= '$PRINTABLE_LANGUAGE_NAME'
86 ## Convert a dec number to a hex string
88 # Convert a dec number to a formatted hex string in length digit
89 # The digit is set to default 8
90 # The hex string starts with "0x"
91 # DecToHexStr(1000) is '0x000003E8'
92 # DecToHexStr(1000, 6) is '0x0003E8'
94 # @param Dec: The number in dec format
95 # @param Digit: The needed digit of hex string
97 # @retval: The formatted hex string
99 def DecToHexStr(Dec
, Digit
= 8):
100 return eval("'0x%0" + str(Digit
) + "X' % int(Dec)")
102 ## Convert a dec number to a hex list
104 # Convert a dec number to a formatted hex list in size digit
105 # The digit is set to default 8
106 # DecToHexList(1000) is ['0xE8', '0x03', '0x00', '0x00']
107 # DecToHexList(1000, 6) is ['0xE8', '0x03', '0x00']
109 # @param Dec: The number in dec format
110 # @param Digit: The needed digit of hex list
112 # @retval: A list for formatted hex string
114 def DecToHexList(Dec
, Digit
= 8):
115 Hex
= eval("'%0" + str(Digit
) + "X' % int(Dec)" )
117 for Bit
in range(Digit
- 2, -1, -2):
118 List
.append(HexHeader
+ Hex
[Bit
:Bit
+ 2])
121 ## Convert a acsii string to a hex list
123 # Convert a acsii string to a formatted hex list
124 # AscToHexList('en-US') is ['0x65', '0x6E', '0x2D', '0x55', '0x53']
126 # @param Ascii: The acsii string
128 # @retval: A list for formatted hex string
130 def AscToHexList(Ascii
):
133 List
.append('0x%2X' % ord(Item
))
137 ## Create header of .h file
139 # Create a header of .h file
141 # @param BaseName: The basename of strings
143 # @retval Str: A string for .h file header
145 def CreateHFileHeader(BaseName
):
147 for Item
in H_C_FILE_HEADER
:
148 Str
= WriteLine(Str
, Item
)
149 Str
= WriteLine(Str
, '#ifndef _' + BaseName
.upper() + '_STRINGS_DEFINE_H_')
150 Str
= WriteLine(Str
, '#define _' + BaseName
.upper() + '_STRINGS_DEFINE_H_')
153 ## Create content of .h file
155 # Create content of .h file
157 # @param BaseName: The basename of strings
158 # @param UniObjectClass A UniObjectClass instance
159 # @param IsCompatibleMode Compatible mode
160 # @param UniGenCFlag UniString is generated into AutoGen C file when it is set to True
162 # @retval Str: A string of .h file content
164 def CreateHFileContent(BaseName
, UniObjectClass
, IsCompatibleMode
, UniGenCFlag
):
167 Line
= COMMENT_DEFINE_STR
+ ' ' + LANGUAGE_NAME_STRING_NAME
+ ' ' * (ValueStartPtr
- len(DEFINE_STR
+ LANGUAGE_NAME_STRING_NAME
)) + DecToHexStr(0, 4) + COMMENT_NOT_REFERENCED
168 Str
= WriteLine(Str
, Line
)
169 Line
= COMMENT_DEFINE_STR
+ ' ' + PRINTABLE_LANGUAGE_NAME_STRING_NAME
+ ' ' * (ValueStartPtr
- len(DEFINE_STR
+ PRINTABLE_LANGUAGE_NAME_STRING_NAME
)) + DecToHexStr(1, 4) + COMMENT_NOT_REFERENCED
170 Str
= WriteLine(Str
, Line
)
172 #Group the referred STRING token together.
173 for Index
in range(2, len(UniObjectClass
.OrderedStringList
[UniObjectClass
.LanguageDef
[0][0]])):
174 StringItem
= UniObjectClass
.OrderedStringList
[UniObjectClass
.LanguageDef
[0][0]][Index
]
175 Name
= StringItem
.StringName
176 Token
= StringItem
.Token
177 Referenced
= StringItem
.Referenced
180 if Referenced
== True:
181 if (ValueStartPtr
- len(DEFINE_STR
+ Name
)) <= 0:
182 Line
= DEFINE_STR
+ ' ' + Name
+ ' ' + DecToHexStr(Token
, 4)
184 Line
= DEFINE_STR
+ ' ' + Name
+ ' ' * (ValueStartPtr
- len(DEFINE_STR
+ Name
)) + DecToHexStr(Token
, 4)
185 Str
= WriteLine(Str
, Line
)
187 #Group the unused STRING token together.
188 for Index
in range(2, len(UniObjectClass
.OrderedStringList
[UniObjectClass
.LanguageDef
[0][0]])):
189 StringItem
= UniObjectClass
.OrderedStringList
[UniObjectClass
.LanguageDef
[0][0]][Index
]
190 Name
= StringItem
.StringName
191 Token
= StringItem
.Token
192 Referenced
= StringItem
.Referenced
195 if Referenced
== False:
196 if (ValueStartPtr
- len(DEFINE_STR
+ Name
)) <= 0:
197 Line
= COMMENT_DEFINE_STR
+ ' ' + Name
+ ' ' + DecToHexStr(Token
, 4) + COMMENT_NOT_REFERENCED
199 Line
= COMMENT_DEFINE_STR
+ ' ' + Name
+ ' ' * (ValueStartPtr
- len(DEFINE_STR
+ Name
)) + DecToHexStr(Token
, 4) + COMMENT_NOT_REFERENCED
200 Str
= WriteLine(Str
, Line
)
202 Str
= WriteLine(Str
, '')
203 if IsCompatibleMode
or UniGenCFlag
:
204 Str
= WriteLine(Str
, 'extern unsigned char ' + BaseName
+ 'Strings[];')
207 ## Create a complete .h file
209 # Create a complet .h file with file header and file content
211 # @param BaseName: The basename of strings
212 # @param UniObjectClass A UniObjectClass instance
213 # @param IsCompatibleMode Compatible mode
214 # @param UniGenCFlag UniString is generated into AutoGen C file when it is set to True
216 # @retval Str: A string of complete .h file
218 def CreateHFile(BaseName
, UniObjectClass
, IsCompatibleMode
, UniGenCFlag
):
219 HFile
= WriteLine('', CreateHFileContent(BaseName
, UniObjectClass
, IsCompatibleMode
, UniGenCFlag
))
223 ## Create header of .c file
225 # Create a header of .c file
227 # @retval Str: A string for .c file header
229 def CreateCFileHeader():
231 for Item
in H_C_FILE_HEADER
:
232 Str
= WriteLine(Str
, Item
)
236 ## Create a buffer to store all items in an array
238 # @param BinBuffer Buffer to contain Binary data.
239 # @param Array: The array need to be formatted
241 def CreateBinBuffer(BinBuffer
, Array
):
243 BinBuffer
.write(pack("B", int(Item
,16)))
245 ## Create a formatted string all items in an array
247 # Use ',' to join each item in an array, and break an new line when reaching the width (default is 16)
249 # @param Array: The array need to be formatted
250 # @param Width: The line length, the default value is set to 16
252 # @retval ArrayItem: A string for all formatted array items
254 def CreateArrayItem(Array
, Width
= 16):
261 if Index
< MaxLength
:
262 Line
= Line
+ Item
+ ', '
265 ArrayItem
= WriteLine(ArrayItem
, Line
)
266 Line
= ' ' + Item
+ ', '
268 ArrayItem
= Write(ArrayItem
, Line
.rstrip())
272 ## CreateCFileStringValue
274 # Create a line with string value
276 # @param Value: Value of the string
278 # @retval Str: A formatted string with string value
281 def CreateCFileStringValue(Value
):
282 Value
= [StringBlockType
] + Value
283 Str
= WriteLine('', CreateArrayItem(Value
))
287 ## GetFilteredLanguage
289 # apply get best language rules to the UNI language code list
291 # @param UniLanguageList: language code definition list in *.UNI file
292 # @param LanguageFilterList: language code filter list of RFC4646 format in DSC file
294 # @retval UniLanguageListFiltered: the filtered language code
296 def GetFilteredLanguage(UniLanguageList
, LanguageFilterList
):
297 UniLanguageListFiltered
= []
298 # if filter list is empty, then consider there is no filter
299 if LanguageFilterList
== []:
300 UniLanguageListFiltered
= UniLanguageList
301 return UniLanguageListFiltered
302 for Language
in LanguageFilterList
:
303 # first check for exact match
304 if Language
in UniLanguageList
:
305 if Language
not in UniLanguageListFiltered
:
306 UniLanguageListFiltered
+= [Language
]
307 # find the first one with the same/equivalent primary tag
309 if Language
.find('-') != -1:
310 PrimaryTag
= Language
[0:Language
.find('-')].lower()
312 PrimaryTag
= Language
314 if len(PrimaryTag
) == 3:
315 PrimaryTag
= LangConvTable
.get(PrimaryTag
)
317 for UniLanguage
in UniLanguageList
:
318 if UniLanguage
.find('-') != -1:
319 UniLanguagePrimaryTag
= UniLanguage
[0:UniLanguage
.find('-')].lower()
321 UniLanguagePrimaryTag
= UniLanguage
323 if len(UniLanguagePrimaryTag
) == 3:
324 UniLanguagePrimaryTag
= LangConvTable
.get(UniLanguagePrimaryTag
)
326 if PrimaryTag
== UniLanguagePrimaryTag
:
327 if UniLanguage
not in UniLanguageListFiltered
:
328 UniLanguageListFiltered
+= [UniLanguage
]
331 # Here is rule 3 for "get best language"
332 # If tag is not listed in the Unicode file, the default ("en") tag should be used for that language
333 # for better processing, find the one that best suit for it.
335 if DefaultTag
not in UniLanguageListFiltered
:
336 # check whether language code with primary code equivalent with DefaultTag already in the list, if so, use that
337 for UniLanguage
in UniLanguageList
:
338 if UniLanguage
.startswith('en-') or UniLanguage
.startswith('eng-'):
339 if UniLanguage
not in UniLanguageListFiltered
:
340 UniLanguageListFiltered
+= [UniLanguage
]
343 UniLanguageListFiltered
+= [DefaultTag
]
344 return UniLanguageListFiltered
347 ## Create content of .c file
349 # Create content of .c file
351 # @param BaseName: The basename of strings
352 # @param UniObjectClass A UniObjectClass instance
353 # @param IsCompatibleMode Compatible mode
354 # @param UniBinBuffer UniBinBuffer to contain UniBinary data.
355 # @param FilterInfo Platform language filter information
357 # @retval Str: A string of .c file content
359 def CreateCFileContent(BaseName
, UniObjectClass
, IsCompatibleMode
, UniBinBuffer
, FilterInfo
):
363 TotalLength
= EFI_HII_ARRAY_SIZE_LENGTH
367 EDK2Module
= FilterInfo
[0]
369 LanguageFilterList
= FilterInfo
[1]
371 # EDK module is using ISO639-2 format filter, convert to the RFC4646 format
372 LanguageFilterList
= [LangConvTable
.get(F
.lower()) for F
in FilterInfo
[1]]
375 for IndexI
in range(len(UniObjectClass
.LanguageDef
)):
376 UniLanguageList
+= [UniObjectClass
.LanguageDef
[IndexI
][0]]
378 UniLanguageListFiltered
= GetFilteredLanguage(UniLanguageList
, LanguageFilterList
)
382 # Create lines for each language's strings
384 for IndexI
in range(len(UniObjectClass
.LanguageDef
)):
385 Language
= UniObjectClass
.LanguageDef
[IndexI
][0]
386 LangPrintName
= UniObjectClass
.LanguageDef
[IndexI
][1]
387 if Language
not in UniLanguageListFiltered
:
390 StringBuffer
= StringIO()
393 NumberOfUseOtherLangDef
= 0
395 for IndexJ
in range(1, len(UniObjectClass
.OrderedStringList
[UniObjectClass
.LanguageDef
[IndexI
][0]])):
396 Item
= UniObjectClass
.FindByToken(IndexJ
, Language
)
397 Name
= Item
.StringName
398 Value
= Item
.StringValueByteList
399 Referenced
= Item
.Referenced
402 UseOtherLangDef
= Item
.UseOtherLangDef
404 if UseOtherLangDef
!= '' and Referenced
:
405 NumberOfUseOtherLangDef
= NumberOfUseOtherLangDef
+ 1
408 if NumberOfUseOtherLangDef
> 0:
409 StrStringValue
= WriteLine(StrStringValue
, CreateArrayItem([StringSkipType
] + DecToHexList(NumberOfUseOtherLangDef
, 4)))
410 CreateBinBuffer (StringBuffer
, ([StringSkipType
] + DecToHexList(NumberOfUseOtherLangDef
, 4)))
411 NumberOfUseOtherLangDef
= 0
412 ArrayLength
= ArrayLength
+ 3
413 if Referenced
and Item
.Token
> 0:
415 StrStringValue
= WriteLine(StrStringValue
, "// %s: %s:%s" % (DecToHexStr(Index
, 4), Name
, DecToHexStr(Token
, 4)))
416 StrStringValue
= Write(StrStringValue
, CreateCFileStringValue(Value
))
417 CreateBinBuffer (StringBuffer
, [StringBlockType
] + Value
)
418 ArrayLength
= ArrayLength
+ Item
.Length
+ 1 # 1 is for the length of string type
421 # EFI_HII_PACKAGE_HEADER
423 Offset
= EFI_HII_STRING_PACKAGE_HDR_LENGTH
+ len(Language
) + 1
424 ArrayLength
= Offset
+ ArrayLength
+ 1
427 # Create PACKAGE HEADER
429 Str
= WriteLine(Str
, '// PACKAGE HEADER\n')
430 TotalLength
= TotalLength
+ ArrayLength
432 List
= DecToHexList(ArrayLength
, 6) + \
433 [StringPackageType
] + \
434 DecToHexList(Offset
) + \
435 DecToHexList(Offset
) + \
436 DecToHexList(EFI_HII_LANGUAGE_WINDOW
, EFI_HII_LANGUAGE_WINDOW_LENGTH
* 2) * EFI_HII_LANGUAGE_WINDOW_NUMBER
+ \
437 DecToHexList(EFI_STRING_ID
, 4) + \
438 AscToHexList(Language
) + \
440 Str
= WriteLine(Str
, CreateArrayItem(List
, 16) + '\n')
443 # Create PACKAGE DATA
445 Str
= WriteLine(Str
, '// PACKAGE DATA\n')
446 Str
= Write(Str
, StrStringValue
)
449 # Add an EFI_HII_SIBT_END at last
451 Str
= WriteLine(Str
, ' ' + EFI_HII_SIBT_END
+ ",")
454 # Create binary UNI string
457 CreateBinBuffer (UniBinBuffer
, List
)
458 UniBinBuffer
.write (StringBuffer
.getvalue())
459 UniBinBuffer
.write (pack("B", int(EFI_HII_SIBT_END
,16)))
463 # Create line for string variable name
464 # "unsigned char $(BaseName)Strings[] = {"
466 AllStr
= WriteLine('', CHAR_ARRAY_DEFIN
+ ' ' + BaseName
+ COMMON_FILE_NAME
+ '[] = {\n' )
470 # Create FRAMEWORK_EFI_HII_PACK_HEADER in compatible mode
472 AllStr
= WriteLine(AllStr
, '// FRAMEWORK PACKAGE HEADER Length')
473 AllStr
= WriteLine(AllStr
, CreateArrayItem(DecToHexList(TotalLength
+ 2)) + '\n')
474 AllStr
= WriteLine(AllStr
, '// FRAMEWORK PACKAGE HEADER Type')
475 AllStr
= WriteLine(AllStr
, CreateArrayItem(DecToHexList(2, 4)) + '\n')
478 # Create whole array length in UEFI mode
480 AllStr
= WriteLine(AllStr
, '// STRGATHER_OUTPUT_HEADER')
481 AllStr
= WriteLine(AllStr
, CreateArrayItem(DecToHexList(TotalLength
)) + '\n')
486 AllStr
= Write(AllStr
, Str
)
490 ## Create end of .c file
492 # Create end of .c file
494 # @retval Str: A string of .h file end
496 def CreateCFileEnd():
497 Str
= Write('', '};')
502 # Create a complete .c file
504 # @param BaseName: The basename of strings
505 # @param UniObjectClass A UniObjectClass instance
506 # @param IsCompatibleMode Compatible Mode
507 # @param FilterInfo Platform language filter information
509 # @retval CFile: A string of complete .c file
511 def CreateCFile(BaseName
, UniObjectClass
, IsCompatibleMode
, FilterInfo
):
513 #CFile = WriteLine(CFile, CreateCFileHeader())
514 CFile
= WriteLine(CFile
, CreateCFileContent(BaseName
, UniObjectClass
, IsCompatibleMode
, None, FilterInfo
))
515 CFile
= WriteLine(CFile
, CreateCFileEnd())
520 # Get a list for all files
522 # @param IncludeList: A list of all path to be searched
523 # @param SkipList: A list of all types of file could be skipped
525 # @retval FileList: A list of all files found
527 def GetFileList(SourceFileList
, IncludeList
, SkipList
):
528 if IncludeList
== None:
529 EdkLogger
.error("UnicodeStringGather", AUTOGEN_ERROR
, "Include path for unicode file is not defined")
535 for File
in SourceFileList
:
536 for Dir
in IncludeList
:
537 if not os
.path
.exists(Dir
):
539 File
= os
.path
.join(Dir
, File
.Path
)
543 if os
.path
.isfile(File
) != True:
546 # Ignore file listed in skip list
549 for Skip
in SkipList
:
550 if os
.path
.splitext(File
)[1].upper() == Skip
.upper():
551 EdkLogger
.verbose("Skipped %s for string token uses search" % File
)
556 FileList
.append(File
)
564 # Search whether all string defined in UniObjectClass are referenced
565 # All string used should be set to Referenced
567 # @param UniObjectClass: Input UniObjectClass
568 # @param FileList: Search path list
569 # @param IsCompatibleMode Compatible Mode
571 # @retval UniObjectClass: UniObjectClass after searched
573 def SearchString(UniObjectClass
, FileList
, IsCompatibleMode
):
575 return UniObjectClass
577 for File
in FileList
:
578 if os
.path
.isfile(File
):
579 Lines
= open(File
, 'r')
581 if not IsCompatibleMode
:
582 StringTokenList
= STRING_TOKEN
.findall(Line
)
584 StringTokenList
= COMPATIBLE_STRING_TOKEN
.findall(Line
)
585 for StrName
in StringTokenList
:
586 EdkLogger
.debug(EdkLogger
.DEBUG_5
, "Found string identifier: " + StrName
)
587 UniObjectClass
.SetStringReferenced(StrName
)
589 UniObjectClass
.ReToken()
591 return UniObjectClass
595 # This function is used for UEFI2.1 spec
598 def GetStringFiles(UniFilList
, SourceFileList
, IncludeList
, IncludePathList
, SkipList
, BaseName
, IsCompatibleMode
= False, ShellMode
= False, UniGenCFlag
= True, UniGenBinBuffer
= None, FilterInfo
= [True, []]):
602 if len(UniFilList
) > 0:
605 # support ISO 639-2 codes in .UNI files of EDK Shell
607 Uni
= UniFileClassObject(sorted (UniFilList
), True, IncludePathList
)
609 Uni
= UniFileClassObject(sorted (UniFilList
), IsCompatibleMode
, IncludePathList
)
611 EdkLogger
.error("UnicodeStringGather", AUTOGEN_ERROR
, 'No unicode files given')
613 FileList
= GetFileList(SourceFileList
, IncludeList
, SkipList
)
615 Uni
= SearchString(Uni
, sorted (FileList
), IsCompatibleMode
)
617 HFile
= CreateHFile(BaseName
, Uni
, IsCompatibleMode
, UniGenCFlag
)
619 if IsCompatibleMode
or UniGenCFlag
:
620 CFile
= CreateCFile(BaseName
, Uni
, IsCompatibleMode
, FilterInfo
)
622 CreateCFileContent(BaseName
, Uni
, IsCompatibleMode
, UniGenBinBuffer
, FilterInfo
)
629 def Write(Target
, Item
):
633 # Write an item with a break line
635 def WriteLine(Target
, Item
):
636 return Target
+ Item
+ '\n'
638 # This acts like the main() function for the script, unless it is 'import'ed into another
640 if __name__
== '__main__':
641 EdkLogger
.info('start')
644 r
'C:\\Edk\\Strings2.uni',
645 r
'C:\\Edk\\Strings.uni'
649 for Root
, Dirs
, Files
in os
.walk('C:\\Edk'):
651 SrcFileList
.append(File
)
657 SkipList
= ['.inf', '.uni']
658 BaseName
= 'DriverSample'
659 (h
, c
) = GetStringFiles(UniFileList
, SrcFileList
, IncludeList
, SkipList
, BaseName
, True)
660 hfile
= open('unistring.h', 'w')
661 cfile
= open('unistring.c', 'w')
665 EdkLogger
.info('end')