Argc--;\r
Argv++;\r
\r
- if (Argc < 1) {\r
+ if (Argc == 0) {\r
Usage ();\r
return STATUS_ERROR;\r
}\r
/*++\r
\r
-Copyright (c) 2004, Intel Corporation \r
+Copyright (c) 2004 - 2007, Intel Corporation \r
All rights reserved. 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
// Define a structure that correlates filename extensions to an enumerated\r
// type.\r
//\r
+\r
+#define UTILITY_NAME "GuidChk"\r
+#define UTILITY_MAJOR_VERSION 1\r
+#define UTILITY_MINOR_VERSION 0\r
+\r
typedef struct {\r
INT8 *Extension;\r
INT8 ExtensionCode;\r
char *Argv[]\r
);\r
\r
+static\r
+VOID\r
+Version (\r
+ VOID\r
+ );\r
+\r
static\r
VOID\r
Usage (\r
Usage ();\r
return STATUS_ERROR;\r
}\r
-\r
+ \r
+ if ((strcmp(Argv[0], "-h") == 0) || (strcmp(Argv[0], "--help") == 0) ||\r
+ (strcmp(Argv[0], "-?") == 0) || (strcmp(Argv[0], "/?") == 0)) {\r
+ Usage();\r
+ return STATUS_ERROR;\r
+ }\r
+ \r
+ if ((strcmp(Argv[0], "-V") == 0) || (strcmp(Argv[0], "--version") == 0)) {\r
+ Version();\r
+ return STATUS_ERROR;\r
+ }\r
+ \r
while (Argc > 0) {\r
//\r
// Look for options\r
\r
return STATUS_SUCCESS;\r
}\r
+\r
+static\r
+void \r
+Version(\r
+ void\r
+)\r
+/*++\r
+\r
+Routine Description:\r
+\r
+ Displays the standard utility information to SDTOUT\r
+\r
+Arguments:\r
+\r
+ None\r
+\r
+Returns:\r
+\r
+ None\r
+\r
+--*/\r
+{\r
+ printf ("%s v%d.%d -Utility for checking guid duplication for files in a given directory.\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION);\r
+ printf ("Copyright (c) 1999-2007 Intel Corporation. All rights reserved.\n");\r
+}\r
+\r
//\r
// Print usage instructions\r
//\r
"",\r
"Usage: GuidChk {options}\n",\r
" Options: ",\r
- " -d dirname exclude searching of a directory",\r
- " -f filename exclude searching of a file",\r
- " -e extension exclude searching of files by extension",\r
- " -p print all GUIDS found",\r
- " -g check for duplicate guids",\r
- " -s check for duplicate signatures",\r
- " -x print guid+defined symbol name",\r
- " -b outfile write internal GUID+basename list to outfile",\r
- " -u dirname exclude searching all subdirectories of a directory",\r
- " -h -? print this help text",\r
+ " -d dirname exclude searching of a directory",\r
+ " -f filename exclude searching of a file",\r
+ " -e extension exclude searching of files by extension",\r
+ " -p print all GUIDS found",\r
+ " -g check for duplicate guids",\r
+ " -s check for duplicate signatures",\r
+ " -x print guid+defined symbol name",\r
+ " -b outfile write internal GUID+basename list to outfile",\r
+ " -u dirname exclude searching all subdirectories of a directory",\r
+ " -h,--help,-?,/? display help messages",\r
+ " -V,--version display version information",\r
" ",\r
" Example: GuidChk -g -u build -d fv -f make.inf -e .pkg",\r
"",\r
NULL\r
};\r
+ \r
+ Version();\r
+ \r
for (Index = 0; Str[Index] != NULL; Index++) {\r
fprintf (stdout, "%s\n", Str[Index]);\r
}\r
/*++\r
\r
-Copyright (c) 2004, Intel Corporation \r
+Copyright (c) 2004 - 20077, Intel Corporation \r
All rights reserved. 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
char *Str;\r
} STRING_LIST;\r
\r
-#define UTILITY_NAME "MakeDeps"\r
+#define UTILITY_NAME "MakeDeps"\r
+#define UTILITY_MAJOR_VERSION 1\r
+#define UTILITY_MINOR_VERSION 0\r
\r
#define MAX_LINE_LEN 2048\r
#define MAX_PATH 2048\r
char *Argv[]\r
);\r
\r
+static\r
+void\r
+Version (\r
+ VOID\r
+ );\r
+\r
static\r
void\r
Usage (\r
//\r
Argc--;\r
Argv++;\r
+ \r
+ if (Argc == 0) {\r
+ Usage ();\r
+ return STATUS_ERROR;\r
+ }\r
+ \r
+ if ((strcmp(Argv[0], "-h") == 0) || (strcmp(Argv[0], "--help") == 0) ||\r
+ (strcmp(Argv[0], "-?") == 0) || (strcmp(Argv[0], "/?") == 0)) {\r
+ Usage();\r
+ return STATUS_ERROR;\r
+ }\r
+ \r
+ if ((strcmp(Argv[0], "-V") == 0) || (strcmp(Argv[0], "--version") == 0)) {\r
+ Version();\r
+ return STATUS_ERROR;\r
+ }\r
+\r
//\r
// Initialize locals\r
//\r
//\r
}\r
\r
+static\r
+void \r
+Version(\r
+ void\r
+)\r
+/*++\r
+\r
+Routine Description:\r
+\r
+ Displays the standard utility information to SDTOUT\r
+\r
+Arguments:\r
+\r
+ None\r
+\r
+Returns:\r
+\r
+ None\r
+\r
+--*/\r
+{\r
+ printf ("%s v%d.%d -Utility for generating file dependency lists for files in a given directory.\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION);\r
+ printf ("Copyright (c) 1999-2007 Intel Corporation. All rights reserved.\n");\r
+}\r
+\r
static\r
void\r
Usage (\r
UTILITY_NAME " -- make dependencies",\r
" Usage: MakeDeps [options]",\r
" Options include:",\r
- " -h or -? for this help information",\r
+ " -h,--help,-?,/? display help messages",\r
+ " -V,--version display version information",\r
" -f SourceFile add SourceFile to list of files to scan",\r
" -i IncludePath add IncludePath to list of search paths",\r
" -o OutputFile write output dependencies to OutputFile",\r
"",\r
NULL\r
};\r
+ \r
+ Version();\r
+ \r
for (Index = 0; Str[Index] != NULL; Index++) {\r
fprintf (stdout, "%s\n", Str[Index]);\r
}\r
/*++\r
\r
-Copyright (c) 2004-2006 Intel Corporation. All rights reserved\r
+Copyright (c) 2004-2007 Intel Corporation. All rights reserved\r
This program and the accompanying materials are licensed and made available \r
under the terms and conditions of the BSD License which accompanies this \r
distribution. The full text of the license may be found at\r
UINT8 ApResetVector[5] = {0xEA, 0xD0, 0xFF, 0x00, 0xF0};\r
\r
VOID\r
-PrintUtilityInfo (\r
+Version (\r
VOID\r
)\r
/*++\r
\r
--*/\r
{\r
- printf (\r
- "%s - Tiano IA32 SEC Ap Reset Vector Fixup Utility."" Version %i.%i\n\n",\r
- UTILITY_NAME,\r
- UTILITY_MAJOR_VERSION,\r
- UTILITY_MINOR_VERSION\r
- );\r
+ printf ("%s v%d.%d -Tiano IA32 SEC Ap Reset Vector Fixup Utility.\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION);\r
+ printf ("Copyright (c) 1999-2007 Intel Corporation. All rights reserved.\n");\r
}\r
\r
VOID\r
-PrintUsage (\r
+Usage (\r
VOID\r
)\r
/*++\r
\r
--*/\r
{\r
- printf ("Usage: %s InputFvrecoveryFile OutputFvrecoveryFile\n", UTILITY_NAME);\r
+ Version();\r
+ \r
+ printf ("\nUsage: %s InputFvrecoveryFile OutputFvrecoveryFile\n", UTILITY_NAME);\r
printf (" Where:\n");\r
- printf ("\tInputFvrecoveryFile - Name of the IA32 input Fvrecovery.fv file.\n");\r
- printf ("\tOutputFvrecoveryFile - Name of the IA32 output Fvrecovery.fv file.\n");\r
+ printf (" InputFvrecoveryFile - Name of the IA32 input Fvrecovery.fv file.\n");\r
+ printf (" OutputFvrecoveryFile - Name of the IA32 output Fvrecovery.fv file.\n");\r
}\r
\r
\r
TempGuid = NULL;\r
SetUtilityName (UTILITY_NAME);\r
\r
- //\r
- // Display utility information\r
- //\r
- PrintUtilityInfo ();\r
-\r
+ if (argc == 1) {\r
+ Usage();\r
+ return STATUS_ERROR;\r
+ }\r
+ \r
+ if ((strcmp(argv[1], "-h") == 0) || (strcmp(argv[1], "--help") == 0) ||\r
+ (strcmp(argv[1], "-?") == 0) || (strcmp(argv[1], "/?") == 0)) {\r
+ Usage();\r
+ return STATUS_ERROR;\r
+ }\r
+ \r
+ if ((strcmp(argv[1], "-V") == 0) || (strcmp(argv[1], "--version") == 0)) {\r
+ Version();\r
+ return STATUS_ERROR;\r
+ }\r
+ \r
//\r
// Verify the correct number of arguments\r
//\r
if (argc != MAX_ARGS) {\r
Error (NULL, 0, 0, "invalid number of input parameters specified", NULL);\r
- PrintUsage ();\r
+ Usage ();\r
return STATUS_ERROR;\r
}\r
//\r