TianoCore EDK2 master
Loading...
Searching...
No Matches
RedfishCrtLib.c
Go to the documentation of this file.
1
12#include <Uefi.h>
15#include <Library/SortLib.h>
17
18int errno = 0;
19char errnum_message[] = "We don't support to map errnum to the error message on edk2 Redfish\n";
20
21// This is required to keep VC++ happy if you use floating-point
22int _fltused = 1;
23
28int
30 int c
31 )
32{
33 //
34 // <alnum> ::= [0-9] | [a-z] | [A-Z]
35 //
36 return ((('0' <= (c)) && ((c) <= '9')) ||
37 (('a' <= (c)) && ((c) <= 'z')) ||
38 (('A' <= (c)) && ((c) <= 'Z')));
39}
40
46int
48 int c
49 )
50{
51 //
52 // [0-9] | [e +-.]
53 //
54 return ((('0' <= (c)) && ((c) <= '9')) ||
55 (c == 'e') || (c == 'E') ||
56 (c == '+') || (c == '-') ||
57 (c == '.'));
58}
59
65int
67 int c
68 )
69{
70 //
71 // <space> ::= [ ]
72 //
73 return ((c) == ' ') || ((c) == '\t') || ((c) == '\r') || ((c) == '\n') || ((c) == '\v') || ((c) == '\f');
74}
75
79void *
80malloc (
81 size_t size
82 )
83{
84 return AllocatePool ((UINTN)size);
85}
86
90void
91free (
92 void *ptr
93 )
94{
95 //
96 // In Standard C, free() handles a null pointer argument transparently. This
97 // is not true of FreePool() below, so protect it.
98 //
99 if (ptr != NULL) {
100 FreePool (ptr);
101 }
102}
103
109char *
111 const char *str
112 )
113{
114 size_t len;
115 char *copy;
116
117 len = strlen (str) + 1;
118 if ((copy = malloc (len)) == NULL) {
119 return (NULL);
120 }
121
122 memcpy (copy, str, len);
123 return (copy);
124}
125
138int
140 IN int c
141 )
142{
143 if ((c >= 'a') && (c <= 'z')) {
144 c = c - ('a' - 'A');
145 }
146
147 return c;
148}
149
155int
157 int c
158 )
159{
160 if (((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z'))) {
161 /* If c is one of [A-Za-z]... */
162 c = toupper (c) - 7; // Adjust so 'A' is ('9' + 1)
163 }
164
165 return c - '0'; // Value returned is between 0 and 35, inclusive.
166}
167
179long long
181 const char *nptr,
182 char **endptr,
183 int base
184 )
185{
186 const char *pEnd;
187 long long Result = 0;
188 long long Previous;
189 int temp;
190 BOOLEAN Negative = FALSE;
191
192 pEnd = nptr;
193
194 if ((base < 0) || (base == 1) || (base > 36)) {
195 if (endptr != NULL) {
196 *endptr = NULL;
197 }
198
199 return 0;
200 }
201
202 // Skip leading spaces.
203 while (isspace (*nptr)) {
204 ++nptr;
205 }
206
207 // Process Subject sequence: optional sign followed by digits.
208 if (*nptr == '+') {
209 Negative = FALSE;
210 ++nptr;
211 } else if (*nptr == '-') {
212 Negative = TRUE;
213 ++nptr;
214 }
215
216 if (*nptr == '0') {
217 /* Might be Octal or Hex */
218 if (toupper (nptr[1]) == 'X') {
219 /* Looks like Hex */
220 if ((base == 0) || (base == 16)) {
221 nptr += 2; /* Skip the "0X" */
222 base = 16; /* In case base was 0 */
223 }
224 } else {
225 /* Looks like Octal */
226 if ((base == 0) || (base == 8)) {
227 ++nptr; /* Skip the leading "0" */
228 base = 8; /* In case base was 0 */
229 }
230 }
231 }
232
233 if (base == 0) {
234 /* If still zero then must be decimal */
235 base = 10;
236 }
237
238 if (*nptr == '0') {
239 for ( ; *nptr == '0'; ++nptr) {
240 /* Skip any remaining leading zeros */
241 }
242
243 pEnd = nptr;
244 }
245
246 while ( isalnum (*nptr) && ((temp = Digit2Val (*nptr)) < base)) {
247 Previous = Result;
248 Result = MultS64x64 (Result, base) + (long long int)temp;
249 if ( Result <= Previous) {
250 // Detect Overflow
251 if (Negative) {
252 Result = LLONG_MIN;
253 } else {
254 Result = LLONG_MAX;
255 }
256
257 Negative = FALSE;
258 errno = ERANGE;
259 break;
260 }
261
262 pEnd = ++nptr;
263 }
264
265 if (Negative) {
266 Result = -Result;
267 }
268
269 // Save pointer to final sequence
270 if (endptr != NULL) {
271 *endptr = (char *)pEnd;
272 }
273
274 return Result;
275}
276
331long
333 const char *nptr,
334 char **endptr,
335 int base
336 )
337{
338 const char *pEnd;
339 long Result = 0;
340 long Previous;
341 int temp;
342 BOOLEAN Negative = FALSE;
343
344 pEnd = nptr;
345
346 if ((base < 0) || (base == 1) || (base > 36)) {
347 if (endptr != NULL) {
348 *endptr = NULL;
349 }
350
351 return 0;
352 }
353
354 // Skip leading spaces.
355 while (isspace (*nptr)) {
356 ++nptr;
357 }
358
359 // Process Subject sequence: optional sign followed by digits.
360 if (*nptr == '+') {
361 Negative = FALSE;
362 ++nptr;
363 } else if (*nptr == '-') {
364 Negative = TRUE;
365 ++nptr;
366 }
367
368 if (*nptr == '0') {
369 /* Might be Octal or Hex */
370 if (toupper (nptr[1]) == 'X') {
371 /* Looks like Hex */
372 if ((base == 0) || (base == 16)) {
373 nptr += 2; /* Skip the "0X" */
374 base = 16; /* In case base was 0 */
375 }
376 } else {
377 /* Looks like Octal */
378 if ((base == 0) || (base == 8)) {
379 ++nptr; /* Skip the leading "0" */
380 base = 8; /* In case base was 0 */
381 }
382 }
383 }
384
385 if (base == 0) {
386 /* If still zero then must be decimal */
387 base = 10;
388 }
389
390 if (*nptr == '0') {
391 for ( ; *nptr == '0'; ++nptr) {
392 /* Skip any remaining leading zeros */
393 }
394
395 pEnd = nptr;
396 }
397
398 while ( isalnum (*nptr) && ((temp = Digit2Val (*nptr)) < base)) {
399 Previous = Result;
400 Result = (Result * base) + (long int)temp;
401 if ( Result <= Previous) {
402 // Detect Overflow
403 if (Negative) {
404 Result = LONG_MIN;
405 } else {
406 Result = LONG_MAX;
407 }
408
409 Negative = FALSE;
410 errno = ERANGE;
411 break;
412 }
413
414 pEnd = ++nptr;
415 }
416
417 if (Negative) {
418 Result = -Result;
419 }
420
421 // Save pointer to final sequence
422 if (endptr != NULL) {
423 *endptr = (char *)pEnd;
424 }
425
426 return Result;
427}
428
439unsigned long long
441 const char *nptr,
442 char **endptr,
443 int base
444 )
445{
446 const char *pEnd;
447 unsigned long long Result = 0;
448 unsigned long long Previous;
449 int temp;
450
451 pEnd = nptr;
452
453 if ((base < 0) || (base == 1) || (base > 36)) {
454 if (endptr != NULL) {
455 *endptr = NULL;
456 }
457
458 return 0;
459 }
460
461 // Skip leading spaces.
462 while (isspace (*nptr)) {
463 ++nptr;
464 }
465
466 // Process Subject sequence: optional + sign followed by digits.
467 if (*nptr == '+') {
468 ++nptr;
469 }
470
471 if (*nptr == '0') {
472 /* Might be Octal or Hex */
473 if (toupper (nptr[1]) == 'X') {
474 /* Looks like Hex */
475 if ((base == 0) || (base == 16)) {
476 nptr += 2; /* Skip the "0X" */
477 base = 16; /* In case base was 0 */
478 }
479 } else {
480 /* Looks like Octal */
481 if ((base == 0) || (base == 8)) {
482 ++nptr; /* Skip the leading "0" */
483 base = 8; /* In case base was 0 */
484 }
485 }
486 }
487
488 if (base == 0) {
489 /* If still zero then must be decimal */
490 base = 10;
491 }
492
493 if (*nptr == '0') {
494 for ( ; *nptr == '0'; ++nptr) {
495 /* Skip any remaining leading zeros */
496 }
497
498 pEnd = nptr;
499 }
500
501 while ( isalnum (*nptr) && ((temp = Digit2Val (*nptr)) < base)) {
502 Previous = Result;
503 Result = DivU64x32 (Result, base) + (unsigned long long)temp;
504 if ( Result < Previous) {
505 // If we overflowed
506 Result = ULLONG_MAX;
507 errno = ERANGE;
508 break;
509 }
510
511 pEnd = ++nptr;
512 }
513
514 // Save pointer to final sequence
515 if (endptr != NULL) {
516 *endptr = (char *)pEnd;
517 }
518
519 return Result;
520}
521
546double
548 const char *__restrict nptr,
549 char **__restrict endptr
550 )
551{
552 UINTN Data;
554
555 Data = 0;
556 StrLen = 0;
557
558 if (nptr == NULL) {
559 return (double)0;
560 }
561
562 AsciiStrDecimalToUintnS (nptr, NULL, &Data);
563 DEBUG ((DEBUG_WARN, "%a: \"%a\" We don't support double type on edk2 yet. Only integer part is returned: %d\n", __func__, nptr, Data));
564
565 //
566 // Force endptr to the last position of nptr because caller may
567 // check endptr and raise assertion. We don't support floating
568 // number in edk2 so this prevents unecessary assertion from happening.
569 //
570 if (endptr != NULL) {
571 StrLen = AsciiStrLen (nptr);
572 *endptr = (char *__restrict)nptr + StrLen;
573 }
574
575 return (double)Data;
576}
577
578static UINT8 BitMask[] = {
579 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80
580};
581
582#define WHICH8(c) ((unsigned char)(c) >> 3)
583#define WHICH_BIT(c) (BitMask[((c) & 0x7)])
584#define BITMAP64 ((UINT64 *)bitmap)
585
586static
587void
588BuildBitmap (
589 unsigned char *bitmap,
590 const char *s2,
591 int n
592 )
593{
594 unsigned char bit;
595 int index;
596
597 // Initialize bitmap. Bit 0 is always 1 which corresponds to '\0'
598 for (BITMAP64[0] = index = 1; index < n; index++) {
599 BITMAP64[index] = 0;
600 }
601
602 // Set bits in bitmap corresponding to the characters in s2
603 for ( ; *s2 != '\0'; s2++) {
604 index = WHICH8 (*s2);
605 bit = WHICH_BIT (*s2);
606 bitmap[index] = bitmap[index] | bit;
607 }
608}
609
616char *
618 const char *s1,
619 const char *s2
620 )
621{
622 UINT8 bitmap[(((UCHAR_MAX + 1) / CHAR_BIT) + (CHAR_BIT - 1)) & ~7U];
623 UINT8 bit;
624 int index;
625
626 BuildBitmap (bitmap, s2, sizeof (bitmap) / sizeof (UINT64));
627
628 for ( ; *s1 != '\0'; ++s1) {
629 index = WHICH8 (*s1);
630 bit = WHICH_BIT (*s1);
631 if ((bitmap[index] & bit) != 0) {
632 return (char *)s1;
633 }
634 }
635
636 return NULL;
637}
638
651char *
653 int errnum
654 )
655{
656 return errnum_message;
657}
658
662void *
663calloc (
664 size_t Num,
665 size_t Size
666 )
667{
668 void *RetVal;
669 size_t NumSize;
670
671 NumSize = Num * Size;
672 RetVal = NULL;
673 if (NumSize != 0) {
674 RetVal = malloc (NumSize);
675 if ( RetVal != NULL) {
676 (VOID)ZeroMem (RetVal, NumSize);
677 }
678 }
679
680 DEBUG ((DEBUG_POOL, "0x%p = calloc(%d, %d)\n", RetVal, Num, Size));
681
682 return RetVal;
683}
684
685//
686// The arrays give the cumulative number of days up to the first of the
687// month number used as the index (1 -> 12) for regular and leap years.
688// The value at index 13 is for the whole year.
689//
690UINTN CumulativeDays[2][14] = {
691 {
692 0,
693 0,
694 31,
695 31 + 28,
696 31 + 28 + 31,
697 31 + 28 + 31 + 30,
698 31 + 28 + 31 + 30 + 31,
699 31 + 28 + 31 + 30 + 31 + 30,
700 31 + 28 + 31 + 30 + 31 + 30 + 31,
701 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31,
702 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30,
703 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31,
704 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30,
705 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31
706 },
707 {
708 0,
709 0,
710 31,
711 31 + 29,
712 31 + 29 + 31,
713 31 + 29 + 31 + 30,
714 31 + 29 + 31 + 30 + 31,
715 31 + 29 + 31 + 30 + 31 + 30,
716 31 + 29 + 31 + 30 + 31 + 30 + 31,
717 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31,
718 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30,
719 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31,
720 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30,
721 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31
722 }
723};
724
725#define IsLeap(y) (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0))
726#define SECSPERMIN (60)
727#define SECSPERHOUR (60 * 60)
728#define SECSPERDAY (24 * SECSPERHOUR)
729
733time_t
735 time_t *timer
736 )
737{
738 EFI_TIME Time;
739 time_t CalTime;
740 UINTN Year;
741
742 //
743 // Get the current time and date information
744 //
745 gRT->GetTime (&Time, NULL);
746
747 //
748 // Years Handling
749 // UTime should now be set to 00:00:00 on Jan 1 of the current year.
750 //
751 for (Year = 1970, CalTime = 0; Year != Time.Year; Year++) {
752 CalTime = CalTime + (time_t)(CumulativeDays[IsLeap (Year)][13] * SECSPERDAY);
753 }
754
755 //
756 // Add in number of seconds for current Month, Day, Hour, Minute, Seconds, and TimeZone adjustment
757 //
758 CalTime = CalTime +
759 (time_t)((Time.TimeZone != EFI_UNSPECIFIED_TIMEZONE) ? (Time.TimeZone * 60) : 0) +
760 (time_t)(CumulativeDays[IsLeap (Time.Year)][Time.Month] * SECSPERDAY) +
761 (time_t)(((Time.Day > 0) ? Time.Day - 1 : 0) * SECSPERDAY) +
762 (time_t)(Time.Hour * SECSPERHOUR) +
763 (time_t)(Time.Minute * 60) +
764 (time_t)Time.Second;
765
766 if (timer != NULL) {
767 *timer = CalTime;
768 }
769
770 return CalTime;
771}
772
776void
778 void *base,
779 size_t num,
780 size_t width,
781 int ( *compare )(const void *, const void *)
782 )
783{
784 ASSERT (base != NULL);
785 ASSERT (compare != NULL);
786
787 PerformQuickSort (base, (UINTN)num, (UINTN)width, (SORT_COMPARE)compare);
788 return;
789}
790
797int
799 FILE *_File
800 )
801{
802 return EOF;
803}
804
811FILE *
813 const char *filename,
814 const char *mode
815 )
816{
817 return NULL;
818}
819
826size_t
828 void *ptr,
829 size_t size,
830 size_t count,
831 FILE *stream
832 )
833{
834 return 0;
835}
836
843size_t
845 const void *ptr,
846 size_t size,
847 size_t count,
848 FILE *stream
849 )
850{
851 return 0;
852}
853
860int
862 FILE *stream
863 )
864{
865 return EOF;
866}
867
874int
875fprintf (
876 FILE *stream,
877 const char *format,
878 ...
879 )
880{
881 return -1;
882}
883
898BOOLEAN
900 IN CONST CHAR8 *FormatString,
901 IN OUT UINTN *CurrentPosition,
902 IN UINTN StrLength
903 )
904{
905 CHAR8 FormatStringParamater;
906
907 while (*(FormatString + *CurrentPosition) != 's') {
908 //
909 // Loop until reach character 's' if the formating string is
910 // compliant with "[flags][width][.precision][length]" format for
911 // the string specifier.
912 //
913 FormatStringParamater = *(FormatString + *CurrentPosition);
914 if ((FormatStringParamater != '-') &&
915 (FormatStringParamater != '+') &&
916 (FormatStringParamater != '*') &&
917 (FormatStringParamater != '.') &&
918 !(((UINTN)FormatStringParamater >= (UINTN)'0') && ((UINTN)FormatStringParamater <= (UINTN)'9'))
919 )
920 {
921 return FALSE;
922 }
923
924 (*CurrentPosition)++;
925 if (*CurrentPosition >= StrLength) {
926 return FALSE;
927 }
928 }
929
930 return TRUE;
931}
932
943CHAR8 *
945 IN CONST CHAR8 *FormatString
946 )
947{
948 UINTN FormatStrSize;
949 UINTN FormatStrIndex;
950 UINTN FormatStrSpecifier;
951 BOOLEAN PercentageMark;
952 CHAR8 *TempFormatBuffer;
953 BOOLEAN IsFormatString;
954
955 //
956 // Error checking.
957 //
958 if (FormatString == NULL) {
959 return NULL;
960 }
961
962 FormatStrSize = AsciiStrSize (FormatString);
963 if (FormatStrSize == 0) {
964 return NULL;
965 }
966
967 TempFormatBuffer = AllocatePool (FormatStrSize); // Allocate memory for the
968 // new string.
969 if (TempFormatBuffer == NULL) {
970 return NULL;
971 }
972
973 //
974 // Clone *FormatString but replace "%s" wih "%a".
975 // "%%" is not considered as the format tag.
976 //
977 PercentageMark = FALSE;
978 FormatStrIndex = 0;
979 while (FormatStrIndex < FormatStrSize) {
980 if (PercentageMark == TRUE) {
981 //
982 // Previous character is "%".
983 //
984 PercentageMark = FALSE;
985 if (*(FormatString + FormatStrIndex) != '%') {
986 // Check if this is double "%".
987 FormatStrSpecifier = FormatStrIndex;
988 //
989 // Check if this is the formating string specifier.
990 //
991 IsFormatString = CheckFormatingString (FormatString, &FormatStrSpecifier, FormatStrSize);
992 if ((FormatStrSpecifier - FormatStrIndex) != 0) {
993 CopyMem (
994 (VOID *)(TempFormatBuffer + FormatStrIndex),
995 (VOID *)(FormatString + FormatStrIndex),
996 FormatStrSpecifier - FormatStrIndex
997 );
998 }
999
1000 FormatStrIndex = FormatStrSpecifier;
1001 if (IsFormatString == TRUE) {
1002 //
1003 // Replace 's' with 'a' which is printed in ASCII
1004 // format on edk2 environment.
1005 //
1006 *(TempFormatBuffer + FormatStrSpecifier) = 'a';
1007 FormatStrIndex++;
1008 }
1009
1010 continue;
1011 }
1012
1013 goto ContinueCheck;
1014 }
1015
1016 if (*(FormatString + FormatStrIndex) == '%') {
1017 //
1018 // This character is "%", set the flag.
1019 //
1020 PercentageMark = TRUE;
1021 }
1022
1023ContinueCheck:
1024 //
1025 // Clone character to the new string and advance FormatStrIndex
1026 // to process next character.
1027 //
1028 *(TempFormatBuffer + FormatStrIndex) = *(FormatString + FormatStrIndex);
1029 FormatStrIndex++;
1030 }
1031
1032 return TempFormatBuffer;
1033}
1034
1051UINTN
1052EFIAPI
1054 OUT CHAR8 *StartOfBuffer,
1055 IN UINTN BufferSize,
1056 IN CONST CHAR8 *FormatString,
1057 IN VA_LIST Marker
1058 )
1059{
1060 CHAR8 *TempFormatBuffer;
1061 UINTN LenStrProduced;
1062
1063 //
1064 // Looking for "%s" in the format string and replace it
1065 // with "%a" for printing ASCII code characters on edk2
1066 // environment.
1067 //
1068 TempFormatBuffer = ReplaceUnicodeToAsciiStrFormat (FormatString);
1069 if (TempFormatBuffer == NULL) {
1070 return 0;
1071 }
1072
1073 LenStrProduced = AsciiVSPrint (StartOfBuffer, BufferSize, (CONST CHAR8 *)TempFormatBuffer, Marker);
1074 FreePool (TempFormatBuffer);
1075 return LenStrProduced;
1076}
1077
1095UINTN
1096EFIAPI
1098 OUT CHAR8 *StartOfBuffer,
1099 IN UINTN BufferSize,
1100 IN CONST CHAR8 *FormatString,
1101 ...
1102 )
1103{
1104 VA_LIST Marker;
1105 UINTN LenStrProduced;
1106
1107 VA_START (Marker, FormatString);
1108 LenStrProduced = RedfishAsciiVSPrint (StartOfBuffer, BufferSize, FormatString, Marker);
1109 return LenStrProduced;
1110}
UINT64 UINTN
UINT64 EFIAPI DivU64x32(IN UINT64 Dividend, IN UINT32 Divisor)
Definition: DivU64x32.c:29
UINTN EFIAPI AsciiStrLen(IN CONST CHAR8 *String)
Definition: String.c:641
RETURN_STATUS EFIAPI AsciiStrDecimalToUintnS(IN CONST CHAR8 *String, OUT CHAR8 **EndPointer OPTIONAL, OUT UINTN *Data)
Definition: SafeString.c:2179
INT64 EFIAPI MultS64x64(IN INT64 Multiplicand, IN INT64 Multiplier)
Definition: MultS64x64.c:27
UINTN EFIAPI AsciiStrSize(IN CONST CHAR8 *String)
Definition: String.c:681
UINTN EFIAPI StrLen(IN CONST CHAR16 *String)
Definition: String.c:30
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
VOID EFIAPI FreePool(IN VOID *Buffer)
UINTN EFIAPI AsciiVSPrint(OUT CHAR8 *StartOfBuffer, IN UINTN BufferSize, IN CONST CHAR8 *FormatString, IN VA_LIST Marker)
Definition: PrintLib.c:702
EFI_RUNTIME_SERVICES * gRT
#define NULL
Definition: Base.h:319
#define CONST
Definition: Base.h:259
#define VA_START(Marker, Parameter)
Definition: Base.h:661
#define TRUE
Definition: Base.h:301
#define FALSE
Definition: Base.h:307
CHAR8 * VA_LIST
Definition: Base.h:643
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
#define DEBUG(Expression)
Definition: DebugLib.h:434
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)
CHAR8 * ReplaceUnicodeToAsciiStrFormat(IN CONST CHAR8 *FormatString)
time_t time(time_t *timer)
int isdchar(int c)
Definition: RedfishCrtLib.c:47
long strtol(const char *nptr, char **endptr, int base)
char * strerror(int errnum)
double strtod(const char *__restrict nptr, char **__restrict endptr)
int isspace(int c)
Definition: RedfishCrtLib.c:66
char * strpbrk(const char *s1, const char *s2)
int fclose(FILE *stream)
FILE * fopen(const char *filename, const char *mode)
size_t fwrite(const void *ptr, size_t size, size_t count, FILE *stream)
void qsort(void *base, size_t num, size_t width, int(*compare)(const void *, const void *))
int toupper(IN int c)
UINTN EFIAPI RedfishAsciiVSPrint(OUT CHAR8 *StartOfBuffer, IN UINTN BufferSize, IN CONST CHAR8 *FormatString, IN VA_LIST Marker)
BOOLEAN CheckFormatingString(IN CONST CHAR8 *FormatString, IN OUT UINTN *CurrentPosition, IN UINTN StrLength)
int fgetc(FILE *_File)
char * strdup(const char *str)
int errno
Definition: RedfishCrtLib.c:18
UINTN EFIAPI RedfishAsciiSPrint(OUT CHAR8 *StartOfBuffer, IN UINTN BufferSize, IN CONST CHAR8 *FormatString,...)
int isalnum(int c)
Definition: RedfishCrtLib.c:29
unsigned long long strtoull(const char *nptr, char **endptr, int base)
size_t fread(void *ptr, size_t size, size_t count, FILE *stream)
long long strtoll(const char *nptr, char **endptr, int base)
int Digit2Val(int c)
VOID EFIAPI PerformQuickSort(IN OUT VOID *BufferToSort, IN CONST UINTN Count, IN CONST UINTN ElementSize, IN SORT_COMPARE CompareFunction)
Definition: BaseSortLib.c:36
#define EFI_UNSPECIFIED_TIMEZONE
Definition: UefiSpec.h:58