diff --git a/Tools/Source/TianoTools/PeiRebase/PeiRebaseExe.c b/Tools/Source/TianoTools/PeiRebase/PeiRebaseExe.c index 7b48b67d24..94c0ded3df 100644 --- a/Tools/Source/TianoTools/PeiRebase/PeiRebaseExe.c +++ b/Tools/Source/TianoTools/PeiRebase/PeiRebaseExe.c @@ -31,6 +31,7 @@ Abstract: #include #include +#include "CommonLib.h" #include "ParseInf.h" #include "FvLib.h" #include "EfiUtilityMsgs.h" diff --git a/Tools/Source/TianoTools/String/String.c b/Tools/Source/TianoTools/String/String.c index 0e4993a4be..1f09dab724 100644 --- a/Tools/Source/TianoTools/String/String.c +++ b/Tools/Source/TianoTools/String/String.c @@ -20,6 +20,64 @@ #include "CommonLib.h" +/** + Returns the length of a Null-terminated Unicode string. + + This function returns the number of Unicode characters in the Null-terminated + Unicode string specified by String. + + If String is NULL, then ASSERT(). + + @param String Pointer to a Null-terminated Unicode string. + + @return The length of String. + +**/ +UINTN +EFIAPI +StrLen ( + IN CONST CHAR16 *String + ) +{ + UINTN Length; + + ASSERT (String != NULL); + + for (Length = 0; *String != L'\0'; String++, Length++) { + ; + } + return Length; +} + +/** + Returns the length of a Null-terminated ASCII string. + + This function returns the number of ASCII characters in the Null-terminated + ASCII string specified by String. + + If String is NULL, then ASSERT(). + + @param String Pointer to a Null-terminated ASCII string. + + @return The length of String. + +**/ +UINTN +EFIAPI +AsciiStrLen ( + IN CONST CHAR8 *String + ) +{ + UINTN Length; + + ASSERT (String != NULL); + + for (Length = 0; *String != '\0'; String++, Length++) { + ; + } + return Length; +} + /** Copies one Null-terminated Unicode string to another Null-terminated Unicode string and returns the new Unicode string. @@ -127,35 +185,6 @@ StrnCpy ( return ReturnValue; } -/** - Returns the length of a Null-terminated Unicode string. - - This function returns the number of Unicode characters in the Null-terminated - Unicode string specified by String. - - If String is NULL, then ASSERT(). - - @param String Pointer to a Null-terminated Unicode string. - - @return The length of String. - -**/ -UINTN -EFIAPI -StrLen ( - IN CONST CHAR16 *String - ) -{ - UINTN Length; - - ASSERT (String != NULL); - - for (Length = 0; *String != L'\0'; String++, Length++) { - ; - } - return Length; -} - /** Returns the size of a Null-terminated Unicode string in bytes, including the Null terminator. @@ -454,35 +483,6 @@ AsciiStrnCpy ( return ReturnValue; } -/** - Returns the length of a Null-terminated ASCII string. - - This function returns the number of ASCII characters in the Null-terminated - ASCII string specified by String. - - If String is NULL, then ASSERT(). - - @param String Pointer to a Null-terminated ASCII string. - - @return The length of String. - -**/ -UINTN -EFIAPI -AsciiStrLen ( - IN CONST CHAR8 *String - ) -{ - UINTN Length; - - ASSERT (String != NULL); - - for (Length = 0; *String != '\0'; String++, Length++) { - ; - } - return Length; -} - /** Returns the size of a Null-terminated ASCII string in bytes, including the Null terminator.