/** @file\r
- \r
+\r
VfrCompiler main class and main function.\r
\r
Copyright (c) 2004 - 2018, 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
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \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
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
**/\r
\r
PACKAGE_DATA gRBuffer;\r
CVfrStringDB gCVfrStringDB;\r
\r
-VOID \r
+VOID\r
CVfrCompiler::DebugError (\r
IN CHAR8 *FileName,\r
IN UINT32 LineNumber,\r
IN CONST CHAR8 *Text,\r
IN CONST CHAR8 *MsgFmt,\r
...\r
- ) \r
+ )\r
{\r
va_list List;\r
va_start (List, MsgFmt);\r
\r
VOID\r
CVfrCompiler::OptionInitialization (\r
- IN INT32 Argc, \r
+ IN INT32 Argc,\r
IN CHAR8 **Argv\r
)\r
{\r
mOptions.AutoDefault = FALSE;\r
mOptions.CheckDefault = FALSE;\r
memset (&mOptions.OverrideClassGuid, 0, sizeof (EFI_GUID));\r
- \r
+\r
if (Argc == 1) {\r
Usage ();\r
SET_RUN_STATUS (STATUS_DEAD);\r
} else if (stricmp(Argv[Index], "-i") == 0) {\r
Index++;\r
if ((Index >= Argc) || (Argv[Index][0] == '-')) {\r
- DebugError (NULL, 0, 1001, "Missing option", "-i missing path argument"); \r
+ DebugError (NULL, 0, 1001, "Missing option", "-i missing path argument");\r
goto Fail;\r
}\r
\r
goto Fail;\r
}\r
strcpy (mOptions.OutputDirectory, Argv[Index]);\r
- \r
+\r
CHAR8 lastChar = mOptions.OutputDirectory[strlen(mOptions.OutputDirectory) - 1];\r
if ((lastChar != '/') && (lastChar != '\\')) {\r
if (strchr(mOptions.OutputDirectory, '/') != NULL) {\r
if (mOptions.IncludePaths != NULL) {\r
delete mOptions.IncludePaths;\r
mOptions.IncludePaths = NULL;\r
- } \r
+ }\r
if (mOptions.CPreprocessorOptions != NULL) {\r
delete mOptions.CPreprocessorOptions;\r
mOptions.CPreprocessorOptions = NULL;\r
}\r
\r
CVfrCompiler::CVfrCompiler (\r
- IN INT32 Argc, \r
+ IN INT32 Argc,\r
IN CHAR8 **Argv\r
)\r
{\r
SET_RUN_STATUS(STATUS_DEAD);\r
}\r
\r
-VOID \r
+VOID\r
CVfrCompiler::Usage (\r
VOID\r
)\r
{\r
UINT32 Index;\r
CONST CHAR8 *Help[] = {\r
- " ", \r
+ " ",\r
"VfrCompile version " VFR_COMPILER_VERSION "Build " __BUILD_VERSION,\r
"Copyright (c) 2004-2016 Intel Corporation. All rights reserved.",\r
" ",\r
}\r
}\r
\r
-VOID \r
+VOID\r
CVfrCompiler::Version (\r
VOID\r
)\r
}\r
fclose (pVfrFile);\r
\r
- CmdLen = strlen (mPreProcessCmd) + strlen (mPreProcessOpt) + \r
- strlen (mOptions.VfrFileName) + strlen (mOptions.PreprocessorOutputFileName);\r
+ CmdLen = strlen (mPreProcessCmd) + strlen (mPreProcessOpt) +\r
+ strlen (mOptions.VfrFileName) + strlen (mOptions.PreprocessorOutputFileName);\r
if (mOptions.CPreprocessorOptions != NULL) {\r
CmdLen += strlen (mOptions.CPreprocessorOptions);\r
}\r
// Get Package Data and IfrRecord Data\r
//\r
gCFormPkg.BuildPkg (gCBuffer);\r
- gCIfrRecordInfoDB.IfrRecordOutput (gRBuffer); \r
+ gCIfrRecordInfoDB.IfrRecordOutput (gRBuffer);\r
\r
//\r
// Compare Form and Record data\r
//\r
// Re get the IfrRecord Buffer.\r
//\r
- gCIfrRecordInfoDB.IfrRecordOutput (gRBuffer); \r
+ gCIfrRecordInfoDB.IfrRecordOutput (gRBuffer);\r
}\r
\r
return;\r
if (!IS_RUN_STATUS(STATUS_GENBINARY)) {\r
goto Fail;\r
}\r
- \r
+\r
if (!mOptions.CreateIfrPkgFile || mOptions.CompatibleMode) {\r
if ((pFile = fopen (LongFilePath (mOptions.COutputFileName), "w")) == NULL) {\r
DebugError (NULL, 0, 0001, "Error opening output C file", "%s", mOptions.COutputFileName);\r
fprintf (pFile, "%s\n", gSourceFileHeader[Index]);\r
}\r
\r
- if (mOptions.CompatibleMode) { \r
+ if (mOptions.CompatibleMode) {\r
gCVfrBufferConfig.OutputCFile (pFile, mOptions.VfrBaseFileName);\r
}\r
\r
gCIfrRecordInfoDB.IfrRecordOutput (pOutFile, LineNo);\r
}\r
}\r
- \r
+\r
fprintf (pOutFile, "\n//\n// All Opcode Record List \n//\n");\r
gCIfrRecordInfoDB.IfrRecordOutput (pOutFile, 0);\r
gCVfrVarDataTypeDB.Dump(pOutFile);\r
\r
int\r
main (\r
- IN int Argc, \r
+ IN int Argc,\r
IN char **Argv\r
)\r
{\r
\r
SetPrintLevel(WARNING_LOG_LEVEL);\r
CVfrCompiler Compiler(Argc, Argv);\r
- \r
+\r
Compiler.PreProcess();\r
Compiler.Compile();\r
Compiler.AdjustBin();\r
if (gCBuffer.Buffer != NULL) {\r
delete[] gCBuffer.Buffer;\r
}\r
- \r
+\r
if (gRBuffer.Buffer != NULL) {\r
delete[] gRBuffer.Buffer;\r
}\r