/** @file\r
This contains some useful functions for parsing INF files.\r
\r
-Copyright (c) 2004 - 2014, 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
+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
\r
**/\r
\r
Routine Description:\r
\r
This function reads a line, stripping any comments.\r
- The function reads a string from the input stream argument and stores it in \r
- the input string. ReadLine reads characters from the current file position \r
- to and including the first newline character, to the end of the stream, or \r
- until the number of characters read is equal to MaxLength - 1, whichever \r
- comes first. The newline character, if read, is replaced with a \0. \r
+ The function reads a string from the input stream argument and stores it in\r
+ the input string. ReadLine reads characters from the current file position\r
+ to and including the first newline character, to the end of the stream, or\r
+ until the number of characters read is equal to MaxLength - 1, whichever\r
+ comes first. The newline character, if read, is replaced with a \0.\r
\r
Arguments:\r
\r
)\r
/*++\r
\r
-Routine Description: \r
+Routine Description:\r
\r
- Converts a string to an EFI_GUID. The string must be in the \r
+ Converts a string to an EFI_GUID. The string must be in the\r
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx format.\r
\r
-Arguments: \r
+Arguments:\r
\r
AsciiGuidBuffer - pointer to ascii string\r
GuidBuffer - pointer to destination Guid\r
\r
-Returns: \r
+Returns:\r
\r
EFI_ABORTED Could not convert the string\r
EFI_SUCCESS The string was successfully converted\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
break;\r
}\r
} else {\r
- if (((AsciiGuidBuffer[Index] >= '0') && (AsciiGuidBuffer[Index] <= '9')) || \r
+ if (((AsciiGuidBuffer[Index] >= '0') && (AsciiGuidBuffer[Index] <= '9')) ||\r
((AsciiGuidBuffer[Index] >= 'a') && (AsciiGuidBuffer[Index] <= 'f')) ||\r
((AsciiGuidBuffer[Index] >= 'A') && (AsciiGuidBuffer[Index] <= 'F'))) {\r
continue;\r
}\r
}\r
}\r
- \r
+\r
if (Index < 36 || AsciiGuidBuffer[36] != '\0') {\r
Error (NULL, 0, 1003, "Invalid option value", "Incorrect GUID \"%s\"\n Correct Format \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\"", AsciiGuidBuffer);\r
return EFI_ABORTED;\r
}\r
- \r
+\r
//\r
// Scan the guid string into the buffer\r
//\r
\r
Routine Description:\r
\r
- Converts a null terminated ascii string that represents a number into a \r
- UINT64 value. A hex number may be preceeded by a 0x, but may not be \r
- succeeded by an h. A number without 0x or 0X is considered to be base 10 \r
+ Converts a null terminated ascii string that represents a number into a\r
+ UINT64 value. A hex number may be preceeded by a 0x, but may not be\r
+ succeeded by an h. A number without 0x or 0X is considered to be base 10\r
unless the IsHex input is true.\r
\r
Arguments:\r
UINT8 Index;\r
UINT64 Value;\r
CHAR8 CurrentChar;\r
- \r
+\r
//\r
// Initialize the result\r
//\r
Value = 0;\r
Index = 0;\r
- \r
+\r
//\r
// Check input parameter\r
//\r
while (AsciiString[Index] == ' ') {\r
Index ++;\r
}\r
- \r
+\r
//\r
// Add each character to the result\r
//\r
- \r
+\r
//\r
// Skip first two chars only if the string starts with '0x' or '0X'\r
//\r