]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BaseLib/String.c
1.Updated some functions header of BaseLib with new MWG spec
[mirror_edk2.git] / MdePkg / Library / BaseLib / String.c
index c4330fa5d209b58c2b4751d9887e547e2e100bf4..80223c6732ebedcb0df7fe0747d2d1678f90b244 100644 (file)
@@ -26,7 +26,8 @@
   If Source is NULL, then ASSERT().\r
   If Source and Destination overlap, then ASSERT().\r
   If PcdMaximumUnicodeStringLength is not zero, and Source contains more than\r
   If Source is NULL, then ASSERT().\r
   If Source and Destination overlap, then ASSERT().\r
   If PcdMaximumUnicodeStringLength is not zero, and Source contains more than\r
-  PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+  PcdMaximumUnicodeStringLength Unicode characters not including the \r
+  Null-terminator, then ASSERT().\r
 \r
   @param  Destination Pointer to a Null-terminated Unicode string.\r
   @param  Source      Pointer to a Null-terminated Unicode string.\r
 \r
   @param  Destination Pointer to a Null-terminated Unicode string.\r
   @param  Source      Pointer to a Null-terminated Unicode string.\r
@@ -79,7 +80,8 @@ StrCpy (
   If Source is NULL, then ASSERT().\r
   If Source and Destination overlap, then ASSERT().\r
   If PcdMaximumUnicodeStringLength is not zero, and Source contains more than\r
   If Source is NULL, then ASSERT().\r
   If Source and Destination overlap, then ASSERT().\r
   If PcdMaximumUnicodeStringLength is not zero, and Source contains more than\r
-  PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+  PcdMaximumUnicodeStringLength Unicode characters not including the \r
+  Null-terminator, then ASSERT().\r
 \r
   @param  Destination Pointer to a Null-terminated Unicode string.\r
   @param  Source      Pointer to a Null-terminated Unicode string.\r
 \r
   @param  Destination Pointer to a Null-terminated Unicode string.\r
   @param  Source      Pointer to a Null-terminated Unicode string.\r
@@ -133,7 +135,8 @@ StrnCpy (
 \r
   If String is NULL, then ASSERT().\r
   If PcdMaximumUnicodeStringLength is not zero, and String contains more than\r
 \r
   If String is NULL, then ASSERT().\r
   If PcdMaximumUnicodeStringLength is not zero, and String contains more than\r
-  PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+  PcdMaximumUnicodeStringLength Unicode characters not including the \r
+  Null-terminator, then ASSERT().\r
 \r
   @param  String  Pointer to a Null-terminated Unicode string.\r
 \r
 \r
   @param  String  Pointer to a Null-terminated Unicode string.\r
 \r
@@ -171,7 +174,8 @@ StrLen (
 \r
   If String is NULL, then ASSERT().\r
   If PcdMaximumUnicodeStringLength is not zero, and String contains more than\r
 \r
   If String is NULL, then ASSERT().\r
   If PcdMaximumUnicodeStringLength is not zero, and String contains more than\r
-  PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+  PcdMaximumUnicodeStringLength Unicode characters not including the \r
+  Null-terminator, then ASSERT().\r
 \r
   @param  String  Pointer to a Null-terminated Unicode string.\r
 \r
 \r
   @param  String  Pointer to a Null-terminated Unicode string.\r
 \r
@@ -200,9 +204,11 @@ StrSize (
   If FirstString is NULL, then ASSERT().\r
   If SecondString is NULL, then ASSERT().\r
   If PcdMaximumUnicodeStringLength is not zero, and FirstString contains more\r
   If FirstString is NULL, then ASSERT().\r
   If SecondString is NULL, then ASSERT().\r
   If PcdMaximumUnicodeStringLength is not zero, and FirstString contains more\r
-  than PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+  than PcdMaximumUnicodeStringLength Unicode characters not including the \r
+  Null-terminator, then ASSERT().\r
   If PcdMaximumUnicodeStringLength is not zero, and SecondString contains more\r
   If PcdMaximumUnicodeStringLength is not zero, and SecondString contains more\r
-  than PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+  than PcdMaximumUnicodeStringLength Unicode characters not including the \r
+  Null-terminator, then ASSERT().\r
 \r
   @param  FirstString   Pointer to a Null-terminated Unicode string.\r
   @param  SecondString  Pointer to a Null-terminated Unicode string.\r
 \r
   @param  FirstString   Pointer to a Null-terminated Unicode string.\r
   @param  SecondString  Pointer to a Null-terminated Unicode string.\r
@@ -245,9 +251,11 @@ StrCmp (
   If FirstString is NULL, then ASSERT().\r
   If SecondString is NULL, then ASSERT().\r
   If PcdMaximumUnicodeStringLength is not zero, and FirstString contains more\r
   If FirstString is NULL, then ASSERT().\r
   If SecondString is NULL, then ASSERT().\r
   If PcdMaximumUnicodeStringLength is not zero, and FirstString contains more\r
-  than PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+  than PcdMaximumUnicodeStringLength Unicode characters not including the\r
+  Null-terminator, then ASSERT().\r
   If PcdMaximumUnicodeStringLength is not zero, and SecondString contains more\r
   If PcdMaximumUnicodeStringLength is not zero, and SecondString contains more\r
-  than PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+  than PcdMaximumUnicodeStringLength Unicode characters not including the\r
+  Null-terminator, then ASSERT().\r
 \r
   @param  FirstString   Pointer to a Null-terminated Unicode string.\r
   @param  SecondString  Pointer to a Null-terminated Unicode string.\r
 \r
   @param  FirstString   Pointer to a Null-terminated Unicode string.\r
   @param  SecondString  Pointer to a Null-terminated Unicode string.\r
@@ -301,12 +309,15 @@ StrnCmp (
   If Source is NULL, then ASSERT().\r
   If Source and Destination overlap, then ASSERT().\r
   If PcdMaximumUnicodeStringLength is not zero, and Destination contains more\r
   If Source is NULL, then ASSERT().\r
   If Source and Destination overlap, then ASSERT().\r
   If PcdMaximumUnicodeStringLength is not zero, and Destination contains more\r
-  than PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+  than PcdMaximumUnicodeStringLength Unicode characters not including the\r
+  Null-terminator, then ASSERT().\r
   If PcdMaximumUnicodeStringLength is not zero, and Source contains more than\r
   If PcdMaximumUnicodeStringLength is not zero, and Source contains more than\r
-  PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+  PcdMaximumUnicodeStringLength Unicode characters not including the\r
+  Null-terminator, then ASSERT().\r
   If PcdMaximumUnicodeStringLength is not zero, and concatenating Destination\r
   and Source results in a Unicode string with more than\r
   If PcdMaximumUnicodeStringLength is not zero, and concatenating Destination\r
   and Source results in a Unicode string with more than\r
-  PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+  PcdMaximumUnicodeStringLength Unicode characters not including the\r
+  Null-terminator, then ASSERT().\r
 \r
   @param  Destination Pointer to a Null-terminated Unicode string.\r
   @param  Source      Pointer to a Null-terminated Unicode string.\r
 \r
   @param  Destination Pointer to a Null-terminated Unicode string.\r
   @param  Source      Pointer to a Null-terminated Unicode string.\r
@@ -348,12 +359,15 @@ StrCat (
   If Source is NULL, then ASSERT().\r
   If Source and Destination overlap, then ASSERT().\r
   If PcdMaximumUnicodeStringLength is not zero, and Destination contains more\r
   If Source is NULL, then ASSERT().\r
   If Source and Destination overlap, then ASSERT().\r
   If PcdMaximumUnicodeStringLength is not zero, and Destination contains more\r
-  than PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+  than PcdMaximumUnicodeStringLength Unicode characters not including the\r
+  Null-terminator, then ASSERT().\r
   If PcdMaximumUnicodeStringLength is not zero, and Source contains more than\r
   If PcdMaximumUnicodeStringLength is not zero, and Source contains more than\r
-  PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+  PcdMaximumUnicodeStringLength Unicode characters not including the\r
+  Null-terminator, then ASSERT().\r
   If PcdMaximumUnicodeStringLength is not zero, and concatenating Destination\r
   and Source results in a Unicode string with more than\r
   If PcdMaximumUnicodeStringLength is not zero, and concatenating Destination\r
   and Source results in a Unicode string with more than\r
-  PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+  PcdMaximumUnicodeStringLength Unicode characters not including the\r
+  Null-terminator, then ASSERT().\r
 \r
   @param  Destination Pointer to a Null-terminated Unicode string.\r
   @param  Source      Pointer to a Null-terminated Unicode string.\r
 \r
   @param  Destination Pointer to a Null-terminated Unicode string.\r
   @param  Source      Pointer to a Null-terminated Unicode string.\r
@@ -393,7 +407,8 @@ StrnCat (
   If Source is NULL, then ASSERT().\r
   If Source and Destination overlap, then ASSERT().\r
   If PcdMaximumAsciiStringLength is not zero and Source contains more than\r
   If Source is NULL, then ASSERT().\r
   If Source and Destination overlap, then ASSERT().\r
   If PcdMaximumAsciiStringLength is not zero and Source contains more than\r
-  PcdMaximumAsciiStringLength ASCII characters, then ASSERT().\r
+  PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,\r
+  then ASSERT().\r
 \r
   @param  Destination Pointer to a Null-terminated ASCII string.\r
   @param  Source      Pointer to a Null-terminated ASCII string.\r
 \r
   @param  Destination Pointer to a Null-terminated ASCII string.\r
   @param  Source      Pointer to a Null-terminated ASCII string.\r
@@ -445,7 +460,8 @@ AsciiStrCpy (
   If Source is NULL, then ASSERT().\r
   If Source and Destination overlap, then ASSERT().\r
   If PcdMaximumAsciiStringLength is not zero, and Source contains more than\r
   If Source is NULL, then ASSERT().\r
   If Source and Destination overlap, then ASSERT().\r
   If PcdMaximumAsciiStringLength is not zero, and Source contains more than\r
-  PcdMaximumAsciiStringLength ASCII characters, then ASSERT().\r
+  PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,\r
+  then ASSERT().\r
 \r
   @param  Destination Pointer to a Null-terminated ASCII string.\r
   @param  Source      Pointer to a Null-terminated ASCII string.\r
 \r
   @param  Destination Pointer to a Null-terminated ASCII string.\r
   @param  Source      Pointer to a Null-terminated ASCII string.\r
@@ -498,7 +514,8 @@ AsciiStrnCpy (
 \r
   If String is NULL, then ASSERT().\r
   If PcdMaximumAsciiStringLength is not zero and String contains more than\r
 \r
   If String is NULL, then ASSERT().\r
   If PcdMaximumAsciiStringLength is not zero and String contains more than\r
-  PcdMaximumAsciiStringLength ASCII characters, then ASSERT().\r
+  PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,\r
+  then ASSERT().\r
 \r
   @param  String  Pointer to a Null-terminated ASCII string.\r
 \r
 \r
   @param  String  Pointer to a Null-terminated ASCII string.\r
 \r
@@ -536,7 +553,8 @@ AsciiStrLen (
 \r
   If String is NULL, then ASSERT().\r
   If PcdMaximumAsciiStringLength is not zero and String contains more than\r
 \r
   If String is NULL, then ASSERT().\r
   If PcdMaximumAsciiStringLength is not zero and String contains more than\r
-  PcdMaximumAsciiStringLength ASCII characters, then ASSERT().\r
+  PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,\r
+  then ASSERT().\r
 \r
   @param  String  Pointer to a Null-terminated ASCII string.\r
 \r
 \r
   @param  String  Pointer to a Null-terminated ASCII string.\r
 \r
@@ -565,9 +583,11 @@ AsciiStrSize (
   If FirstString is NULL, then ASSERT().\r
   If SecondString is NULL, then ASSERT().\r
   If PcdMaximumAsciiStringLength is not zero and FirstString contains more than\r
   If FirstString is NULL, then ASSERT().\r
   If SecondString is NULL, then ASSERT().\r
   If PcdMaximumAsciiStringLength is not zero and FirstString contains more than\r
-  PcdMaximumAsciiStringLength ASCII characters, then ASSERT().\r
+  PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,\r
+  then ASSERT().\r
   If PcdMaximumAsciiStringLength is not zero and SecondString contains more\r
   If PcdMaximumAsciiStringLength is not zero and SecondString contains more\r
-  than PcdMaximumAsciiStringLength ASCII characters, then ASSERT().\r
+  than PcdMaximumAsciiStringLength ASCII characters not including the\r
+  Null-terminator, then ASSERT().\r
 \r
   @param  FirstString   Pointer to a Null-terminated ASCII string.\r
   @param  SecondString  Pointer to a Null-terminated ASCII string.\r
 \r
   @param  FirstString   Pointer to a Null-terminated ASCII string.\r
   @param  SecondString  Pointer to a Null-terminated ASCII string.\r
@@ -621,9 +641,11 @@ AsciiToUpper (
   If FirstString is NULL, then ASSERT().\r
   If SecondString is NULL, then ASSERT().\r
   If PcdMaximumAsciiStringLength is not zero and FirstString contains more than\r
   If FirstString is NULL, then ASSERT().\r
   If SecondString is NULL, then ASSERT().\r
   If PcdMaximumAsciiStringLength is not zero and FirstString contains more than\r
-  PcdMaximumAsciiStringLength ASCII characters, then ASSERT().\r
+  PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,\r
+  then ASSERT().\r
   If PcdMaximumAsciiStringLength is not zero and SecondString contains more\r
   If PcdMaximumAsciiStringLength is not zero and SecondString contains more\r
-  than PcdMaximumAsciiStringLength ASCII characters, then ASSERT().\r
+  than PcdMaximumAsciiStringLength ASCII characters not including the\r
+  Null-terminator, then ASSERT().\r
 \r
   @param  FirstString   Pointer to a Null-terminated ASCII string.\r
   @param  SecondString  Pointer to a Null-terminated ASCII string.\r
 \r
   @param  FirstString   Pointer to a Null-terminated ASCII string.\r
   @param  SecondString  Pointer to a Null-terminated ASCII string.\r
@@ -670,9 +692,11 @@ AsciiStriCmp (
   If FirstString is NULL, then ASSERT().\r
   If SecondString is NULL, then ASSERT().\r
   If PcdMaximumAsciiStringLength is not zero and FirstString contains more than\r
   If FirstString is NULL, then ASSERT().\r
   If SecondString is NULL, then ASSERT().\r
   If PcdMaximumAsciiStringLength is not zero and FirstString contains more than\r
-  PcdMaximumAsciiStringLength ASCII characters, then ASSERT().\r
-  If PcdMaximumAsciiStringLength is not zero and SecondString contains more\r
-  than PcdMaximumAsciiStringLength ASCII characters, then ASSERT().\r
+  PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,\r
+  then ASSERT().\r
+  If PcdMaximumAsciiStringLength is not zero and SecondString contains more than\r
+  PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,\r
+  then ASSERT().\r
 \r
   @param  FirstString   Pointer to a Null-terminated ASCII string.\r
   @param  SecondString  Pointer to a Null-terminated ASCII string.\r
 \r
   @param  FirstString   Pointer to a Null-terminated ASCII string.\r
   @param  SecondString  Pointer to a Null-terminated ASCII string.\r
@@ -717,9 +741,11 @@ AsciiStrnCmp (
   If Destination is NULL, then ASSERT().\r
   If Source is NULL, then ASSERT().\r
   If PcdMaximumAsciiStringLength is not zero and Destination contains more than\r
   If Destination is NULL, then ASSERT().\r
   If Source is NULL, then ASSERT().\r
   If PcdMaximumAsciiStringLength is not zero and Destination contains more than\r
-  PcdMaximumAsciiStringLength ASCII characters, then ASSERT().\r
+  PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,\r
+  then ASSERT().\r
   If PcdMaximumAsciiStringLength is not zero and Source contains more than\r
   If PcdMaximumAsciiStringLength is not zero and Source contains more than\r
-  PcdMaximumAsciiStringLength ASCII characters, then ASSERT().\r
+  PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,\r
+  then ASSERT().\r
   If PcdMaximumAsciiStringLength is not zero and concatenating Destination and\r
   Source results in a ASCII string with more than PcdMaximumAsciiStringLength\r
   ASCII characters, then ASSERT().\r
   If PcdMaximumAsciiStringLength is not zero and concatenating Destination and\r
   Source results in a ASCII string with more than PcdMaximumAsciiStringLength\r
   ASCII characters, then ASSERT().\r
@@ -763,13 +789,15 @@ AsciiStrCat (
   If Destination is NULL, then ASSERT().\r
   If Source is NULL, then ASSERT().\r
   If Source and Destination overlap, then ASSERT().\r
   If Destination is NULL, then ASSERT().\r
   If Source is NULL, then ASSERT().\r
   If Source and Destination overlap, then ASSERT().\r
-  If PcdMaximumAsciiStringLength is not zero, and Destination contains more\r
-  than PcdMaximumAsciiStringLength ASCII characters, then ASSERT().\r
+  If PcdMaximumAsciiStringLength is not zero, and Destination contains more than\r
+  PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,\r
+  then ASSERT().\r
   If PcdMaximumAsciiStringLength is not zero, and Source contains more than\r
   If PcdMaximumAsciiStringLength is not zero, and Source contains more than\r
-  PcdMaximumAsciiStringLength ASCII characters, then ASSERT().\r
+  PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,\r
+  then ASSERT().\r
   If PcdMaximumAsciiStringLength is not zero, and concatenating Destination and\r
   Source results in a ASCII string with more than PcdMaximumAsciiStringLength\r
   If PcdMaximumAsciiStringLength is not zero, and concatenating Destination and\r
   Source results in a ASCII string with more than PcdMaximumAsciiStringLength\r
-  ASCII characters, then ASSERT().\r
+  ASCII characters not including the Null-terminator, then ASSERT().\r
 \r
   @param  Destination Pointer to a Null-terminated ASCII string.\r
   @param  Source      Pointer to a Null-terminated ASCII string.\r
 \r
   @param  Destination Pointer to a Null-terminated ASCII string.\r
   @param  Source      Pointer to a Null-terminated ASCII string.\r