/** @file\r
+This contains some useful functions for parsing INF files.\r
\r
-Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2016, 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
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
-Module Name:\r
-\r
- ParseInf.c\r
-\r
-Abstract:\r
-\r
- This contains some useful functions for parsing INF files.\r
-\r
---*/\r
+**/\r
\r
#include <assert.h>\r
#include <string.h>\r
#include <stdlib.h>\r
#include "EfiUtilityMsgs.h"\r
#include "ParseInf.h"\r
+#include "CommonLib.h"\r
\r
CHAR8 *\r
ReadLine (\r
Arguments:\r
\r
InputFile Memory file image.\r
- InputBuffer Buffer to read into, must be _MAX_PATH size.\r
+ InputBuffer Buffer to read into, must be MaxLength size.\r
MaxLength The maximum size of the input buffer.\r
\r
Returns:\r
\r
--*/\r
{\r
- CHAR8 InputBuffer[_MAX_PATH];\r
+ CHAR8 InputBuffer[MAX_LONG_FILE_PATH];\r
CHAR8 *CurrentToken;\r
\r
//\r
//\r
// Read a line\r
//\r
- ReadLine (InputFile, InputBuffer, _MAX_PATH);\r
+ ReadLine (InputFile, InputBuffer, MAX_LONG_FILE_PATH);\r
\r
//\r
// Check if the section is found\r
Section The section to search for, a string within [].\r
Token The token to search for, e.g. EFI_PEIM_RECOVERY, followed by an = in the INF file.\r
Instance The instance of the token to search for. Zero is the first instance.\r
- Value The string that holds the value following the =. Must be _MAX_PATH in size.\r
+ Value The string that holds the value following the =. Must be MAX_LONG_FILE_PATH in size.\r
\r
Returns:\r
\r
\r
--*/\r
{\r
- CHAR8 InputBuffer[_MAX_PATH];\r
+ CHAR8 InputBuffer[MAX_LONG_FILE_PATH];\r
CHAR8 *CurrentToken;\r
CHAR8 *Delimiter;\r
BOOLEAN ParseError;\r
//\r
// Read a line from the file\r
//\r
- if (ReadLine (InputFile, InputBuffer, _MAX_PATH) == NULL) {\r
+ if (ReadLine (InputFile, InputBuffer, MAX_LONG_FILE_PATH) == NULL) {\r
//\r
// Error reading from input file\r
//\r
--*/\r
{\r
INT32 Index;\r
- unsigned Data1;\r
- unsigned Data2;\r
- unsigned Data3;\r
- unsigned Data4[8];\r
+ int Data1;\r
+ int Data2;\r
+ int Data3;\r
+ int Data4[8];\r
\r
if (AsciiGuidBuffer == NULL || GuidBuffer == NULL) {\r
return EFI_INVALID_PARAMETER;\r
Index = 0;\r
\r
//\r
- // Check input paramter\r
+ // Check input parameter\r
//\r
if (AsciiString == NULL || ReturnValue == NULL) {\r
return EFI_INVALID_PARAMETER;\r
Arguments:\r
\r
InputFile Stream pointer.\r
- InputBuffer Buffer to read into, must be _MAX_PATH size.\r
+ InputBuffer Buffer to read into, must be MAX_LONG_FILE_PATH size.\r
\r
Returns:\r
\r
//\r
// Read a line\r
//\r
- if (fgets (InputBuffer, _MAX_PATH, InputFile) == NULL) {\r
+ if (fgets (InputBuffer, MAX_LONG_FILE_PATH, InputFile) == NULL) {\r
return NULL;\r
}\r
//\r
\r
--*/\r
{\r
- CHAR8 InputBuffer[_MAX_PATH];\r
+ CHAR8 InputBuffer[MAX_LONG_FILE_PATH];\r
CHAR8 *CurrentToken;\r
\r
//\r