#include "stdio.h"\r
#include "string.h"\r
\r
+#define UTILITY_NAME "ModifyInf"\r
+#define UTILITY_MAJOR_VERSION 1\r
+#define UTILITY_MINOR_VERSION 1\r
+\r
//\r
// Read a line into buffer including '\r\n'\r
//\r
return 0;\r
}\r
\r
-void\r
-Usage (\r
+void \r
+MIVersion(\r
void\r
)\r
/*++\r
\r
Routine Description:\r
\r
- GC_TODO: Add function description\r
+ Print out version information for Strip.\r
\r
Arguments:\r
\r
None\r
-\r
+ \r
Returns:\r
\r
- GC_TODO: add return values\r
+ None\r
+ \r
+--*/ \r
+{\r
+ printf ("%s v%d.%d -EDK Modify fields in FV inf files.\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION);\r
+ printf ("Copyright (c) 2005-2006 Intel Corporation. All rights reserved.\n");\r
+}\r
\r
---*/\r
+void \r
+MIUsage(\r
+ void\r
+ )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+ Print out usage information for Strip.\r
+\r
+Arguments:\r
+\r
+ None\r
+ \r
+Returns:\r
+\r
+ None\r
+ \r
+--*/ \r
{\r
- printf ("ModifyInf InputFVInfFileName OutputFVInfFileName [Pattern strings]\r\n");\r
+ MIVersion();\r
+ printf ("\n Usage: %s InputFile OutputFile Pattern_String [Pattern_String ¡]\n\\r
+ Where: \n\\r
+ Pattern_String is of the format (note that the section name must be \n\\r
+ enclosed within square brackets):\n\\r
+ [section]FieldKey<op>Value [(FieldKey<op>Value) ¡] \n\\r
+ The operator, <op>, must be one of the following: \n\\r
+ '==' replace a field value with a new value \n\\r
+ '+=' append a string at the end of original line \n\\r
+ '-' prevent the line from applying any patterns \n\\r
+ Example: \n\\r
+ ModifyInf BuildRootFvFvMain.inf BuildRootFvFvMainEXP.inf \\ \n\\r
+ [files]EFI_FILE_NAME+=.Org EFI_NUM_BLOCKS==0x20 \\ \n\\r
+ [options]EFI_FILENAME==FcMainCompact.fv -DpsdSignature.dxe \n", UTILITY_NAME);\r
}\r
\r
+\r
int\r
main (\r
int argc,\r
FILE *fpin;\r
FILE *fpout;\r
\r
+ if (argc < 1) {\r
+ MIUsage();\r
+ return -1;\r
+ }\r
+ \r
+ if ((strcmp(argv[1], "-h") == 0) || (strcmp(argv[1], "--help") == 0) ||\r
+ (strcmp(argv[1], "-?") == 0) || (strcmp(argv[1], "/?") == 0)) {\r
+ MIUsage();\r
+ return 0;\r
+ }\r
+ \r
+ if ((strcmp(argv[1], "-V") == 0) || (strcmp(argv[1], "--version") == 0)) {\r
+ MIVersion();\r
+ return 0;\r
+ }\r
+ \r
if (argc < 3) {\r
- Usage ();\r
+ MIUsage();\r
return -1;\r
}\r
\r