Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php.
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
[ATTENTION] This function will be deprecated for security reason.
Concatenates one Null-terminated ASCII string to another Null-terminated ASCII string, and returns the concatenated ASCII string.
This function concatenates two Null-terminated ASCII strings. The contents of Null-terminated ASCII string Source are concatenated to the end of Null- terminated ASCII string Destination. The Null-terminated concatenated ASCII String is returned.
If Destination is NULL, then ASSERT(). If Source is NULL, then ASSERT(). If PcdMaximumAsciiStringLength is not zero and Destination contains more than PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator, then ASSERT(). If PcdMaximumAsciiStringLength is not zero and Source contains more than PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator, then ASSERT(). If PcdMaximumAsciiStringLength is not zero and concatenating Destination and Source results in a ASCII string with more than PcdMaximumAsciiStringLength ASCII characters, then ASSERT().
Destination | A pointer to a Null-terminated ASCII string. | |
Source | A pointer to a Null-terminated ASCII string. |
References AsciiStrCpy(), AsciiStrLen(), AsciiStrSize(), and ASSERT.
Compares two Null-terminated ASCII strings, and returns the difference between the first mismatched ASCII characters.
This function compares 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 value returned is the first mismatched ASCII character in SecondString subtracted from the first mismatched ASCII character in FirstString.
If FirstString is NULL, then ASSERT(). If SecondString is NULL, then ASSERT(). If PcdMaximumAsciiStringLength is not zero and FirstString contains more than PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator, then ASSERT(). If PcdMaximumAsciiStringLength is not zero and SecondString contains more than PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator, then ASSERT().
FirstString | A pointer to a Null-terminated ASCII string. | |
SecondString | A pointer to a Null-terminated ASCII string. |
==0 | FirstString is identical to SecondString. | |
!=0 | FirstString is not identical to SecondString. |
References AsciiStrSize(), and ASSERT.
[ATTENTION] This function will be deprecated for security reason.
Copies one Null-terminated ASCII string to another Null-terminated ASCII string and returns the new ASCII string.
This function copies the contents of the ASCII string Source to the ASCII string Destination, and returns Destination. If Source and Destination overlap, then the results are undefined.
If Destination is NULL, then ASSERT(). If Source is NULL, then ASSERT(). If Source and Destination overlap, then ASSERT(). If PcdMaximumAsciiStringLength is not zero and Source contains more than PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator, then ASSERT().
Destination | A pointer to a Null-terminated ASCII string. | |
Source | A pointer to a Null-terminated ASCII string. |
References AsciiStrLen(), ASSERT, and NULL.
Referenced by AsciiStrCat().
Convert a Null-terminated ASCII decimal string to a value of type UINT64.
This function returns a value of type UINT64 by interpreting the contents of the ASCII string String as a decimal number. The format of the input ASCII string String is:
[spaces] [decimal digits].
The valid decimal digit character is in the range [0-9]. The function will ignore the pad space, which includes spaces or tab characters, before the digits. The running zero in the beginning of [decimal digits] will be ignored. Then, the function stops at the first character that is a not a valid decimal character or Null-terminator, whichever on comes first.
If String has only pad spaces, then 0 is returned. If String has no pad spaces or valid decimal digits, then 0 is returned. If the number represented by String overflows according to the range defined by UINT64, then ASSERT(). If String is NULL, then ASSERT(). If PcdMaximumAsciiStringLength is not zero, and String contains more than PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then ASSERT().
String | A pointer to a Null-terminated ASCII string. |
Value | translated from String. |
References AsciiStrSize(), ASSERT, DivU64x32(), InternalAsciiIsDecimalDigitCharacter(), and MultU64x32().
Convert a Null-terminated ASCII decimal string to a value of type UINTN.
This function returns a value of type UINTN by interpreting the contents of the ASCII string String as a decimal number. The format of the input ASCII string String is:
[spaces] [decimal digits].
The valid decimal digit character is in the range [0-9]. The function will ignore the pad space, which includes spaces or tab characters, before the digits. The running zero in the beginning of [decimal digits] will be ignored. Then, the function stops at the first character that is a not a valid decimal character or Null-terminator, whichever on comes first.
If String has only pad spaces, then 0 is returned. If String has no pad spaces or valid decimal digits, then 0 is returned. If the number represented by String overflows according to the range defined by UINTN, then ASSERT(). If String is NULL, then ASSERT(). If PcdMaximumAsciiStringLength is not zero, and String contains more than PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then ASSERT().
String | A pointer to a Null-terminated ASCII string. |
Value | translated from String. |
References AsciiStrSize(), ASSERT, and InternalAsciiIsDecimalDigitCharacter().
Convert a Null-terminated ASCII hexadecimal string to a value of type UINT64.
This function returns a value of type UINT64 by interpreting the contents of the ASCII string String as a hexadecimal number. The format of the input ASCII string String is:
[spaces][zeros][x][hexadecimal digits].
The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F]. The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix. If "x" appears in the input string, it must be prefixed with at least one 0. The function will ignore the pad space, which includes spaces or tab characters, before [zeros], [x] or [hexadecimal digits]. The running zero before [x] or [hexadecimal digits] will be ignored. Then, the decoding starts after [x] or the first valid hexadecimal digit. Then, the function stops at the first character that is a not a valid hexadecimal character or Null-terminator, whichever on comes first.
If String has only pad spaces, then 0 is returned. If String has no leading pad spaces, leading zeros or valid hexadecimal digits, then 0 is returned.
If the number represented by String overflows according to the range defined by UINT64, then ASSERT(). If String is NULL, then ASSERT(). If PcdMaximumAsciiStringLength is not zero, and String contains more than PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then ASSERT().
String | A pointer to a Null-terminated ASCII string. |
Value | translated from String. |
References AsciiStrSize(), ASSERT, InternalAsciiHexCharToUintn(), InternalAsciiIsHexaDecimalDigitCharacter(), InternalBaseLibAsciiToUpper(), InternalHexCharToUintn(), LShiftU64(), and RShiftU64().
Convert a Null-terminated ASCII hexadecimal string to a value of type UINTN.
This function returns a value of type UINTN by interpreting the contents of the ASCII string String as a hexadecimal number. The format of the input ASCII string String is:
[spaces][zeros][x][hexadecimal digits].
The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F]. The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix. If "x" appears in the input string, it must be prefixed with at least one 0. The function will ignore the pad space, which includes spaces or tab characters, before [zeros], [x] or [hexadecimal digits]. The running zero before [x] or [hexadecimal digits] will be ignored. Then, the decoding starts after [x] or the first valid hexadecimal digit. Then, the function stops at the first character that is a not a valid hexadecimal character or Null-terminator, whichever on comes first.
If String has only pad spaces, then 0 is returned. If String has no leading pad spaces, leading zeros or valid hexadecimal digits, then 0 is returned.
If the number represented by String overflows according to the range defined by UINTN, then ASSERT(). If String is NULL, then ASSERT(). If PcdMaximumAsciiStringLength is not zero, and String contains more than PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then ASSERT().
String | A pointer to a Null-terminated ASCII string. |
Value | translated from String. |
References AsciiStrSize(), ASSERT, InternalAsciiHexCharToUintn(), InternalAsciiIsHexaDecimalDigitCharacter(), InternalBaseLibAsciiToUpper(), and InternalHexCharToUintn().
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 value returned is the first mismatched lower case ASCII character in SecondString subtracted from the first mismatched lower case ASCII character in FirstString.
If FirstString is NULL, then ASSERT(). If SecondString is NULL, then ASSERT(). If PcdMaximumAsciiStringLength is not zero and FirstString contains more than PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator, then ASSERT(). If PcdMaximumAsciiStringLength is not zero and SecondString contains more than PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator, then ASSERT().
FirstString | A pointer to a Null-terminated ASCII string. | |
SecondString | A pointer to a Null-terminated ASCII string. |
==0 | FirstString is identical to SecondString using case insensitive comparisons. | |
!=0 | FirstString is not identical to SecondString using case insensitive comparisons. |
References AsciiStrSize(), ASSERT, and InternalBaseLibAsciiToUpper().
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 Length > 0 and Destination is NULL, then ASSERT(). If Length > 0 and Source is NULL, then ASSERT(). If PcdMaximumAsciiStringLength is not zero and String contains more than PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator, then ASSERT().
String | A pointer to a Null-terminated ASCII string. |
References ASSERT, NULL, and PcdGet32.
Referenced by AsciiStrCat(), AsciiStrCpy(), AsciiStrnCat(), AsciiStrnCpy(), AsciiStrSize(), AsciiStrToUnicodeStr(), DebugAssert(), DebugPrint(), DevPathToTextAcpiEx(), and GetBestLanguage().
[ATTENTION] This function will be deprecated for security reason.
Concatenates up to a specified length one Null-terminated ASCII string to the end of another Null-terminated ASCII string, and returns the concatenated ASCII string.
This function concatenates two Null-terminated ASCII strings. The contents of Null-terminated ASCII string Source are concatenated to the end of Null- terminated ASCII string Destination, and Destination is returned. At most, Length ASCII characters are concatenated from Source to the end of Destination, and Destination is always Null-terminated. If Length is 0, then Destination is returned unmodified. If Source and Destination overlap, then the results are undefined.
If Length > 0 and Destination is NULL, then ASSERT(). If Length > 0 and Source is NULL, then ASSERT(). If Source and Destination overlap, then ASSERT(). If PcdMaximumAsciiStringLength is not zero, and Length is greater than PcdMaximumAsciiStringLength, then ASSERT(). If PcdMaximumAsciiStringLength is not zero, and Destination contains more than PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator, then ASSERT(). If PcdMaximumAsciiStringLength is not zero, and Source contains more than PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator, then ASSERT(). If PcdMaximumAsciiStringLength is not zero, and concatenating Destination and Source results in a ASCII string with more than PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator, then ASSERT().
Destination | A pointer to a Null-terminated ASCII string. | |
Source | A pointer to a Null-terminated ASCII string. | |
Length | The maximum number of ASCII characters to concatenate from Source. |
References AsciiStrLen(), AsciiStrnCpy(), AsciiStrSize(), and ASSERT.
INTN EFIAPI AsciiStrnCmp | ( | IN CONST CHAR8 * | FirstString, | |
IN CONST CHAR8 * | SecondString, | |||
IN UINTN | Length | |||
) |
Compares two Null-terminated ASCII strings with maximum lengths, and returns the difference between the first mismatched ASCII characters.
This function compares the Null-terminated ASCII string FirstString to the Null-terminated ASCII string SecondString. At most, Length ASCII characters will be compared. If Length is 0, then 0 is returned. If FirstString is identical to SecondString, then 0 is returned. Otherwise, the value returned is the first mismatched ASCII character in SecondString subtracted from the first mismatched ASCII character in FirstString.
If Length > 0 and FirstString is NULL, then ASSERT(). If Length > 0 and SecondString is NULL, then ASSERT(). If PcdMaximumAsciiStringLength is not zero, and Length is greater than PcdMaximumAsciiStringLength, then ASSERT(). If PcdMaximumAsciiStringLength is not zero, and FirstString contains more than PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator, then ASSERT(). If PcdMaximumAsciiStringLength is not zero, and SecondString contains more than PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator, then ASSERT().
FirstString | A pointer to a Null-terminated ASCII string. | |
SecondString | A pointer to a Null-terminated ASCII string. | |
Length | The maximum number of ASCII characters for compare. |
==0 | FirstString is identical to SecondString. | |
!=0 | FirstString is not identical to SecondString. |
References AsciiStrSize(), ASSERT, and PcdGet32.
Referenced by AddUnicodeString2(), GetBestLanguage(), and LookupUnicodeString2().
[ATTENTION] This function will be deprecated for security reason.
Copies up to a specified length one Null-terminated ASCII string to another Null-terminated ASCII string and returns the new ASCII string.
This function copies the contents of the ASCII string Source to the ASCII string Destination, and returns Destination. At most, Length ASCII characters are copied from Source to Destination. If Length is 0, then Destination is returned unmodified. If Length is greater that the number of ASCII characters in Source, then Destination is padded with Null ASCII characters. If Source and Destination overlap, then the results are undefined.
If Destination is NULL, then ASSERT(). If Source is NULL, then ASSERT(). If Source and Destination overlap, then ASSERT(). If PcdMaximumAsciiStringLength is not zero, and Length is greater than PcdMaximumAsciiStringLength, then ASSERT(). If PcdMaximumAsciiStringLength is not zero, and Source contains more than PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator, then ASSERT().
Destination | A pointer to a Null-terminated ASCII string. | |
Source | A pointer to a Null-terminated ASCII string. | |
Length | The maximum number of ASCII characters to copy. |
References AsciiStrLen(), ASSERT, NULL, PcdGet32, and ZeroMem().
Referenced by AsciiStrnCat().
Returns the size of a Null-terminated ASCII string in bytes, including the Null terminator.
This function returns the size, in bytes, of the Null-terminated ASCII string specified by String.
If String is NULL, then ASSERT(). If PcdMaximumAsciiStringLength is not zero and String contains more than PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator, then ASSERT().
String | A pointer to a Null-terminated ASCII string. |
References AsciiStrLen().
Referenced by AddUnicodeString2(), AsciiStrCat(), AsciiStrCmp(), AsciiStrDecimalToUint64(), AsciiStrDecimalToUintn(), AsciiStrHexToUint64(), AsciiStrHexToUintn(), AsciiStriCmp(), AsciiStrnCat(), AsciiStrnCmp(), AsciiStrStr(), AsciiStrToUnicodeStr(), BasePrintLibSPrintMarker(), FileHandleWriteLine(), PostCodeWithDescription(), and UnicodeStrToAsciiStr().
Returns the first occurrence of a Null-terminated ASCII sub-string in a Null-terminated ASCII string.
This function scans the contents of the ASCII string specified by String and returns the first occurrence of SearchString. If SearchString is not found in String, then NULL is returned. If the length of SearchString is zero, then String is returned.
If String is NULL, then ASSERT(). If SearchString is NULL, then ASSERT().
If PcdMaximumAsciiStringLength is not zero, and SearchString or String contains more than PcdMaximumAsciiStringLength Unicode characters not including the Null-terminator, then ASSERT().
String | A pointer to a Null-terminated ASCII string. | |
SearchString | A pointer to a Null-terminated ASCII string to search for. |
NULL | If the SearchString does not appear in String. | |
others | If there is a match return the first occurrence of SearchingString. If the length of SearchString is zero,return String. |
References AsciiStrSize(), ASSERT, CONST, and NULL.
Convert one Null-terminated ASCII string to a Null-terminated Unicode string and returns the Unicode string.
This function converts the contents of the ASCII string Source to the Unicode string Destination, and returns Destination. The function terminates the Unicode string Destination by appending a Null-terminator character at the end. The caller is responsible to make sure Destination points to a buffer with size equal or greater than ((AsciiStrLen (Source) + 1) * sizeof (CHAR16)) in bytes.
If Destination is NULL, then ASSERT(). If Destination is not aligned on a 16-bit boundary, then ASSERT(). If Source is NULL, then ASSERT(). If Source and Destination overlap, then ASSERT(). If PcdMaximumAsciiStringLength is not zero, and Source contains more than PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then ASSERT(). If PcdMaximumUnicodeStringLength is not zero, and Source contains more than PcdMaximumUnicodeStringLength ASCII characters not including the Null-terminator, then ASSERT().
Source | A pointer to a Null-terminated ASCII string. | |
Destination | A pointer to a Null-terminated Unicode string. |
References AsciiStrLen(), AsciiStrSize(), ASSERT, NULL, and StrSize().
Converts an 8-bit BCD value to an 8-bit value.
Converts the 8-bit BCD value specified by Value to an 8-bit value. The 8-bit value is returned.
If Value >= 0xA0, then ASSERT(). If (Value & 0x0F) >= 0x0A, then ASSERT().
Value | The 8-bit BCD value to convert to an 8-bit value. |
References ASSERT.
Convert a ASCII character to numerical value.
This internal function only deal with Unicode character which maps to a valid hexadecimal ASII character, i.e. '0' to '9', 'a' to 'f' or 'A' to 'F'. For other ASCII character, the value returned does not make sense.
Char | The character to convert. |
References InternalBaseLibAsciiToUpper(), and InternalIsDecimalDigitCharacter().
Referenced by AsciiStrHexToUint64(), and AsciiStrHexToUintn().
Check if a ASCII character is a decimal character.
This internal function checks if a Unicode character is a decimal character. The valid decimal character is from '0' to '9'.
Char | The character to check against. |
TRUE | If the Char is a decmial character. | |
FALSE | If the Char is not a decmial character. |
Referenced by AsciiStrDecimalToUint64(), AsciiStrDecimalToUintn(), and InternalAsciiIsHexaDecimalDigitCharacter().
Check if a ASCII character is a hexadecimal character.
This internal function checks if a ASCII character is a decimal character. The valid hexadecimal character is L'0' to L'9', L'a' to L'f', or L'A' to L'F'.
Char | The character to check against. |
TRUE | If the Char is a hexadecmial character. | |
FALSE | If the Char is not a hexadecmial character. |
References InternalAsciiIsDecimalDigitCharacter().
Referenced by AsciiStrHexToUint64(), and AsciiStrHexToUintn().
Converts a lowercase Ascii character to upper one.
If Chr is lowercase Ascii character, then converts it to upper one.
If Value >= 0xA0, then ASSERT(). If (Value & 0x0F) >= 0x0A, then ASSERT().
Chr | one Ascii character |
Referenced by AsciiStrHexToUint64(), AsciiStrHexToUintn(), AsciiStriCmp(), and InternalAsciiHexCharToUintn().
Convert a Unicode character to upper case only if it maps to a valid small-case ASCII character.
This internal function only deal with Unicode character which maps to a valid small-case ASCII character, i.e. L'a' to L'z'. For other Unicode character, the input character is returned directly.
Char | The character to convert. |
LowerCharacter | If the Char is with range L'a' to L'z'. | |
Unchanged | Otherwise. |
Referenced by InternalHexCharToUintn(), StrHexToUint64(), and StrHexToUintn().
Convert a Unicode character to numerical value.
This internal function only deal with Unicode character which maps to a valid hexadecimal ASII character, i.e. L'0' to L'9', L'a' to L'f' or L'A' to L'F'. For other Unicode character, the value returned does not make sense.
Char | The character to convert. |
References InternalCharToUpper(), and InternalIsDecimalDigitCharacter().
Referenced by AsciiStrHexToUint64(), AsciiStrHexToUintn(), StrHexToUint64(), and StrHexToUintn().
Check if a Unicode character is a decimal character.
This internal function checks if a Unicode character is a decimal character. The valid decimal character is from L'0' to L'9'.
Char | The character to check against. |
TRUE | If the Char is a decmial character. | |
FALSE | If the Char is not a decmial character. |
Referenced by InternalAsciiHexCharToUintn(), InternalHexCharToUintn(), InternalIsHexaDecimalDigitCharacter(), StrDecimalToUint64(), and StrDecimalToUintn().
Check if a Unicode character is a hexadecimal character.
This internal function checks if a Unicode character is a decimal character. The valid hexadecimal character is L'0' to L'9', L'a' to L'f', or L'A' to L'F'.
Char | The character to check against. |
TRUE | If the Char is a hexadecmial character. | |
FALSE | If the Char is not a hexadecmial character. |
References InternalIsDecimalDigitCharacter().
Referenced by StrHexToUint64(), and StrHexToUintn().
[ATTENTION] This function will be deprecated for security reason.
Concatenates one Null-terminated Unicode string to another Null-terminated Unicode string, and returns the concatenated Unicode string.
This function concatenates two Null-terminated Unicode strings. The contents of Null-terminated Unicode string Source are concatenated to the end of Null-terminated Unicode string Destination. The Null-terminated concatenated Unicode String is returned. If Source and Destination overlap, then the results are undefined.
If Destination is NULL, then ASSERT(). If Destination is not aligned on a 16-bit boundary, then ASSERT(). If Source is NULL, then ASSERT(). If Source is not aligned on a 16-bit boundary, then ASSERT(). If Source and Destination overlap, then ASSERT(). If PcdMaximumUnicodeStringLength is not zero, and Destination contains more than PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator, then ASSERT(). If PcdMaximumUnicodeStringLength is not zero, and Source contains more than PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator, then ASSERT(). If PcdMaximumUnicodeStringLength is not zero, and concatenating Destination and Source results in a Unicode string with more than PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator, then ASSERT().
Destination | A pointer to a Null-terminated Unicode string. | |
Source | A pointer to a Null-terminated Unicode string. |
Compares two Null-terminated Unicode strings, and returns the difference between the first mismatched Unicode characters.
This function compares the Null-terminated Unicode string FirstString to the Null-terminated Unicode string SecondString. If FirstString is identical to SecondString, then 0 is returned. Otherwise, the value returned is the first mismatched Unicode character in SecondString subtracted from the first mismatched Unicode character in FirstString.
If FirstString is NULL, then ASSERT(). If FirstString is not aligned on a 16-bit boundary, then ASSERT(). If SecondString is NULL, then ASSERT(). If SecondString is not aligned on a 16-bit boundary, then ASSERT(). If PcdMaximumUnicodeStringLength is not zero, and FirstString contains more than PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator, then ASSERT(). If PcdMaximumUnicodeStringLength is not zero, and SecondString contains more than PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator, then ASSERT().
FirstString | A pointer to a Null-terminated Unicode string. | |
SecondString | A pointer to a Null-terminated Unicode string. |
0 | FirstString is identical to SecondString. |
References ASSERT, and StrSize().
Referenced by DevPathFromTextAta(), DevPathFromTextBBS(), DevPathFromTextHD(), DevPathFromTextIPv4(), DevPathFromTextIPv6(), DevPathFromTextiSCSI(), DevPathFromTextSAS(), DevPathFromTextSasEx(), DevPathFromTextUart(), DevPathFromTextUartFlowCtrl(), InternalHstiFindAip(), and NetworkProtocolFromText().
[ATTENTION] This function will be deprecated for security reason.
Copies one Null-terminated Unicode string to another Null-terminated Unicode string and returns the new Unicode string.
This function copies the contents of the Unicode string Source to the Unicode string Destination, and returns Destination. If Source and Destination overlap, then the results are undefined.
If Destination is NULL, then ASSERT(). If Destination is not aligned on a 16-bit boundary, then ASSERT(). If Source is NULL, then ASSERT(). If Source is not aligned on a 16-bit boundary, then ASSERT(). If Source and Destination overlap, then ASSERT(). If PcdMaximumUnicodeStringLength is not zero, and Source contains more than PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator, then ASSERT().
Destination | A pointer to a Null-terminated Unicode string. | |
Source | A pointer to a Null-terminated Unicode string. |
References ASSERT, BIT0, NULL, and StrLen().
Referenced by StrCat().
Convert a Null-terminated Unicode decimal string to a value of type UINT64.
This function returns a value of type UINT64 by interpreting the contents of the Unicode string specified by String as a decimal number. The format of the input Unicode string String is:
[spaces] [decimal digits].
The valid decimal digit character is in the range [0-9]. The function will ignore the pad space, which includes spaces or tab characters, before [decimal digits]. The running zero in the beginning of [decimal digits] will be ignored. Then, the function stops at the first character that is a not a valid decimal character or a Null-terminator, whichever one comes first.
If String is NULL, then ASSERT(). If String is not aligned in a 16-bit boundary, then ASSERT(). If String has only pad spaces, then 0 is returned. If String has no pad spaces or valid decimal digits, then 0 is returned. If the number represented by String overflows according to the range defined by UINT64, then ASSERT().
If PcdMaximumUnicodeStringLength is not zero, and String contains more than PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator, then ASSERT().
String | A pointer to a Null-terminated Unicode string. |
Value | translated from String. |
References ASSERT, DivU64x32(), InternalIsDecimalDigitCharacter(), MultU64x32(), and StrSize().
Referenced by Strtoi64().
Convert a Null-terminated Unicode decimal string to a value of type UINTN.
This function returns a value of type UINTN by interpreting the contents of the Unicode string specified by String as a decimal number. The format of the input Unicode string String is:
[spaces] [decimal digits].
The valid decimal digit character is in the range [0-9]. The function will ignore the pad space, which includes spaces or tab characters, before [decimal digits]. The running zero in the beginning of [decimal digits] will be ignored. Then, the function stops at the first character that is a not a valid decimal character or a Null-terminator, whichever one comes first.
If String is NULL, then ASSERT(). If String is not aligned in a 16-bit boundary, then ASSERT(). If String has only pad spaces, then 0 is returned. If String has no pad spaces or valid decimal digits, then 0 is returned. If the number represented by String overflows according to the range defined by UINTN, then ASSERT().
If PcdMaximumUnicodeStringLength is not zero, and String contains more than PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator, then ASSERT().
String | A pointer to a Null-terminated Unicode string. |
Value | translated from String. |
References ASSERT, InternalIsDecimalDigitCharacter(), and StrSize().
Referenced by Strtoi().
Convert a Null-terminated Unicode hexadecimal string to a value of type UINT64.
This function returns a value of type UINT64 by interpreting the contents of the Unicode string specified by String as a hexadecimal number. The format of the input Unicode string String is
[spaces][zeros][x][hexadecimal digits].
The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F]. The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix. If "x" appears in the input string, it must be prefixed with at least one 0. The function will ignore the pad space, which includes spaces or tab characters, before [zeros], [x] or [hexadecimal digit]. The running zero before [x] or [hexadecimal digit] will be ignored. Then, the decoding starts after [x] or the first valid hexadecimal digit. Then, the function stops at the first character that is a not a valid hexadecimal character or NULL, whichever one comes first.
If String is NULL, then ASSERT(). If String is not aligned in a 16-bit boundary, then ASSERT(). If String has only pad spaces, then zero is returned. If String has no leading pad spaces, leading zeros or valid hexadecimal digits, then zero is returned. If the number represented by String overflows according to the range defined by UINT64, then ASSERT().
If PcdMaximumUnicodeStringLength is not zero, and String contains more than PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator, then ASSERT().
String | A pointer to a Null-terminated Unicode string. |
Value | translated from String. |
References ASSERT, InternalCharToUpper(), InternalHexCharToUintn(), InternalIsHexaDecimalDigitCharacter(), LShiftU64(), RShiftU64(), and StrSize().
Referenced by DevPathFromText1394(), DevPathFromTextBmc(), StrToGuid(), and Strtoi64().
Convert a Null-terminated Unicode hexadecimal string to a value of type UINTN.
This function returns a value of type UINTN by interpreting the contents of the Unicode string specified by String as a hexadecimal number. The format of the input Unicode string String is:
[spaces][zeros][x][hexadecimal digits].
The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F]. The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix. If "x" appears in the input string, it must be prefixed with at least one 0. The function will ignore the pad space, which includes spaces or tab characters, before [zeros], [x] or [hexadecimal digit]. The running zero before [x] or [hexadecimal digit] will be ignored. Then, the decoding starts after [x] or the first valid hexadecimal digit. Then, the function stops at the first character that is a not a valid hexadecimal character or NULL, whichever one comes first.
If String is NULL, then ASSERT(). If String is not aligned in a 16-bit boundary, then ASSERT(). If String has only pad spaces, then zero is returned. If String has no leading pad spaces, leading zeros or valid hexadecimal digits, then zero is returned. If the number represented by String overflows according to the range defined by UINTN, then ASSERT().
If PcdMaximumUnicodeStringLength is not zero, and String contains more than PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator, then ASSERT().
String | A pointer to a Null-terminated Unicode string. |
Value | translated from String. |
References ASSERT, InternalCharToUpper(), InternalHexCharToUintn(), InternalIsHexaDecimalDigitCharacter(), and StrSize().
Referenced by DevPathFromTextNVMe(), EisaIdFromText(), Strtoi(), and StrToIPv6Addr().
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(). If String is not aligned on a 16-bit boundary, then ASSERT(). If PcdMaximumUnicodeStringLength is not zero, and String contains more than PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator, then ASSERT().
String | A pointer to a Null-terminated Unicode string. |
References ASSERT, BIT0, NULL, and PcdGet32.
Referenced by CatVSPrint(), ConvertFromTextVendor(), DevPathFromTextAcpiEx(), DevPathFromTextAcpiExp(), DevPathFromTextBBS(), DevPathFromTextFilePath(), DevPathFromTextGenericPath(), DevPathFromTextiSCSI(), DevPathFromTextUsbWwid(), DevPathFromTextWiFi(), FileHandleGetFileName(), GetParamByNodeName(), PathCleanUpDirectories(), StrCat(), StrCpy(), StrnCat(), StrnCpy(), StrSize(), and UnicodeStrToAsciiStr().
[ATTENTION] This function will be deprecated for security reason.
Concatenates up to a specified length one Null-terminated Unicode to the end of another Null-terminated Unicode string, and returns the concatenated Unicode string.
This function concatenates two Null-terminated Unicode strings. The contents of Null-terminated Unicode string Source are concatenated to the end of Null-terminated Unicode string Destination, and Destination is returned. At most, Length Unicode characters are concatenated from Source to the end of Destination, and Destination is always Null-terminated. If Length is 0, then Destination is returned unmodified. If Source and Destination overlap, then the results are undefined.
If Destination is NULL, then ASSERT(). If Length > 0 and Destination is not aligned on a 16-bit boundary, then ASSERT(). If Length > 0 and Source is NULL, then ASSERT(). If Length > 0 and Source is not aligned on a 16-bit boundary, then ASSERT(). If Source and Destination overlap, then ASSERT(). If PcdMaximumUnicodeStringLength is not zero, and Length is greater than PcdMaximumUnicodeStringLength, then ASSERT(). If PcdMaximumUnicodeStringLength is not zero, and Destination contains more than PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator, then ASSERT(). If PcdMaximumUnicodeStringLength is not zero, and Source contains more than PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator, then ASSERT(). If PcdMaximumUnicodeStringLength is not zero, and concatenating Destination and Source results in a Unicode string with more than PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator, then ASSERT().
Destination | A pointer to a Null-terminated Unicode string. | |
Source | A pointer to a Null-terminated Unicode string. | |
Length | The maximum number of Unicode characters to concatenate from Source. |
INTN EFIAPI StrnCmp | ( | IN CONST CHAR16 * | FirstString, | |
IN CONST CHAR16 * | SecondString, | |||
IN UINTN | Length | |||
) |
Compares up to a specified length the contents of two Null-terminated Unicode strings, and returns the difference between the first mismatched Unicode characters.
This function compares the Null-terminated Unicode string FirstString to the Null-terminated Unicode string SecondString. At most, Length Unicode characters will be compared. If Length is 0, then 0 is returned. If FirstString is identical to SecondString, then 0 is returned. Otherwise, the value returned is the first mismatched Unicode character in SecondString subtracted from the first mismatched Unicode character in FirstString.
If Length > 0 and FirstString is NULL, then ASSERT(). If Length > 0 and FirstString is not aligned on a 16-bit boundary, then ASSERT(). If Length > 0 and SecondString is NULL, then ASSERT(). If Length > 0 and SecondString is not aligned on a 16-bit boundary, then ASSERT(). If PcdMaximumUnicodeStringLength is not zero, and Length is greater than PcdMaximumUnicodeStringLength, then ASSERT(). If PcdMaximumUnicodeStringLength is not zero, and FirstString contains more than PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator, then ASSERT(). If PcdMaximumUnicodeStringLength is not zero, and SecondString contains more than PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator, then ASSERT().
FirstString | A pointer to a Null-terminated Unicode string. | |
SecondString | A pointer to a Null-terminated Unicode string. | |
Length | The maximum number of Unicode characters to compare. |
0 | FirstString is identical to SecondString. |
References ASSERT, PcdGet32, and StrSize().
Referenced by GetParamByNodeName().
[ATTENTION] This function will be deprecated for security reason.
Copies up to a specified length from one Null-terminated Unicode string to another Null-terminated Unicode string and returns the new Unicode string.
This function copies the contents of the Unicode string Source to the Unicode string Destination, and returns Destination. At most, Length Unicode characters are copied from Source to Destination. If Length is 0, then Destination is returned unmodified. If Length is greater that the number of Unicode characters in Source, then Destination is padded with Null Unicode characters. If Source and Destination overlap, then the results are undefined.
If Length > 0 and Destination is NULL, then ASSERT(). If Length > 0 and Destination is not aligned on a 16-bit boundary, then ASSERT(). If Length > 0 and Source is NULL, then ASSERT(). If Length > 0 and Source is not aligned on a 16-bit boundary, then ASSERT(). If Source and Destination overlap, then ASSERT(). If PcdMaximumUnicodeStringLength is not zero, and Length is greater than PcdMaximumUnicodeStringLength, then ASSERT(). If PcdMaximumUnicodeStringLength is not zero, and Source contains more than PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator, then ASSERT().
Destination | A pointer to a Null-terminated Unicode string. | |
Source | A pointer to a Null-terminated Unicode string. | |
Length | The maximum number of Unicode characters to copy. |
References ASSERT, BIT0, NULL, PcdGet32, StrLen(), and ZeroMem().
Referenced by StrnCat().
Returns the size of a Null-terminated Unicode string in bytes, including the Null terminator.
This function returns the size, in bytes, of the Null-terminated Unicode string specified by String.
If String is NULL, then ASSERT(). If String is not aligned on a 16-bit boundary, then ASSERT(). If PcdMaximumUnicodeStringLength is not zero, and String contains more than PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator, then ASSERT().
String | A pointer to a Null-terminated Unicode string. |
References StrLen().
Referenced by AddUnicodeString2(), AsciiStrToUnicodeStr(), BasePrintLibSPrintMarker(), CatVSPrint(), DevPathFromTextBluetooth(), FileDevicePath(), FileHandleWriteLine(), InternalHstiRecordErrorString(), PathCleanUpDirectories(), StrCat(), StrCmp(), StrDecimalToUint64(), StrDecimalToUintn(), StrHexToUint64(), StrHexToUintn(), StrnCat(), StrnCatGrowLeft(), StrnCmp(), StrStr(), UefiDevicePathLibStrDuplicate(), and UnicodeStrToAsciiStr().
Returns the first occurrence of a Null-terminated Unicode sub-string in a Null-terminated Unicode string.
This function scans the contents of the Null-terminated Unicode string specified by String and returns the first occurrence of SearchString. If SearchString is not found in String, then NULL is returned. If the length of SearchString is zero, then String is returned.
If String is NULL, then ASSERT(). If String is not aligned on a 16-bit boundary, then ASSERT(). If SearchString is NULL, then ASSERT(). If SearchString is not aligned on a 16-bit boundary, then ASSERT().
If PcdMaximumUnicodeStringLength is not zero, and SearchString or String contains more than PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator, then ASSERT().
String | A pointer to a Null-terminated Unicode string. | |
SearchString | A pointer to a Null-terminated Unicode string to search for. |
NULL | If the SearchString does not appear in String. |
References ASSERT, CONST, NULL, and StrSize().
Referenced by PathCleanUpDirectories().
Convert a Null-terminated Unicode string to a Null-terminated ASCII string and returns the ASCII string.
This function converts the content of the Unicode string Source to the ASCII string Destination by copying the lower 8 bits of each Unicode character. It returns Destination.
The caller is responsible to make sure Destination points to a buffer with size equal or greater than ((StrLen (Source) + 1) * sizeof (CHAR8)) in bytes.
If any Unicode characters in Source contain non-zero value in the upper 8 bits, then ASSERT().
If Destination is NULL, then ASSERT(). If Source is NULL, then ASSERT(). If Source is not aligned on a 16-bit boundary, then ASSERT(). If Source and Destination overlap, then ASSERT().
If PcdMaximumUnicodeStringLength is not zero, and Source contains more than PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator, then ASSERT().
If PcdMaximumAsciiStringLength is not zero, and Source contains more than PcdMaximumAsciiStringLength Unicode characters, not including the Null-terminator, then ASSERT().
Source | A pointer to a Null-terminated Unicode string. | |
Destination | A pointer to a Null-terminated ASCII string. |
References AsciiStrSize(), ASSERT, NULL, StrLen(), and StrSize().
Referenced by DevPathFromTextWiFi(), and FileHandleWriteLine().