\r
VfrCompiler main class and main function.\r
\r
-Copyright (c) 2004 - 2010, Intel Corporation \r
-All rights reserved. This program and the accompanying materials \r
+Copyright (c) 2004 - 2011, 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
http://opensource.org/licenses/bsd-license.php \r
\r
PACKAGE_DATA gCBuffer;\r
PACKAGE_DATA gRBuffer;\r
+CVfrStringDB gCVfrStringDB;\r
\r
VOID \r
CVfrCompiler::DebugError (\r
)\r
{\r
INT32 Index;\r
- \r
+ EFI_STATUS Status;\r
+\r
+ Status = EFI_SUCCESS;\r
SetUtilityName ((CHAR8*) PROGRAM_NAME);\r
\r
mOptions.VfrFileName[0] = '\0';\r
mOptions.SkipCPreprocessor = TRUE;\r
mOptions.CPreprocessorOptions = NULL;\r
mOptions.CompatibleMode = FALSE;\r
+ mOptions.HasOverrideClassGuid = FALSE;\r
+ memset (&mOptions.OverrideClassGuid, 0, sizeof (EFI_GUID));\r
\r
if (Argc == 1) {\r
Usage ();\r
AppendCPreprocessorOptions (Argv[Index]);\r
} else if (stricmp(Argv[Index], "-c") == 0 || stricmp(Argv[Index], "--compatible-framework") == 0) {\r
mOptions.CompatibleMode = TRUE;\r
+ } else if (stricmp(Argv[Index], "-s") == 0|| stricmp(Argv[Index], "--string-db") == 0) {\r
+ Index++;\r
+ if ((Index >= Argc) || (Argv[Index][0] == '-')) {\r
+ DebugError (NULL, 0, 1001, "Missing option", "-s missing input string file name");\r
+ goto Fail;\r
+ }\r
+ gCVfrStringDB.SetStringFileName(Argv[Index]);\r
+ DebugMsg (NULL, 0, 9, (CHAR8 *) "Input string file path", Argv[Index]);\r
+ } else if ((stricmp (Argv[Index], "-g") == 0) || (stricmp (Argv[Index], "--guid") == 0)) {\r
+ Index++;\r
+ Status = StringToGuid (Argv[Index], &mOptions.OverrideClassGuid);\r
+ if (EFI_ERROR (Status)) {\r
+ DebugError (NULL, 0, 1000, "Invalid format:", "%s", Argv[Index]);\r
+ goto Fail;\r
+ }\r
+ mOptions.HasOverrideClassGuid = TRUE;\r
} else {\r
DebugError (NULL, 0, 1000, "Unknown option", "unrecognized option %s", Argv[Index]);\r
goto Fail;\r
UINT32 Index;\r
CONST CHAR8 *Help[] = {\r
" ", \r
- "VfrCompile version " VFR_COMPILER_VERSION VFR_COMPILER_UPDATE_TIME,\r
- "Copyright (c) 2004-2010 Intel Corporation. All rights reserved.",\r
+ "VfrCompile version " VFR_COMPILER_VERSION __BUILD_VERSION VFR_COMPILER_UPDATE_TIME,\r
+ "Copyright (c) 2004-2011 Intel Corporation. All rights reserved.",\r
" ",\r
"Usage: VfrCompile [options] VfrFile",\r
" ",\r
" do not preprocessing input file",\r
" -c, --compatible-framework",\r
" compatible framework vfr file",\r
+ " -s, --string-db",\r
+ " input uni string package file",\r
+ " -g, --guid",\r
+ " override class guid input",\r
+ " format is xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",\r
NULL\r
};\r
for (Index = 0; Help[Index] != NULL; Index++) {\r
delete PreProcessCmd;\r
}\r
\r
-extern UINT8 VfrParserStart (IN FILE *, IN BOOLEAN);\r
+extern UINT8 VfrParserStart (IN FILE *, IN INPUT_INFO_TO_SYNTAX *);\r
\r
VOID\r
CVfrCompiler::Compile (\r
{\r
FILE *pInFile = NULL;\r
CHAR8 *InFileName = NULL;\r
+ INPUT_INFO_TO_SYNTAX InputInfo;\r
\r
if (!IS_RUN_STATUS(STATUS_PREPROCESSED)) {\r
goto Fail;\r
goto Fail;\r
}\r
\r
- if (VfrParserStart (pInFile, mOptions.CompatibleMode) != 0) {\r
+ InputInfo.CompatibleMode = mOptions.CompatibleMode;\r
+ if (mOptions.HasOverrideClassGuid) {\r
+ InputInfo.OverrideClassGuid = &mOptions.OverrideClassGuid;\r
+ } else {\r
+ InputInfo.OverrideClassGuid = NULL;\r
+ }\r
+\r
+ if (VfrParserStart (pInFile, &InputInfo) != 0) {\r
goto Fail;\r
}\r
\r
goto Err1;\r
}\r
\r
- fprintf (pOutFile, "//\n// VFR compiler version " VFR_COMPILER_VERSION "\n//\n");\r
+ fprintf (pOutFile, "//\n// VFR compiler version " VFR_COMPILER_VERSION __BUILD_VERSION "\n//\n");\r
LineNo = 0;\r
while (!feof (pInFile)) {\r
if (fgets (LineBuf, MAX_VFR_LINE_LEN, pInFile) != NULL) {\r