diff options
author | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-07-29 05:38:39 +0000 |
---|---|---|
committer | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-07-29 05:38:39 +0000 |
commit | 2a0879aa03ca972c8eea456cfba0f5f119695055 (patch) | |
tree | e46e81a23e522be2afd28cb3229f8d3fbc8fab95 | |
parent | a4902cccdf477e93a55d6211fcb7a071bb48b71c (diff) | |
download | edk2-platforms-2a0879aa03ca972c8eea456cfba0f5f119695055.tar.xz |
Use local version EfiScriptLibAsciiStrLen() and EfiScriptLibStrLen() function to get string length so that this library doesn't depend on other EDK libraries and it can be linked together with EdkIIGlueLib.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10711 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r-- | EdkCompatibilityPkg/Foundation/Library/Dxe/EfiScriptLib/EfiScriptLib.c | 54 |
1 files changed, 51 insertions, 3 deletions
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiScriptLib/EfiScriptLib.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiScriptLib/EfiScriptLib.c index 01ae07ee04..7b905b49fc 100644 --- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiScriptLib/EfiScriptLib.c +++ b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiScriptLib/EfiScriptLib.c @@ -1,6 +1,6 @@ /*++
-Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
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
@@ -23,6 +23,54 @@ Abstract: EFI_BOOT_SCRIPT_SAVE_PROTOCOL *mBootScriptSave;
+UINTN
+EfiScriptLibAsciiStrLen (
+ IN CHAR8 *String
+ )
+/*++
+
+Routine Description:
+ Return the number of Ascii characters in String. This is not the same as
+ the length of the string in bytes.
+
+Arguments:
+ String - String to process
+
+Returns:
+ Number of Ascii characters in String
+
+--*/
+{
+ UINTN Length;
+
+ for (Length=0; *String; String++, Length++);
+ return Length;
+}
+
+UINTN
+EfiScriptLibStrLen (
+ IN CHAR16 *String
+ )
+/*++
+
+Routine Description:
+ Return the number of Unicode characters in String. This is not the same as
+ the length of the string in bytes.
+
+Arguments:
+ String - String to process
+
+Returns:
+ Number of Unicode characters in String
+
+--*/
+{
+ UINTN Length;
+
+ for (Length=0; *String; String++, Length++);
+ return Length;
+}
+
EFI_STATUS
EFIAPI
BootScriptSaveInitialize (
@@ -622,7 +670,7 @@ Returns: {
return BootScriptSaveInformation (
TableName,
- (UINT32) EfiStrLen (String) * 2 + 2,
+ (UINT32) EfiScriptLibStrLen (String) * 2 + 2,
(EFI_PHYSICAL_ADDRESS) (UINTN) String
);
}
@@ -655,7 +703,7 @@ Returns: {
return BootScriptSaveInformation (
TableName,
- (UINT32) EfiAsciiStrLen (String) + 1,
+ (UINT32) EfiScriptLibAsciiStrLen (String) + 1,
(EFI_PHYSICAL_ADDRESS) (UINTN) String
);
}
|