mirror of
https://github.com/acidanthera/OpenCorePkg.git
synced 2025-12-08 19:25:01 +00:00
OcStringLib: Import MixedStrCmp()
This commit is contained in:
parent
68eb9595d4
commit
557b3f18d1
@ -557,4 +557,27 @@ HasValidGuidStringPrefix (
|
||||
IN CONST CHAR16 *String
|
||||
);
|
||||
|
||||
/**
|
||||
Compares two Null-terminated Unocide and ASCII strings, and returns the
|
||||
difference between the first mismatched characters.
|
||||
|
||||
This function compares the Null-terminated Unicode string FirstString to the
|
||||
Null-terminated ASCII string SecondString. If FirstString is identical to
|
||||
SecondString, then 0 is returned. Otherwise, the value returned is the first
|
||||
mismatched character in SecondString subtracted from the first mismatched
|
||||
character in FirstString.
|
||||
|
||||
@param FirstString A pointer to a Null-terminated Unicode string.
|
||||
@param SecondString A pointer to a Null-terminated ASCII string.
|
||||
|
||||
@retval ==0 FirstString is identical to SecondString.
|
||||
@retval !=0 FirstString is not identical to SecondString.
|
||||
|
||||
**/
|
||||
INTN
|
||||
MixedStrCmp (
|
||||
IN CONST CHAR16 *FirstString,
|
||||
IN CONST CHAR8 *SecondString
|
||||
);
|
||||
|
||||
#endif // OC_STRING_LIB_H
|
||||
|
||||
@ -405,3 +405,17 @@ HasValidGuidStringPrefix (
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
INTN
|
||||
MixedStrCmp (
|
||||
IN CONST CHAR16 *FirstString,
|
||||
IN CONST CHAR8 *SecondString
|
||||
)
|
||||
{
|
||||
while (*FirstString != '\0' && *FirstString == *SecondString) {
|
||||
++FirstString;
|
||||
++SecondString;
|
||||
}
|
||||
|
||||
return *FirstString - *SecondString;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user