TianoCore EDK2 master
String.c
Go to the documentation of this file.
1
9#include "BaseLibInternals.h"
10
29EFIAPI
31 IN CONST CHAR16 *String
32 )
33{
34 UINTN Length;
35
36 ASSERT (String != NULL);
37 ASSERT (((UINTN)String & BIT0) == 0);
38
39 for (Length = 0; *String != L'\0'; String++, Length++) {
40 //
41 // If PcdMaximumUnicodeStringLength is not zero,
42 // length should not more than PcdMaximumUnicodeStringLength
43 //
44 if (PcdGet32 (PcdMaximumUnicodeStringLength) != 0) {
45 ASSERT (Length < PcdGet32 (PcdMaximumUnicodeStringLength));
46 }
47 }
48
49 return Length;
50}
51
71EFIAPI
73 IN CONST CHAR16 *String
74 )
75{
76 return (StrLen (String) + 1) * sizeof (*String);
77}
78
107INTN
108EFIAPI
110 IN CONST CHAR16 *FirstString,
111 IN CONST CHAR16 *SecondString
112 )
113{
114 //
115 // ASSERT both strings are less long than PcdMaximumUnicodeStringLength
116 //
117 ASSERT (StrSize (FirstString) != 0);
118 ASSERT (StrSize (SecondString) != 0);
119
120 while ((*FirstString != L'\0') && (*FirstString == *SecondString)) {
121 FirstString++;
122 SecondString++;
123 }
124
125 return *FirstString - *SecondString;
126}
127
160INTN
161EFIAPI
163 IN CONST CHAR16 *FirstString,
164 IN CONST CHAR16 *SecondString,
165 IN UINTN Length
166 )
167{
168 if (Length == 0) {
169 return 0;
170 }
171
172 //
173 // ASSERT both strings are less long than PcdMaximumUnicodeStringLength.
174 // Length tests are performed inside StrLen().
175 //
176 ASSERT (StrSize (FirstString) != 0);
177 ASSERT (StrSize (SecondString) != 0);
178
179 if (PcdGet32 (PcdMaximumUnicodeStringLength) != 0) {
180 ASSERT (Length <= PcdGet32 (PcdMaximumUnicodeStringLength));
181 }
182
183 while ((*FirstString != L'\0') &&
184 (*SecondString != L'\0') &&
185 (*FirstString == *SecondString) &&
186 (Length > 1))
187 {
188 FirstString++;
189 SecondString++;
190 Length--;
191 }
192
193 return *FirstString - *SecondString;
194}
195
222CHAR16 *
223EFIAPI
225 IN CONST CHAR16 *String,
226 IN CONST CHAR16 *SearchString
227 )
228{
229 CONST CHAR16 *FirstMatch;
230 CONST CHAR16 *SearchStringTmp;
231
232 //
233 // ASSERT both strings are less long than PcdMaximumUnicodeStringLength.
234 // Length tests are performed inside StrLen().
235 //
236 ASSERT (StrSize (String) != 0);
237 ASSERT (StrSize (SearchString) != 0);
238
239 if (*SearchString == L'\0') {
240 return (CHAR16 *)String;
241 }
242
243 while (*String != L'\0') {
244 SearchStringTmp = SearchString;
245 FirstMatch = String;
246
247 while ( (*String == *SearchStringTmp)
248 && (*String != L'\0'))
249 {
250 String++;
251 SearchStringTmp++;
252 }
253
254 if (*SearchStringTmp == L'\0') {
255 return (CHAR16 *)FirstMatch;
256 }
257
258 if (*String == L'\0') {
259 return NULL;
260 }
261
262 String = FirstMatch + 1;
263 }
264
265 return NULL;
266}
267
281BOOLEAN
282EFIAPI
284 IN CHAR16 Char
285 )
286{
287 return (BOOLEAN)(Char >= L'0' && Char <= L'9');
288}
289
305CHAR16
306EFIAPI
308 IN CHAR16 Char
309 )
310{
311 if ((Char >= L'a') && (Char <= L'z')) {
312 return (CHAR16)(Char - (L'a' - L'A'));
313 }
314
315 return Char;
316}
317
331UINTN
332EFIAPI
334 IN CHAR16 Char
335 )
336{
338 return Char - L'0';
339 }
340
341 return (10 + CharToUpper (Char) - L'A');
342}
343
358BOOLEAN
359EFIAPI
361 IN CHAR16 Char
362 )
363{
364 return (BOOLEAN)(InternalIsDecimalDigitCharacter (Char) ||
365 (Char >= L'A' && Char <= L'F') ||
366 (Char >= L'a' && Char <= L'f'));
367}
368
403UINTN
404EFIAPI
406 IN CONST CHAR16 *String
407 )
408{
409 UINTN Result;
410
411 StrDecimalToUintnS (String, (CHAR16 **)NULL, &Result);
412 return Result;
413}
414
449UINT64
450EFIAPI
452 IN CONST CHAR16 *String
453 )
454{
455 UINT64 Result;
456
457 StrDecimalToUint64S (String, (CHAR16 **)NULL, &Result);
458 return Result;
459}
460
496UINTN
497EFIAPI
499 IN CONST CHAR16 *String
500 )
501{
502 UINTN Result;
503
504 StrHexToUintnS (String, (CHAR16 **)NULL, &Result);
505 return Result;
506}
507
543UINT64
544EFIAPI
546 IN CONST CHAR16 *String
547 )
548{
549 UINT64 Result;
550
551 StrHexToUint64S (String, (CHAR16 **)NULL, &Result);
552 return Result;
553}
554
568BOOLEAN
569EFIAPI
571 IN CHAR8 Char
572 )
573{
574 return (BOOLEAN)(Char >= '0' && Char <= '9');
575}
576
591BOOLEAN
592EFIAPI
594 IN CHAR8 Char
595 )
596{
597 return (BOOLEAN)(InternalAsciiIsDecimalDigitCharacter (Char) ||
598 (Char >= 'A' && Char <= 'F') ||
599 (Char >= 'a' && Char <= 'f'));
600}
601
619UINTN
620EFIAPI
622 IN CONST CHAR8 *String
623 )
624{
625 UINTN Length;
626
627 ASSERT (String != NULL);
628
629 for (Length = 0; *String != '\0'; String++, Length++) {
630 //
631 // If PcdMaximumUnicodeStringLength is not zero,
632 // length should not more than PcdMaximumUnicodeStringLength
633 //
634 if (PcdGet32 (PcdMaximumAsciiStringLength) != 0) {
635 ASSERT (Length < PcdGet32 (PcdMaximumAsciiStringLength));
636 }
637 }
638
639 return Length;
640}
641
659UINTN
660EFIAPI
662 IN CONST CHAR8 *String
663 )
664{
665 return (AsciiStrLen (String) + 1) * sizeof (*String);
666}
667
694INTN
695EFIAPI
697 IN CONST CHAR8 *FirstString,
698 IN CONST CHAR8 *SecondString
699 )
700{
701 //
702 // ASSERT both strings are less long than PcdMaximumAsciiStringLength
703 //
704 ASSERT (AsciiStrSize (FirstString));
705 ASSERT (AsciiStrSize (SecondString));
706
707 while ((*FirstString != '\0') && (*FirstString == *SecondString)) {
708 FirstString++;
709 SecondString++;
710 }
711
712 return *FirstString - *SecondString;
713}
714
728CHAR8
729EFIAPI
731 IN CHAR8 Chr
732 )
733{
734 return (UINT8)((Chr >= 'a' && Chr <= 'z') ? Chr - ('a' - 'A') : Chr);
735}
736
750UINTN
751EFIAPI
753 IN CHAR8 Char
754 )
755{
757 return Char - '0';
758 }
759
760 return (10 + AsciiCharToUpper (Char) - 'A');
761}
762
792INTN
793EFIAPI
795 IN CONST CHAR8 *FirstString,
796 IN CONST CHAR8 *SecondString
797 )
798{
799 CHAR8 UpperFirstString;
800 CHAR8 UpperSecondString;
801
802 //
803 // ASSERT both strings are less long than PcdMaximumAsciiStringLength
804 //
805 ASSERT (AsciiStrSize (FirstString));
806 ASSERT (AsciiStrSize (SecondString));
807
808 UpperFirstString = AsciiCharToUpper (*FirstString);
809 UpperSecondString = AsciiCharToUpper (*SecondString);
810 while ((*FirstString != '\0') && (*SecondString != '\0') && (UpperFirstString == UpperSecondString)) {
811 FirstString++;
812 SecondString++;
813 UpperFirstString = AsciiCharToUpper (*FirstString);
814 UpperSecondString = AsciiCharToUpper (*SecondString);
815 }
816
817 return UpperFirstString - UpperSecondString;
818}
819
850INTN
851EFIAPI
853 IN CONST CHAR8 *FirstString,
854 IN CONST CHAR8 *SecondString,
855 IN UINTN Length
856 )
857{
858 if (Length == 0) {
859 return 0;
860 }
861
862 //
863 // ASSERT both strings are less long than PcdMaximumAsciiStringLength
864 //
865 ASSERT (AsciiStrSize (FirstString));
866 ASSERT (AsciiStrSize (SecondString));
867
868 if (PcdGet32 (PcdMaximumAsciiStringLength) != 0) {
869 ASSERT (Length <= PcdGet32 (PcdMaximumAsciiStringLength));
870 }
871
872 while ((*FirstString != '\0') &&
873 (*SecondString != '\0') &&
874 (*FirstString == *SecondString) &&
875 (Length > 1))
876 {
877 FirstString++;
878 SecondString++;
879 Length--;
880 }
881
882 return *FirstString - *SecondString;
883}
884
909CHAR8 *
910EFIAPI
912 IN CONST CHAR8 *String,
913 IN CONST CHAR8 *SearchString
914 )
915{
916 CONST CHAR8 *FirstMatch;
917 CONST CHAR8 *SearchStringTmp;
918
919 //
920 // ASSERT both strings are less long than PcdMaximumAsciiStringLength
921 //
922 ASSERT (AsciiStrSize (String) != 0);
923 ASSERT (AsciiStrSize (SearchString) != 0);
924
925 if (*SearchString == '\0') {
926 return (CHAR8 *)String;
927 }
928
929 while (*String != '\0') {
930 SearchStringTmp = SearchString;
931 FirstMatch = String;
932
933 while ( (*String == *SearchStringTmp)
934 && (*String != '\0'))
935 {
936 String++;
937 SearchStringTmp++;
938 }
939
940 if (*SearchStringTmp == '\0') {
941 return (CHAR8 *)FirstMatch;
942 }
943
944 if (*String == '\0') {
945 return NULL;
946 }
947
948 String = FirstMatch + 1;
949 }
950
951 return NULL;
952}
953
984UINTN
985EFIAPI
987 IN CONST CHAR8 *String
988 )
989{
990 UINTN Result;
991
992 AsciiStrDecimalToUintnS (String, (CHAR8 **)NULL, &Result);
993 return Result;
994}
995
1026UINT64
1027EFIAPI
1029 IN CONST CHAR8 *String
1030 )
1031{
1032 UINT64 Result;
1033
1034 AsciiStrDecimalToUint64S (String, (CHAR8 **)NULL, &Result);
1035 return Result;
1036}
1037
1072UINTN
1073EFIAPI
1075 IN CONST CHAR8 *String
1076 )
1077{
1078 UINTN Result;
1079
1080 AsciiStrHexToUintnS (String, (CHAR8 **)NULL, &Result);
1081 return Result;
1082}
1083
1118UINT64
1119EFIAPI
1121 IN CONST CHAR8 *String
1122 )
1123{
1124 UINT64 Result;
1125
1126 AsciiStrHexToUint64S (String, (CHAR8 **)NULL, &Result);
1127 return Result;
1128}
1129
1130STATIC CHAR8 EncodingTable[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
1131 "abcdefghijklmnopqrstuvwxyz"
1132 "0123456789+/";
1133
1153RETURN_STATUS
1154EFIAPI
1156 IN CONST UINT8 *Source,
1157 IN UINTN SourceLength,
1158 OUT CHAR8 *Destination OPTIONAL,
1159 IN OUT UINTN *DestinationSize
1160 )
1161{
1162 UINTN RequiredSize;
1163 UINTN Left;
1164
1165 //
1166 // Check pointers, and SourceLength is valid
1167 //
1168 if ((Source == NULL) || (DestinationSize == NULL)) {
1170 }
1171
1172 //
1173 // Allow for RFC 4648 test vector 1
1174 //
1175 if (SourceLength == 0) {
1176 if (*DestinationSize < 1) {
1177 *DestinationSize = 1;
1179 }
1180
1181 *DestinationSize = 1;
1182 *Destination = '\0';
1183 return RETURN_SUCCESS;
1184 }
1185
1186 //
1187 // Check if SourceLength or DestinationSize is valid
1188 //
1189 if ((SourceLength >= (MAX_ADDRESS - (UINTN)Source)) || (*DestinationSize >= (MAX_ADDRESS - (UINTN)Destination))) {
1191 }
1192
1193 //
1194 // 4 ascii per 3 bytes + NULL
1195 //
1196 RequiredSize = ((SourceLength + 2) / 3) * 4 + 1;
1197 if ((Destination == NULL) || (*DestinationSize < RequiredSize)) {
1198 *DestinationSize = RequiredSize;
1200 }
1201
1202 Left = SourceLength;
1203
1204 //
1205 // Encode 24 bits (three bytes) into 4 ascii characters
1206 //
1207 while (Left >= 3) {
1208 *Destination++ = EncodingTable[(Source[0] & 0xfc) >> 2];
1209 *Destination++ = EncodingTable[((Source[0] & 0x03) << 4) + ((Source[1] & 0xf0) >> 4)];
1210 *Destination++ = EncodingTable[((Source[1] & 0x0f) << 2) + ((Source[2] & 0xc0) >> 6)];
1211 *Destination++ = EncodingTable[(Source[2] & 0x3f)];
1212 Left -= 3;
1213 Source += 3;
1214 }
1215
1216 //
1217 // Handle the remainder, and add padding '=' characters as necessary.
1218 //
1219 switch (Left) {
1220 case 0:
1221
1222 //
1223 // No bytes Left, done.
1224 //
1225 break;
1226 case 1:
1227
1228 //
1229 // One more data byte, two pad characters
1230 //
1231 *Destination++ = EncodingTable[(Source[0] & 0xfc) >> 2];
1232 *Destination++ = EncodingTable[((Source[0] & 0x03) << 4)];
1233 *Destination++ = '=';
1234 *Destination++ = '=';
1235 break;
1236 case 2:
1237
1238 //
1239 // Two more data bytes, and one pad character
1240 //
1241 *Destination++ = EncodingTable[(Source[0] & 0xfc) >> 2];
1242 *Destination++ = EncodingTable[((Source[0] & 0x03) << 4) + ((Source[1] & 0xf0) >> 4)];
1243 *Destination++ = EncodingTable[((Source[1] & 0x0f) << 2)];
1244 *Destination++ = '=';
1245 break;
1246 }
1247
1248 //
1249 // Add terminating NULL
1250 //
1251 *Destination = '\0';
1252 return RETURN_SUCCESS;
1253}
1254
1337RETURN_STATUS
1338EFIAPI
1340 IN CONST CHAR8 *Source OPTIONAL,
1341 IN UINTN SourceSize,
1342 OUT UINT8 *Destination OPTIONAL,
1343 IN OUT UINTN *DestinationSize
1344 )
1345{
1346 BOOLEAN PaddingMode;
1347 UINTN SixBitGroupsConsumed;
1348 UINT32 Accumulator;
1349 UINTN OriginalDestinationSize;
1350 UINTN SourceIndex;
1351 CHAR8 SourceChar;
1352 UINT32 Base64Value;
1353 UINT8 DestinationOctet;
1354
1355 if (DestinationSize == NULL) {
1357 }
1358
1359 //
1360 // Check Source array validity.
1361 //
1362 if (Source == NULL) {
1363 if (SourceSize > 0) {
1364 //
1365 // At least one CHAR8 element at NULL Source.
1366 //
1368 }
1369 } else if (SourceSize > MAX_ADDRESS - (UINTN)Source) {
1370 //
1371 // Non-NULL Source, but it wraps around.
1372 //
1374 }
1375
1376 //
1377 // Check Destination array validity.
1378 //
1379 if (Destination == NULL) {
1380 if (*DestinationSize > 0) {
1381 //
1382 // At least one UINT8 element at NULL Destination.
1383 //
1385 }
1386 } else if (*DestinationSize > MAX_ADDRESS - (UINTN)Destination) {
1387 //
1388 // Non-NULL Destination, but it wraps around.
1389 //
1391 }
1392
1393 //
1394 // Check for overlap.
1395 //
1396 if ((Source != NULL) && (Destination != NULL)) {
1397 //
1398 // Both arrays have been provided, and we know from earlier that each array
1399 // is valid in itself.
1400 //
1401 if ((UINTN)Source + SourceSize <= (UINTN)Destination) {
1402 //
1403 // Source array precedes Destination array, OK.
1404 //
1405 } else if ((UINTN)Destination + *DestinationSize <= (UINTN)Source) {
1406 //
1407 // Destination array precedes Source array, OK.
1408 //
1409 } else {
1410 //
1411 // Overlap.
1412 //
1414 }
1415 }
1416
1417 //
1418 // Decoding loop setup.
1419 //
1420 PaddingMode = FALSE;
1421 SixBitGroupsConsumed = 0;
1422 Accumulator = 0;
1423 OriginalDestinationSize = *DestinationSize;
1424 *DestinationSize = 0;
1425
1426 //
1427 // Decoding loop.
1428 //
1429 for (SourceIndex = 0; SourceIndex < SourceSize; SourceIndex++) {
1430 SourceChar = Source[SourceIndex];
1431
1432 //
1433 // Whitespace is ignored at all positions (regardless of padding mode).
1434 //
1435 if ((SourceChar == '\t') || (SourceChar == '\n') || (SourceChar == '\v') ||
1436 (SourceChar == '\f') || (SourceChar == '\r') || (SourceChar == ' '))
1437 {
1438 continue;
1439 }
1440
1441 //
1442 // If we're in padding mode, accept another padding character, as long as
1443 // that padding character completes the quantum. This completes case (2)
1444 // from RFC4648, Chapter 4. "Base 64 Encoding":
1445 //
1446 // (2) The final quantum of encoding input is exactly 8 bits; here, the
1447 // final unit of encoded output will be two characters followed by two
1448 // "=" padding characters.
1449 //
1450 if (PaddingMode) {
1451 if ((SourceChar == '=') && (SixBitGroupsConsumed == 3)) {
1452 SixBitGroupsConsumed = 0;
1453 continue;
1454 }
1455
1457 }
1458
1459 //
1460 // When not in padding mode, decode Base64Value based on RFC4648, "Table 1:
1461 // The Base 64 Alphabet".
1462 //
1463 if (('A' <= SourceChar) && (SourceChar <= 'Z')) {
1464 Base64Value = SourceChar - 'A';
1465 } else if (('a' <= SourceChar) && (SourceChar <= 'z')) {
1466 Base64Value = 26 + (SourceChar - 'a');
1467 } else if (('0' <= SourceChar) && (SourceChar <= '9')) {
1468 Base64Value = 52 + (SourceChar - '0');
1469 } else if (SourceChar == '+') {
1470 Base64Value = 62;
1471 } else if (SourceChar == '/') {
1472 Base64Value = 63;
1473 } else if (SourceChar == '=') {
1474 //
1475 // Enter padding mode.
1476 //
1477 PaddingMode = TRUE;
1478
1479 if (SixBitGroupsConsumed == 2) {
1480 //
1481 // If we have consumed two 6-bit groups from the current quantum before
1482 // encountering the first padding character, then this is case (2) from
1483 // RFC4648, Chapter 4. "Base 64 Encoding". Bump SixBitGroupsConsumed,
1484 // and we'll enforce another padding character.
1485 //
1486 SixBitGroupsConsumed = 3;
1487 } else if (SixBitGroupsConsumed == 3) {
1488 //
1489 // If we have consumed three 6-bit groups from the current quantum
1490 // before encountering the first padding character, then this is case
1491 // (3) from RFC4648, Chapter 4. "Base 64 Encoding". The quantum is now
1492 // complete.
1493 //
1494 SixBitGroupsConsumed = 0;
1495 } else {
1496 //
1497 // Padding characters are not allowed at the first two positions of a
1498 // quantum.
1499 //
1501 }
1502
1503 //
1504 // Wherever in a quantum we enter padding mode, we enforce the padding
1505 // bits pending in the accumulator -- from the last 6-bit group just
1506 // preceding the padding character -- to be zero. Refer to RFC4648,
1507 // Chapter 3.5. "Canonical Encoding".
1508 //
1509 if (Accumulator != 0) {
1511 }
1512
1513 //
1514 // Advance to the next source character.
1515 //
1516 continue;
1517 } else {
1518 //
1519 // Other characters outside of the encoding alphabet are rejected.
1520 //
1522 }
1523
1524 //
1525 // Feed the bits of the current 6-bit group of the quantum to the
1526 // accumulator.
1527 //
1528 Accumulator = (Accumulator << 6) | Base64Value;
1529 SixBitGroupsConsumed++;
1530 switch (SixBitGroupsConsumed) {
1531 case 1:
1532 //
1533 // No octet to spill after consuming the first 6-bit group of the
1534 // quantum; advance to the next source character.
1535 //
1536 continue;
1537 case 2:
1538 //
1539 // 12 bits accumulated (6 pending + 6 new); prepare for spilling an
1540 // octet. 4 bits remain pending.
1541 //
1542 DestinationOctet = (UINT8)(Accumulator >> 4);
1543 Accumulator &= 0xF;
1544 break;
1545 case 3:
1546 //
1547 // 10 bits accumulated (4 pending + 6 new); prepare for spilling an
1548 // octet. 2 bits remain pending.
1549 //
1550 DestinationOctet = (UINT8)(Accumulator >> 2);
1551 Accumulator &= 0x3;
1552 break;
1553 default:
1554 ASSERT (SixBitGroupsConsumed == 4);
1555 //
1556 // 8 bits accumulated (2 pending + 6 new); prepare for spilling an octet.
1557 // The quantum is complete, 0 bits remain pending.
1558 //
1559 DestinationOctet = (UINT8)Accumulator;
1560 Accumulator = 0;
1561 SixBitGroupsConsumed = 0;
1562 break;
1563 }
1564
1565 //
1566 // Store the decoded octet if there's room left. Increment
1567 // (*DestinationSize) unconditionally.
1568 //
1569 if (*DestinationSize < OriginalDestinationSize) {
1570 ASSERT (Destination != NULL);
1571 Destination[*DestinationSize] = DestinationOctet;
1572 }
1573
1574 (*DestinationSize)++;
1575
1576 //
1577 // Advance to the next source character.
1578 //
1579 }
1580
1581 //
1582 // If Source terminates mid-quantum, then Source is invalid.
1583 //
1584 if (SixBitGroupsConsumed != 0) {
1586 }
1587
1588 //
1589 // Done.
1590 //
1591 if (*DestinationSize <= OriginalDestinationSize) {
1592 return RETURN_SUCCESS;
1593 }
1594
1596}
1597
1611UINT8
1612EFIAPI
1614 IN UINT8 Value
1615 )
1616{
1617 ASSERT (Value < 100);
1618 return (UINT8)(((Value / 10) << 4) | (Value % 10));
1619}
1620
1635UINT8
1636EFIAPI
1638 IN UINT8 Value
1639 )
1640{
1641 ASSERT (Value < 0xa0);
1642 ASSERT ((Value & 0xf) < 0xa);
1643 return (UINT8)((Value >> 4) * 10 + (Value & 0xf));
1644}
UINT64 UINTN
INT64 INTN
#define MAX_ADDRESS
#define NULL
Definition: Base.h:312
#define CONST
Definition: Base.h:259
#define RETURN_BUFFER_TOO_SMALL
Definition: Base.h:989
#define STATIC
Definition: Base.h:264
#define RETURN_SUCCESS
Definition: Base.h:962
#define TRUE
Definition: Base.h:301
#define FALSE
Definition: Base.h:307
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
#define RETURN_INVALID_PARAMETER
Definition: Base.h:972
RETURN_STATUS EFIAPI AsciiStrHexToUint64S(IN CONST CHAR8 *String, OUT CHAR8 **EndPointer OPTIONAL, OUT UINT64 *Data)
Definition: SafeString.c:2514
RETURN_STATUS EFIAPI StrDecimalToUint64S(IN CONST CHAR16 *String, OUT CHAR16 **EndPointer OPTIONAL, OUT UINT64 *Data)
Definition: SafeString.c:743
RETURN_STATUS EFIAPI AsciiStrDecimalToUintnS(IN CONST CHAR8 *String, OUT CHAR8 **EndPointer OPTIONAL, OUT UINTN *Data)
Definition: SafeString.c:2170
RETURN_STATUS EFIAPI AsciiStrHexToUintnS(IN CONST CHAR8 *String, OUT CHAR8 **EndPointer OPTIONAL, OUT UINTN *Data)
Definition: SafeString.c:2390
RETURN_STATUS EFIAPI AsciiStrDecimalToUint64S(IN CONST CHAR8 *String, OUT CHAR8 **EndPointer OPTIONAL, OUT UINT64 *Data)
Definition: SafeString.c:2278
RETURN_STATUS EFIAPI StrHexToUintnS(IN CONST CHAR16 *String, OUT CHAR16 **EndPointer OPTIONAL, OUT UINTN *Data)
Definition: SafeString.c:860
RETURN_STATUS EFIAPI StrDecimalToUintnS(IN CONST CHAR16 *String, OUT CHAR16 **EndPointer OPTIONAL, OUT UINTN *Data)
Definition: SafeString.c:631
RETURN_STATUS EFIAPI StrHexToUint64S(IN CONST CHAR16 *String, OUT CHAR16 **EndPointer OPTIONAL, OUT UINT64 *Data)
Definition: SafeString.c:989
#define ASSERT(Expression)
Definition: DebugLib.h:391
INTN EFIAPI AsciiStriCmp(IN CONST CHAR8 *FirstString, IN CONST CHAR8 *SecondString)
Definition: String.c:794
UINT64 EFIAPI StrHexToUint64(IN CONST CHAR16 *String)
Definition: String.c:545
UINT8 EFIAPI BcdToDecimal8(IN UINT8 Value)
Definition: String.c:1637
UINTN EFIAPI StrSize(IN CONST CHAR16 *String)
Definition: String.c:72
BOOLEAN EFIAPI InternalAsciiIsDecimalDigitCharacter(IN CHAR8 Char)
Definition: String.c:570
CHAR16 EFIAPI CharToUpper(IN CHAR16 Char)
Definition: String.c:307
UINTN EFIAPI StrDecimalToUintn(IN CONST CHAR16 *String)
Definition: String.c:405
INTN EFIAPI StrCmp(IN CONST CHAR16 *FirstString, IN CONST CHAR16 *SecondString)
Definition: String.c:109
BOOLEAN EFIAPI InternalIsDecimalDigitCharacter(IN CHAR16 Char)
Definition: String.c:283
UINT64 EFIAPI AsciiStrDecimalToUint64(IN CONST CHAR8 *String)
Definition: String.c:1028
UINTN EFIAPI AsciiStrLen(IN CONST CHAR8 *String)
Definition: String.c:621
BOOLEAN EFIAPI InternalAsciiIsHexaDecimalDigitCharacter(IN CHAR8 Char)
Definition: String.c:593
UINTN EFIAPI InternalAsciiHexCharToUintn(IN CHAR8 Char)
Definition: String.c:752
UINT64 EFIAPI StrDecimalToUint64(IN CONST CHAR16 *String)
Definition: String.c:451
INTN EFIAPI AsciiStrCmp(IN CONST CHAR8 *FirstString, IN CONST CHAR8 *SecondString)
Definition: String.c:696
INTN EFIAPI AsciiStrnCmp(IN CONST CHAR8 *FirstString, IN CONST CHAR8 *SecondString, IN UINTN Length)
Definition: String.c:852
RETURN_STATUS EFIAPI Base64Decode(IN CONST CHAR8 *Source OPTIONAL, IN UINTN SourceSize, OUT UINT8 *Destination OPTIONAL, IN OUT UINTN *DestinationSize)
Definition: String.c:1339
UINTN EFIAPI AsciiStrDecimalToUintn(IN CONST CHAR8 *String)
Definition: String.c:986
UINTN EFIAPI StrHexToUintn(IN CONST CHAR16 *String)
Definition: String.c:498
UINTN EFIAPI InternalHexCharToUintn(IN CHAR16 Char)
Definition: String.c:333
INTN EFIAPI StrnCmp(IN CONST CHAR16 *FirstString, IN CONST CHAR16 *SecondString, IN UINTN Length)
Definition: String.c:162
UINTN EFIAPI AsciiStrHexToUintn(IN CONST CHAR8 *String)
Definition: String.c:1074
UINT8 EFIAPI DecimalToBcd8(IN UINT8 Value)
Definition: String.c:1613
UINTN EFIAPI AsciiStrSize(IN CONST CHAR8 *String)
Definition: String.c:661
UINTN EFIAPI StrLen(IN CONST CHAR16 *String)
Definition: String.c:30
CHAR8 *EFIAPI AsciiStrStr(IN CONST CHAR8 *String, IN CONST CHAR8 *SearchString)
Definition: String.c:911
CHAR8 EFIAPI AsciiCharToUpper(IN CHAR8 Chr)
Definition: String.c:730
UINT64 EFIAPI AsciiStrHexToUint64(IN CONST CHAR8 *String)
Definition: String.c:1120
CHAR16 *EFIAPI StrStr(IN CONST CHAR16 *String, IN CONST CHAR16 *SearchString)
Definition: String.c:224
RETURN_STATUS EFIAPI Base64Encode(IN CONST UINT8 *Source, IN UINTN SourceLength, OUT CHAR8 *Destination OPTIONAL, IN OUT UINTN *DestinationSize)
Definition: String.c:1155
BOOLEAN EFIAPI InternalIsHexaDecimalDigitCharacter(IN CHAR16 Char)
Definition: String.c:360
#define PcdGet32(TokenName)
Definition: PcdLib.h:362