TianoCore EDK2 master
Loading...
Searching...
No Matches
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 if (RETURN_ERROR (StrDecimalToUintnS (String, (CHAR16 **)NULL, &Result))) {
412 return MAX_UINTN;
413 }
414
415 return Result;
416}
417
452UINT64
453EFIAPI
455 IN CONST CHAR16 *String
456 )
457{
458 UINT64 Result;
459
460 if (RETURN_ERROR (StrDecimalToUint64S (String, (CHAR16 **)NULL, &Result))) {
461 return MAX_UINT64;
462 }
463
464 return Result;
465}
466
502UINTN
503EFIAPI
505 IN CONST CHAR16 *String
506 )
507{
508 UINTN Result;
509
510 if (RETURN_ERROR (StrHexToUintnS (String, (CHAR16 **)NULL, &Result))) {
511 return MAX_UINTN;
512 }
513
514 return Result;
515}
516
552UINT64
553EFIAPI
555 IN CONST CHAR16 *String
556 )
557{
558 UINT64 Result;
559
560 if (RETURN_ERROR (StrHexToUint64S (String, (CHAR16 **)NULL, &Result))) {
561 return MAX_UINT64;
562 }
563
564 return Result;
565}
566
580BOOLEAN
581EFIAPI
583 IN CHAR8 Char
584 )
585{
586 return (BOOLEAN)(Char >= '0' && Char <= '9');
587}
588
603BOOLEAN
604EFIAPI
606 IN CHAR8 Char
607 )
608{
609 return (BOOLEAN)(InternalAsciiIsDecimalDigitCharacter (Char) ||
610 (Char >= 'A' && Char <= 'F') ||
611 (Char >= 'a' && Char <= 'f'));
612}
613
631UINTN
632EFIAPI
634 IN CONST CHAR8 *String
635 )
636{
637 UINTN Length;
638
639 ASSERT (String != NULL);
640
641 for (Length = 0; *String != '\0'; String++, Length++) {
642 //
643 // If PcdMaximumUnicodeStringLength is not zero,
644 // length should not more than PcdMaximumUnicodeStringLength
645 //
646 if (PcdGet32 (PcdMaximumAsciiStringLength) != 0) {
647 ASSERT (Length < PcdGet32 (PcdMaximumAsciiStringLength));
648 }
649 }
650
651 return Length;
652}
653
671UINTN
672EFIAPI
674 IN CONST CHAR8 *String
675 )
676{
677 return (AsciiStrLen (String) + 1) * sizeof (*String);
678}
679
706INTN
707EFIAPI
709 IN CONST CHAR8 *FirstString,
710 IN CONST CHAR8 *SecondString
711 )
712{
713 //
714 // ASSERT both strings are less long than PcdMaximumAsciiStringLength
715 //
716 ASSERT (AsciiStrSize (FirstString));
717 ASSERT (AsciiStrSize (SecondString));
718
719 while ((*FirstString != '\0') && (*FirstString == *SecondString)) {
720 FirstString++;
721 SecondString++;
722 }
723
724 return *FirstString - *SecondString;
725}
726
740CHAR8
741EFIAPI
743 IN CHAR8 Chr
744 )
745{
746 return (UINT8)((Chr >= 'a' && Chr <= 'z') ? Chr - ('a' - 'A') : Chr);
747}
748
762UINTN
763EFIAPI
765 IN CHAR8 Char
766 )
767{
769 return Char - '0';
770 }
771
772 return (10 + AsciiCharToUpper (Char) - 'A');
773}
774
804INTN
805EFIAPI
807 IN CONST CHAR8 *FirstString,
808 IN CONST CHAR8 *SecondString
809 )
810{
811 CHAR8 UpperFirstString;
812 CHAR8 UpperSecondString;
813
814 //
815 // ASSERT both strings are less long than PcdMaximumAsciiStringLength
816 //
817 ASSERT (AsciiStrSize (FirstString));
818 ASSERT (AsciiStrSize (SecondString));
819
820 UpperFirstString = AsciiCharToUpper (*FirstString);
821 UpperSecondString = AsciiCharToUpper (*SecondString);
822 while ((*FirstString != '\0') && (*SecondString != '\0') && (UpperFirstString == UpperSecondString)) {
823 FirstString++;
824 SecondString++;
825 UpperFirstString = AsciiCharToUpper (*FirstString);
826 UpperSecondString = AsciiCharToUpper (*SecondString);
827 }
828
829 return UpperFirstString - UpperSecondString;
830}
831
862INTN
863EFIAPI
865 IN CONST CHAR8 *FirstString,
866 IN CONST CHAR8 *SecondString,
867 IN UINTN Length
868 )
869{
870 if (Length == 0) {
871 return 0;
872 }
873
874 //
875 // ASSERT both strings are less long than PcdMaximumAsciiStringLength
876 //
877 ASSERT (AsciiStrSize (FirstString));
878 ASSERT (AsciiStrSize (SecondString));
879
880 if (PcdGet32 (PcdMaximumAsciiStringLength) != 0) {
881 ASSERT (Length <= PcdGet32 (PcdMaximumAsciiStringLength));
882 }
883
884 while ((*FirstString != '\0') &&
885 (*SecondString != '\0') &&
886 (*FirstString == *SecondString) &&
887 (Length > 1))
888 {
889 FirstString++;
890 SecondString++;
891 Length--;
892 }
893
894 return *FirstString - *SecondString;
895}
896
921CHAR8 *
922EFIAPI
924 IN CONST CHAR8 *String,
925 IN CONST CHAR8 *SearchString
926 )
927{
928 CONST CHAR8 *FirstMatch;
929 CONST CHAR8 *SearchStringTmp;
930
931 //
932 // ASSERT both strings are less long than PcdMaximumAsciiStringLength
933 //
934 ASSERT (AsciiStrSize (String) != 0);
935 ASSERT (AsciiStrSize (SearchString) != 0);
936
937 if (*SearchString == '\0') {
938 return (CHAR8 *)String;
939 }
940
941 while (*String != '\0') {
942 SearchStringTmp = SearchString;
943 FirstMatch = String;
944
945 while ( (*String == *SearchStringTmp)
946 && (*String != '\0'))
947 {
948 String++;
949 SearchStringTmp++;
950 }
951
952 if (*SearchStringTmp == '\0') {
953 return (CHAR8 *)FirstMatch;
954 }
955
956 if (*String == '\0') {
957 return NULL;
958 }
959
960 String = FirstMatch + 1;
961 }
962
963 return NULL;
964}
965
996UINTN
997EFIAPI
999 IN CONST CHAR8 *String
1000 )
1001{
1002 UINTN Result;
1003
1004 if (RETURN_ERROR (AsciiStrDecimalToUintnS (String, (CHAR8 **)NULL, &Result))) {
1005 return MAX_UINTN;
1006 }
1007
1008 return Result;
1009}
1010
1041UINT64
1042EFIAPI
1044 IN CONST CHAR8 *String
1045 )
1046{
1047 UINT64 Result;
1048
1049 if (RETURN_ERROR (AsciiStrDecimalToUint64S (String, (CHAR8 **)NULL, &Result))) {
1050 return MAX_UINT64;
1051 }
1052
1053 return Result;
1054}
1055
1090UINTN
1091EFIAPI
1093 IN CONST CHAR8 *String
1094 )
1095{
1096 UINTN Result;
1097
1098 if (RETURN_ERROR (AsciiStrHexToUintnS (String, (CHAR8 **)NULL, &Result))) {
1099 return MAX_UINTN;
1100 }
1101
1102 return Result;
1103}
1104
1139UINT64
1140EFIAPI
1142 IN CONST CHAR8 *String
1143 )
1144{
1145 UINT64 Result;
1146
1147 if (RETURN_ERROR (AsciiStrHexToUint64S (String, (CHAR8 **)NULL, &Result))) {
1148 return MAX_UINT64;
1149 }
1150
1151 return Result;
1152}
1153
1154STATIC CHAR8 EncodingTable[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
1155 "abcdefghijklmnopqrstuvwxyz"
1156 "0123456789+/";
1157
1177RETURN_STATUS
1178EFIAPI
1180 IN CONST UINT8 *Source,
1181 IN UINTN SourceLength,
1182 OUT CHAR8 *Destination OPTIONAL,
1183 IN OUT UINTN *DestinationSize
1184 )
1185{
1186 UINTN RequiredSize;
1187 UINTN Left;
1188
1189 //
1190 // Check pointers, and SourceLength is valid
1191 //
1192 if ((Source == NULL) || (DestinationSize == NULL)) {
1194 }
1195
1196 //
1197 // Allow for RFC 4648 test vector 1
1198 //
1199 if (SourceLength == 0) {
1200 if (*DestinationSize < 1) {
1201 *DestinationSize = 1;
1203 }
1204
1205 *DestinationSize = 1;
1206 *Destination = '\0';
1207 return RETURN_SUCCESS;
1208 }
1209
1210 //
1211 // Check if SourceLength or DestinationSize is valid
1212 //
1213 if ((SourceLength >= (MAX_ADDRESS - (UINTN)Source)) || (*DestinationSize >= (MAX_ADDRESS - (UINTN)Destination))) {
1215 }
1216
1217 //
1218 // 4 ascii per 3 bytes + NULL
1219 //
1220 RequiredSize = ((SourceLength + 2) / 3) * 4 + 1;
1221 if ((Destination == NULL) || (*DestinationSize < RequiredSize)) {
1222 *DestinationSize = RequiredSize;
1224 }
1225
1226 Left = SourceLength;
1227
1228 //
1229 // Encode 24 bits (three bytes) into 4 ascii characters
1230 //
1231 while (Left >= 3) {
1232 *Destination++ = EncodingTable[(Source[0] & 0xfc) >> 2];
1233 *Destination++ = EncodingTable[((Source[0] & 0x03) << 4) + ((Source[1] & 0xf0) >> 4)];
1234 *Destination++ = EncodingTable[((Source[1] & 0x0f) << 2) + ((Source[2] & 0xc0) >> 6)];
1235 *Destination++ = EncodingTable[(Source[2] & 0x3f)];
1236 Left -= 3;
1237 Source += 3;
1238 }
1239
1240 //
1241 // Handle the remainder, and add padding '=' characters as necessary.
1242 //
1243 switch (Left) {
1244 case 0:
1245
1246 //
1247 // No bytes Left, done.
1248 //
1249 break;
1250 case 1:
1251
1252 //
1253 // One more data byte, two pad characters
1254 //
1255 *Destination++ = EncodingTable[(Source[0] & 0xfc) >> 2];
1256 *Destination++ = EncodingTable[((Source[0] & 0x03) << 4)];
1257 *Destination++ = '=';
1258 *Destination++ = '=';
1259 break;
1260 case 2:
1261
1262 //
1263 // Two more data bytes, and one pad character
1264 //
1265 *Destination++ = EncodingTable[(Source[0] & 0xfc) >> 2];
1266 *Destination++ = EncodingTable[((Source[0] & 0x03) << 4) + ((Source[1] & 0xf0) >> 4)];
1267 *Destination++ = EncodingTable[((Source[1] & 0x0f) << 2)];
1268 *Destination++ = '=';
1269 break;
1270 }
1271
1272 //
1273 // Add terminating NULL
1274 //
1275 *Destination = '\0';
1276 return RETURN_SUCCESS;
1277}
1278
1361RETURN_STATUS
1362EFIAPI
1364 IN CONST CHAR8 *Source OPTIONAL,
1365 IN UINTN SourceSize,
1366 OUT UINT8 *Destination OPTIONAL,
1367 IN OUT UINTN *DestinationSize
1368 )
1369{
1370 BOOLEAN PaddingMode;
1371 UINTN SixBitGroupsConsumed;
1372 UINT32 Accumulator;
1373 UINTN OriginalDestinationSize;
1374 UINTN SourceIndex;
1375 CHAR8 SourceChar;
1376 UINT32 Base64Value;
1377 UINT8 DestinationOctet;
1378
1379 if (DestinationSize == NULL) {
1381 }
1382
1383 //
1384 // Check Source array validity.
1385 //
1386 if (Source == NULL) {
1387 if (SourceSize > 0) {
1388 //
1389 // At least one CHAR8 element at NULL Source.
1390 //
1392 }
1393 } else if (SourceSize > MAX_ADDRESS - (UINTN)Source) {
1394 //
1395 // Non-NULL Source, but it wraps around.
1396 //
1398 }
1399
1400 //
1401 // Check Destination array validity.
1402 //
1403 if (Destination == NULL) {
1404 if (*DestinationSize > 0) {
1405 //
1406 // At least one UINT8 element at NULL Destination.
1407 //
1409 }
1410 } else if (*DestinationSize > MAX_ADDRESS - (UINTN)Destination) {
1411 //
1412 // Non-NULL Destination, but it wraps around.
1413 //
1415 }
1416
1417 //
1418 // Check for overlap.
1419 //
1420 if ((Source != NULL) && (Destination != NULL)) {
1421 //
1422 // Both arrays have been provided, and we know from earlier that each array
1423 // is valid in itself.
1424 //
1425 if ((UINTN)Source + SourceSize <= (UINTN)Destination) {
1426 //
1427 // Source array precedes Destination array, OK.
1428 //
1429 } else if ((UINTN)Destination + *DestinationSize <= (UINTN)Source) {
1430 //
1431 // Destination array precedes Source array, OK.
1432 //
1433 } else {
1434 //
1435 // Overlap.
1436 //
1438 }
1439 }
1440
1441 //
1442 // Decoding loop setup.
1443 //
1444 PaddingMode = FALSE;
1445 SixBitGroupsConsumed = 0;
1446 Accumulator = 0;
1447 OriginalDestinationSize = *DestinationSize;
1448 *DestinationSize = 0;
1449
1450 //
1451 // Decoding loop.
1452 //
1453 for (SourceIndex = 0; SourceIndex < SourceSize; SourceIndex++) {
1454 SourceChar = Source[SourceIndex];
1455
1456 //
1457 // Whitespace is ignored at all positions (regardless of padding mode).
1458 //
1459 if ((SourceChar == '\t') || (SourceChar == '\n') || (SourceChar == '\v') ||
1460 (SourceChar == '\f') || (SourceChar == '\r') || (SourceChar == ' '))
1461 {
1462 continue;
1463 }
1464
1465 //
1466 // If we're in padding mode, accept another padding character, as long as
1467 // that padding character completes the quantum. This completes case (2)
1468 // from RFC4648, Chapter 4. "Base 64 Encoding":
1469 //
1470 // (2) The final quantum of encoding input is exactly 8 bits; here, the
1471 // final unit of encoded output will be two characters followed by two
1472 // "=" padding characters.
1473 //
1474 if (PaddingMode) {
1475 if ((SourceChar == '=') && (SixBitGroupsConsumed == 3)) {
1476 SixBitGroupsConsumed = 0;
1477 continue;
1478 }
1479
1481 }
1482
1483 //
1484 // When not in padding mode, decode Base64Value based on RFC4648, "Table 1:
1485 // The Base 64 Alphabet".
1486 //
1487 if (('A' <= SourceChar) && (SourceChar <= 'Z')) {
1488 Base64Value = SourceChar - 'A';
1489 } else if (('a' <= SourceChar) && (SourceChar <= 'z')) {
1490 Base64Value = 26 + (SourceChar - 'a');
1491 } else if (('0' <= SourceChar) && (SourceChar <= '9')) {
1492 Base64Value = 52 + (SourceChar - '0');
1493 } else if (SourceChar == '+') {
1494 Base64Value = 62;
1495 } else if (SourceChar == '/') {
1496 Base64Value = 63;
1497 } else if (SourceChar == '=') {
1498 //
1499 // Enter padding mode.
1500 //
1501 PaddingMode = TRUE;
1502
1503 if (SixBitGroupsConsumed == 2) {
1504 //
1505 // If we have consumed two 6-bit groups from the current quantum before
1506 // encountering the first padding character, then this is case (2) from
1507 // RFC4648, Chapter 4. "Base 64 Encoding". Bump SixBitGroupsConsumed,
1508 // and we'll enforce another padding character.
1509 //
1510 SixBitGroupsConsumed = 3;
1511 } else if (SixBitGroupsConsumed == 3) {
1512 //
1513 // If we have consumed three 6-bit groups from the current quantum
1514 // before encountering the first padding character, then this is case
1515 // (3) from RFC4648, Chapter 4. "Base 64 Encoding". The quantum is now
1516 // complete.
1517 //
1518 SixBitGroupsConsumed = 0;
1519 } else {
1520 //
1521 // Padding characters are not allowed at the first two positions of a
1522 // quantum.
1523 //
1525 }
1526
1527 //
1528 // Wherever in a quantum we enter padding mode, we enforce the padding
1529 // bits pending in the accumulator -- from the last 6-bit group just
1530 // preceding the padding character -- to be zero. Refer to RFC4648,
1531 // Chapter 3.5. "Canonical Encoding".
1532 //
1533 if (Accumulator != 0) {
1535 }
1536
1537 //
1538 // Advance to the next source character.
1539 //
1540 continue;
1541 } else {
1542 //
1543 // Other characters outside of the encoding alphabet are rejected.
1544 //
1546 }
1547
1548 //
1549 // Feed the bits of the current 6-bit group of the quantum to the
1550 // accumulator.
1551 //
1552 Accumulator = (Accumulator << 6) | Base64Value;
1553 SixBitGroupsConsumed++;
1554 switch (SixBitGroupsConsumed) {
1555 case 1:
1556 //
1557 // No octet to spill after consuming the first 6-bit group of the
1558 // quantum; advance to the next source character.
1559 //
1560 continue;
1561 case 2:
1562 //
1563 // 12 bits accumulated (6 pending + 6 new); prepare for spilling an
1564 // octet. 4 bits remain pending.
1565 //
1566 DestinationOctet = (UINT8)(Accumulator >> 4);
1567 Accumulator &= 0xF;
1568 break;
1569 case 3:
1570 //
1571 // 10 bits accumulated (4 pending + 6 new); prepare for spilling an
1572 // octet. 2 bits remain pending.
1573 //
1574 DestinationOctet = (UINT8)(Accumulator >> 2);
1575 Accumulator &= 0x3;
1576 break;
1577 default:
1578 ASSERT (SixBitGroupsConsumed == 4);
1579 //
1580 // 8 bits accumulated (2 pending + 6 new); prepare for spilling an octet.
1581 // The quantum is complete, 0 bits remain pending.
1582 //
1583 DestinationOctet = (UINT8)Accumulator;
1584 Accumulator = 0;
1585 SixBitGroupsConsumed = 0;
1586 break;
1587 }
1588
1589 //
1590 // Store the decoded octet if there's room left. Increment
1591 // (*DestinationSize) unconditionally.
1592 //
1593 if (*DestinationSize < OriginalDestinationSize) {
1594 ASSERT (Destination != NULL);
1595 Destination[*DestinationSize] = DestinationOctet;
1596 }
1597
1598 (*DestinationSize)++;
1599
1600 //
1601 // Advance to the next source character.
1602 //
1603 }
1604
1605 //
1606 // If Source terminates mid-quantum, then Source is invalid.
1607 //
1608 if (SixBitGroupsConsumed != 0) {
1610 }
1611
1612 //
1613 // Done.
1614 //
1615 if (*DestinationSize <= OriginalDestinationSize) {
1616 return RETURN_SUCCESS;
1617 }
1618
1620}
1621
1635UINT8
1636EFIAPI
1638 IN UINT8 Value
1639 )
1640{
1641 ASSERT (Value < 100);
1642 return (UINT8)(((Value / 10) << 4) | (Value % 10));
1643}
1644
1659UINT8
1660EFIAPI
1662 IN UINT8 Value
1663 )
1664{
1665 ASSERT (Value < 0xa0);
1666 ASSERT ((Value & 0xf) < 0xa);
1667 return (UINT8)((Value >> 4) * 10 + (Value & 0xf));
1668}
UINT64 UINTN
INT64 INTN
#define MAX_ADDRESS
#define NULL
Definition: Base.h:319
#define CONST
Definition: Base.h:259
#define RETURN_BUFFER_TOO_SMALL
Definition: Base.h:1093
#define STATIC
Definition: Base.h:264
#define RETURN_ERROR(StatusCode)
Definition: Base.h:1061
#define RETURN_SUCCESS
Definition: Base.h:1066
#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:1076
UINTN EFIAPI StrSize(IN CONST CHAR16 *String)
Definition: String.c:72
RETURN_STATUS EFIAPI AsciiStrHexToUint64S(IN CONST CHAR8 *String, OUT CHAR8 **EndPointer OPTIONAL, OUT UINT64 *Data)
Definition: SafeString.c:2527
UINTN EFIAPI AsciiStrLen(IN CONST CHAR8 *String)
Definition: String.c:633
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:2179
RETURN_STATUS EFIAPI AsciiStrHexToUintnS(IN CONST CHAR8 *String, OUT CHAR8 **EndPointer OPTIONAL, OUT UINTN *Data)
Definition: SafeString.c:2399
RETURN_STATUS EFIAPI AsciiStrDecimalToUint64S(IN CONST CHAR8 *String, OUT CHAR8 **EndPointer OPTIONAL, OUT UINT64 *Data)
Definition: SafeString.c:2287
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:994
UINTN EFIAPI AsciiStrSize(IN CONST CHAR8 *String)
Definition: String.c:673
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:923
INTN EFIAPI AsciiStriCmp(IN CONST CHAR8 *FirstString, IN CONST CHAR8 *SecondString)
Definition: String.c:806
UINT64 EFIAPI StrHexToUint64(IN CONST CHAR16 *String)
Definition: String.c:554
UINT8 EFIAPI BcdToDecimal8(IN UINT8 Value)
Definition: String.c:1661
BOOLEAN EFIAPI InternalAsciiIsDecimalDigitCharacter(IN CHAR8 Char)
Definition: String.c:582
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:1043
BOOLEAN EFIAPI InternalAsciiIsHexaDecimalDigitCharacter(IN CHAR8 Char)
Definition: String.c:605
UINTN EFIAPI InternalAsciiHexCharToUintn(IN CHAR8 Char)
Definition: String.c:764
UINT64 EFIAPI StrDecimalToUint64(IN CONST CHAR16 *String)
Definition: String.c:454
INTN EFIAPI AsciiStrCmp(IN CONST CHAR8 *FirstString, IN CONST CHAR8 *SecondString)
Definition: String.c:708
INTN EFIAPI AsciiStrnCmp(IN CONST CHAR8 *FirstString, IN CONST CHAR8 *SecondString, IN UINTN Length)
Definition: String.c:864
RETURN_STATUS EFIAPI Base64Decode(IN CONST CHAR8 *Source OPTIONAL, IN UINTN SourceSize, OUT UINT8 *Destination OPTIONAL, IN OUT UINTN *DestinationSize)
Definition: String.c:1363
UINTN EFIAPI AsciiStrDecimalToUintn(IN CONST CHAR8 *String)
Definition: String.c:998
UINTN EFIAPI StrHexToUintn(IN CONST CHAR16 *String)
Definition: String.c:504
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:1092
UINT8 EFIAPI DecimalToBcd8(IN UINT8 Value)
Definition: String.c:1637
CHAR8 EFIAPI AsciiCharToUpper(IN CHAR8 Chr)
Definition: String.c:742
UINT64 EFIAPI AsciiStrHexToUint64(IN CONST CHAR8 *String)
Definition: String.c:1141
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:1179
BOOLEAN EFIAPI InternalIsHexaDecimalDigitCharacter(IN CHAR16 Char)
Definition: String.c:360
#define PcdGet32(TokenName)
Definition: PcdLib.h:362