Performs a case insensitive comparison of two Null-terminated ASCII strings, and returns the difference between the first mismatched ASCII characters. This function performs a case insensitive comparison of the Null-terminated ASCII string FirstString to the Null-terminated ASCII string SecondString. If FirstString is identical to SecondString, then 0 is returned. Otherwise, the v
| 1387 | |
| 1388 | **/ |
| 1389 | INTN |
| 1390 | EFIAPI |
| 1391 | AsciiStriCmp ( |
| 1392 | IN CONST CHAR8 *FirstString, |
| 1393 | IN CONST CHAR8 *SecondString |
| 1394 | ) |
| 1395 | { |
| 1396 | CHAR8 UpperFirstString; |
| 1397 | CHAR8 UpperSecondString; |
| 1398 | |
| 1399 | // |
| 1400 | // ASSERT both strings are less long than PcdMaximumAsciiStringLength |
| 1401 | // |
| 1402 | // ASSERT (AsciiStrSize (FirstString)); |
| 1403 | // ASSERT (AsciiStrSize (SecondString)); |
| 1404 | if (!AsciiStrSize (FirstString) && !AsciiStrSize (SecondString)) { |
| 1405 | return 0; |
| 1406 | } |
| 1407 | if (!AsciiStrSize (FirstString)) { |
| 1408 | return -1; |
| 1409 | } |
| 1410 | if (!AsciiStrSize (SecondString)) { |
| 1411 | return 1; |
| 1412 | } |
| 1413 | |
| 1414 | UpperFirstString = AsciiCharToUpper (*FirstString); |
| 1415 | UpperSecondString = AsciiCharToUpper (*SecondString); |
| 1416 | while ((*FirstString != '\0') && (*SecondString != '\0') && (UpperFirstString == UpperSecondString)) { |
| 1417 | FirstString++; |
| 1418 | SecondString++; |
| 1419 | UpperFirstString = AsciiCharToUpper (*FirstString); |
| 1420 | UpperSecondString = AsciiCharToUpper (*SecondString); |
| 1421 | } |
| 1422 | |
| 1423 | return UpperFirstString - UpperSecondString; |
| 1424 | } |
| 1425 | |
| 1426 | /** |
| 1427 | Compares two Null-terminated ASCII strings with maximum lengths, and returns |
no test coverage detected