TianoCore EDK2 master
|
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/PrintLib.h>
#include <Library/TimerLib.h>
Go to the source code of this file.
Data Structures | |
struct | tm |
struct | timeval |
struct | sockaddr |
Macros | |
#define | OPENSSLDIR "" |
#define | ENGINESDIR "" |
#define | MODULESDIR "" |
#define | MAX_STRING_SIZE 0x1000 |
#define | BUFSIZ 8192 |
#define | CONFIG_HEADER_BN_H |
#define | va_list VA_LIST |
#define | va_arg VA_ARG |
#define | va_start VA_START |
#define | va_end VA_END |
#define | EINVAL 22 /* Invalid argument */ |
#define | EAFNOSUPPORT 47 /* Address family not supported by protocol family */ |
#define | INT_MAX 0x7FFFFFFF /* Maximum (signed) int value */ |
#define | INT_MIN (-INT_MAX-1) /* Minimum (signed) int value */ |
#define | LONG_MAX 0X7FFFFFFFL /* max value for a long */ |
#define | LONG_MIN (-LONG_MAX-1) /* min value for a long */ |
#define | UINT_MAX 0xFFFFFFFF /* Maximum unsigned int value */ |
#define | ULONG_MAX 0xFFFFFFFF /* Maximum unsigned long value */ |
#define | CHAR_BIT 8 /* Number of bits in a char */ |
#define | SIZE_MAX 0xFFFFFFFF /* Maximum unsigned size_t */ |
#define | AF_INET 2 /* internetwork: UDP, TCP, etc. */ |
#define | AF_INET6 24 /* IP version 6 */ |
#define | NS_INT16SZ 2 /*%< #/bytes of data in a u_int16_t */ |
#define | NS_INADDRSZ 4 /*%< IPv4 T_A */ |
#define | NS_IN6ADDRSZ 16 /*%< IPv6 T_AAAA */ |
#define | memcpy(dest, source, count) CopyMem(dest,source,(UINTN)(count)) |
#define | memset(dest, ch, count) SetMem(dest,(UINTN)(count),(UINT8)(ch)) |
#define | memchr(buf, ch, count) ScanMem8(buf,(UINTN)(count),(UINT8)ch) |
#define | memcmp(buf1, buf2, count) (int)(CompareMem(buf1,buf2,(UINTN)(count))) |
#define | memmove(dest, source, count) CopyMem(dest,source,(UINTN)(count)) |
#define | strlen(str) (size_t)(AsciiStrnLenS(str,MAX_STRING_SIZE)) |
#define | strncmp(string1, string2, count) (int)(AsciiStrnCmp(string1,string2,(UINTN)(count))) |
#define | strcasecmp(str1, str2) (int)AsciiStriCmp(str1,str2) |
#define | strstr(s1, s2) AsciiStrStr(s1,s2) |
#define | sprintf(buf, ...) AsciiSPrint(buf,MAX_STRING_SIZE,__VA_ARGS__) |
#define | localtime(timer) NULL |
#define | assert(expression) |
#define | offsetof(type, member) OFFSET_OF(type,member) |
#define | atoi(nptr) AsciiStrDecimalToUintn(nptr) |
Typedefs | |
typedef UINTN | size_t |
typedef UINTN | off_t |
typedef UINTN | u_int |
typedef UINTN | intptr_t |
typedef INTN | ptrdiff_t |
typedef INTN | ssize_t |
typedef INT64 | time_t |
typedef UINT8 | __uint8_t |
typedef UINT8 | sa_family_t |
typedef UINT8 | u_char |
typedef UINT32 | uid_t |
typedef UINT32 | gid_t |
typedef CHAR16 | wchar_t |
typedef VOID * | FILE |
Functions | |
void * | malloc (size_t) |
void * | realloc (void *, size_t) |
void | free (void *) |
void * | memset (void *, int, size_t) |
int | memcmp (const void *, const void *, size_t) |
int | isdigit (int) |
int | isspace (int) |
int | isxdigit (int) |
int | isalnum (int) |
int | isupper (int) |
int | tolower (int) |
int | strcmp (const char *, const char *) |
int | strncasecmp (const char *, const char *, size_t) |
char * | strchr (const char *, int) |
char * | strrchr (const char *, int) |
unsigned long | strtoul (const char *, char **, int) |
long | strtol (const char *, char **, int) |
char * | strerror (int) |
size_t | strspn (const char *, const char *) |
size_t | strcspn (const char *, const char *) |
int | printf (const char *,...) |
int | sscanf (const char *, const char *,...) |
FILE * | fopen (const char *, const char *) |
size_t | fread (void *, size_t, size_t, FILE *) |
size_t | fwrite (const void *, size_t, size_t, FILE *) |
int | fclose (FILE *) |
int | fprintf (FILE *, const char *,...) |
time_t | time (time_t *) |
struct tm * | gmtime (const time_t *) |
unsigned int | sleep (unsigned int seconds) |
int | gettimeofday (struct timeval *tv, struct timezone *tz) |
time_t | mktime (struct tm *t) |
uid_t | getuid (void) |
uid_t | geteuid (void) |
gid_t | getgid (void) |
gid_t | getegid (void) |
int | issetugid (void) |
void | qsort (void *, size_t, size_t, int(*)(const void *, const void *)) |
char * | getenv (const char *) |
char * | secure_getenv (const char *) |
void | abort (void) |
int | inet_pton (int, const char *, void *) |
char * | strcpy (char *strDest, const char *strSource) |
char * | strncpy (char *strDest, const char *strSource, size_t count) |
char * | strcat (char *strDest, const char *strSource) |
Variables | |
int | errno |
FILE * | stderr |
long | timezone |
Root include file of C runtime library to support building the third-party cryptographic library.
Copyright (c) 2010 - 2022, Intel Corporation. All rights reserved.
Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.
Copyright (c) 2022, Loongson Technology Corporation Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file CrtLibSupport.h.
#define AF_INET 2 /* internetwork: UDP, TCP, etc. */ |
Definition at line 96 of file CrtLibSupport.h.
#define AF_INET6 24 /* IP version 6 */ |
Definition at line 97 of file CrtLibSupport.h.
#define assert | ( | expression | ) |
Definition at line 454 of file CrtLibSupport.h.
#define atoi | ( | nptr | ) | AsciiStrDecimalToUintn(nptr) |
Definition at line 456 of file CrtLibSupport.h.
#define BUFSIZ 8192 |
Definition at line 35 of file CrtLibSupport.h.
#define CHAR_BIT 8 /* Number of bits in a char */ |
Definition at line 90 of file CrtLibSupport.h.
#define CONFIG_HEADER_BN_H |
Definition at line 48 of file CrtLibSupport.h.
#define EAFNOSUPPORT 47 /* Address family not supported by protocol family */ |
Definition at line 83 of file CrtLibSupport.h.
#define EINVAL 22 /* Invalid argument */ |
Definition at line 82 of file CrtLibSupport.h.
#define ENGINESDIR "" |
Definition at line 22 of file CrtLibSupport.h.
#define INT_MAX 0x7FFFFFFF /* Maximum (signed) int value */ |
Definition at line 84 of file CrtLibSupport.h.
#define INT_MIN (-INT_MAX-1) /* Minimum (signed) int value */ |
Definition at line 85 of file CrtLibSupport.h.
#define localtime | ( | timer | ) | NULL |
Definition at line 453 of file CrtLibSupport.h.
#define LONG_MAX 0X7FFFFFFFL /* max value for a long */ |
Definition at line 86 of file CrtLibSupport.h.
#define LONG_MIN (-LONG_MAX-1) /* min value for a long */ |
Definition at line 87 of file CrtLibSupport.h.
#define MAX_STRING_SIZE 0x1000 |
Definition at line 25 of file CrtLibSupport.h.
Definition at line 445 of file CrtLibSupport.h.
#define memcmp | ( | buf1, | |
buf2, | |||
count | |||
) | (int)(CompareMem(buf1,buf2,(UINTN)(count))) |
Definition at line 446 of file CrtLibSupport.h.
Definition at line 443 of file CrtLibSupport.h.
Definition at line 447 of file CrtLibSupport.h.
Definition at line 444 of file CrtLibSupport.h.
#define MODULESDIR "" |
Definition at line 23 of file CrtLibSupport.h.
#define NS_IN6ADDRSZ 16 /*%< IPv6 T_AAAA */ |
Definition at line 104 of file CrtLibSupport.h.
#define NS_INADDRSZ 4 /*%< IPv4 T_A */ |
Definition at line 103 of file CrtLibSupport.h.
#define NS_INT16SZ 2 /*%< #/bytes of data in a u_int16_t */ |
Definition at line 102 of file CrtLibSupport.h.
#define offsetof | ( | type, | |
member | |||
) | OFFSET_OF(type,member) |
Definition at line 455 of file CrtLibSupport.h.
#define OPENSSLDIR "" |
Definition at line 21 of file CrtLibSupport.h.
#define SIZE_MAX 0xFFFFFFFF /* Maximum unsigned size_t */ |
Definition at line 91 of file CrtLibSupport.h.
#define sprintf | ( | buf, | |
... | |||
) | AsciiSPrint(buf,MAX_STRING_SIZE,__VA_ARGS__) |
Definition at line 452 of file CrtLibSupport.h.
#define strcasecmp | ( | str1, | |
str2 | |||
) | (int)AsciiStriCmp(str1,str2) |
Definition at line 450 of file CrtLibSupport.h.
#define strlen | ( | str | ) | (size_t)(AsciiStrnLenS(str,MAX_STRING_SIZE)) |
Definition at line 448 of file CrtLibSupport.h.
#define strncmp | ( | string1, | |
string2, | |||
count | |||
) | (int)(AsciiStrnCmp(string1,string2,(UINTN)(count))) |
Definition at line 449 of file CrtLibSupport.h.
#define strstr | ( | s1, | |
s2 | |||
) | AsciiStrStr(s1,s2) |
Definition at line 451 of file CrtLibSupport.h.
#define UINT_MAX 0xFFFFFFFF /* Maximum unsigned int value */ |
Definition at line 88 of file CrtLibSupport.h.
#define ULONG_MAX 0xFFFFFFFF /* Maximum unsigned long value */ |
Definition at line 89 of file CrtLibSupport.h.
#define va_arg VA_ARG |
Definition at line 70 of file CrtLibSupport.h.
#define va_end VA_END |
Definition at line 72 of file CrtLibSupport.h.
#define va_list VA_LIST |
Definition at line 69 of file CrtLibSupport.h.
#define va_start VA_START |
Definition at line 71 of file CrtLibSupport.h.
typedef UINT8 __uint8_t |
Definition at line 116 of file CrtLibSupport.h.
typedef VOID* FILE |
Definition at line 127 of file CrtLibSupport.h.
typedef UINT32 gid_t |
Definition at line 120 of file CrtLibSupport.h.
typedef UINTN intptr_t |
Definition at line 112 of file CrtLibSupport.h.
typedef UINTN off_t |
Definition at line 110 of file CrtLibSupport.h.
typedef INTN ptrdiff_t |
Definition at line 113 of file CrtLibSupport.h.
typedef UINT8 sa_family_t |
Definition at line 117 of file CrtLibSupport.h.
typedef UINTN size_t |
Definition at line 109 of file CrtLibSupport.h.
typedef INTN ssize_t |
Definition at line 114 of file CrtLibSupport.h.
typedef INT64 time_t |
Definition at line 115 of file CrtLibSupport.h.
typedef UINT8 u_char |
Definition at line 118 of file CrtLibSupport.h.
typedef UINTN u_int |
Definition at line 111 of file CrtLibSupport.h.
typedef UINT32 uid_t |
Definition at line 119 of file CrtLibSupport.h.
typedef CHAR16 wchar_t |
Definition at line 121 of file CrtLibSupport.h.
void abort | ( | void | ) |
Definition at line 555 of file CrtWrapper.c.
int fclose | ( | FILE * | stream | ) |
Close file, we don't support file operastion on edk2 JSON library.
Definition at line 565 of file CrtWrapper.c.
FILE * fopen | ( | const char * | filename, |
const char * | mode | ||
) |
Open stream file, we don't support file operastion on edk2 JSON library.
Definition at line 573 of file CrtWrapper.c.
int fprintf | ( | FILE * | stream, |
const char * | format, | ||
... | |||
) |
Write the formatted string to file, we don't support file operastion on edk2 JSON library.
Definition at line 875 of file RedfishCrtLib.c.
size_t fread | ( | void * | ptr, |
size_t | size, | ||
size_t | count, | ||
FILE * | stream | ||
) |
Read stream from file, we don't support file operastion on edk2 JSON library.
Definition at line 582 of file CrtWrapper.c.
void free | ( | void * | ptr | ) |
De-allocates or frees a memory block
Definition at line 107 of file BaseMemAllocation.c.
size_t fwrite | ( | const void * | ptr, |
size_t | size, | ||
size_t | count, | ||
FILE * | stream | ||
) |
Write stream from file, we don't support file operastion on edk2 JSON library.
Definition at line 513 of file CrtWrapper.c.
gid_t getegid | ( | void | ) |
Definition at line 617 of file CrtWrapper.c.
char * getenv | ( | const char * | varname | ) |
Definition at line 480 of file CrtWrapper.c.
uid_t geteuid | ( | void | ) |
Definition at line 601 of file CrtWrapper.c.
gid_t getgid | ( | void | ) |
Definition at line 609 of file CrtWrapper.c.
int gettimeofday | ( | struct timeval * | tv, |
struct timezone * | tz | ||
) |
Definition at line 63 of file ConstantTimeClock.c.
uid_t getuid | ( | void | ) |
Definition at line 593 of file CrtWrapper.c.
struct tm * gmtime | ( | const time_t * | timer | ) |
gmtime function.
Convert a time value from type time_t to struct tm.
Definition at line 39 of file ConstantTimeClock.c.
int inet_pton | ( | int | af, |
const char * | src, | ||
void * | dst | ||
) |
Definition at line 99 of file inet_pton.c.
int isalnum | ( | int | c | ) |
Determine if a particular character is an alphanumeric character
Definition at line 370 of file CrtWrapper.c.
int isdigit | ( | int | c | ) |
Definition at line 332 of file CrtWrapper.c.
int isspace | ( | int | c | ) |
Determine if a particular character is a space character
Definition at line 358 of file CrtWrapper.c.
int isupper | ( | int | c | ) |
Definition at line 384 of file CrtWrapper.c.
int isxdigit | ( | int | c | ) |
Definition at line 344 of file CrtWrapper.c.
void * malloc | ( | size_t | size | ) |
int memcmp | ( | const void * | buf1, |
const void * | buf2, | ||
size_t | count | ||
) |
Definition at line 58 of file MemoryIntrinsics.c.
void * memset | ( | void * | s, |
int | c, | ||
size_t | n | ||
) |
Definition at line 26 of file memset_ms.c.
time_t mktime | ( | struct tm * | t | ) |
Definition at line 47 of file ConstantTimeClock.c.
int printf | ( | const char * | fmt, |
... | |||
) |
Definition at line 625 of file CrtWrapper.c.
void qsort | ( | void * | base, |
size_t | num, | ||
size_t | width, | ||
int(*)(const void *, const void *) | compare | ||
) |
Performs a quick sort
Definition at line 447 of file CrtWrapper.c.
void * realloc | ( | void * | ptr, |
size_t | size | ||
) |
Definition at line 64 of file BaseMemAllocation.c.
char * secure_getenv | ( | const char * | varname | ) |
Definition at line 493 of file CrtWrapper.c.
unsigned int sleep | ( | unsigned int | seconds | ) |
Definition at line 55 of file ConstantTimeClock.c.
int sscanf | ( | const char * | buffer, |
const char * | format, | ||
... | |||
) |
Definition at line 180 of file CrtWrapper.c.
char * strcat | ( | char * | strDest, |
const char * | strSource | ||
) |
Definition at line 299 of file CrtWrapper.c.
char * strchr | ( | const char * | str, |
int | ch | ||
) |
strchr function.
Definition at line 119 of file CrtWrapper.c.
int strcmp | ( | const char * | s1, |
const char * | s2 | ||
) |
strcmp function.
Definition at line 318 of file CrtWrapper.c.
char * strcpy | ( | char * | strDest, |
const char * | strSource | ||
) |
Definition at line 269 of file CrtWrapper.c.
size_t strcspn | ( | const char * | s1, |
const char * | s2 | ||
) |
Definition at line 239 of file CrtWrapper.c.
char * strerror | ( | int | errnum | ) |
The strerror function maps the number in errnum to a message string. Typically, the values for errnum come from errno, but strerror shall map any value of type int to a message.
The implementation shall behave as if no library function calls the strerror function.
Definition at line 195 of file CrtWrapper.c.
int strncasecmp | ( | const char * | s1, |
const char * | s2, | ||
size_t | n | ||
) |
Definition at line 149 of file CrtWrapper.c.
char * strncpy | ( | char * | strDest, |
const char * | strSource, | ||
size_t | count | ||
) |
Definition at line 279 of file CrtWrapper.c.
char * strrchr | ( | const char * | str, |
int | c | ||
) |
Definition at line 129 of file CrtWrapper.c.
size_t strspn | ( | const char * | s1, |
const char * | s2 | ||
) |
Definition at line 205 of file CrtWrapper.c.
long strtol | ( | const char * | nptr, |
char ** | endptr, | ||
int | base | ||
) |
The strtol, strtoll, strtoul, and strtoull functions convert the initial portion of the string pointed to by nptr to long int, long long int, unsigned long int, and unsigned long long int representation, respectively. First, they decompose the input string into three parts: an initial, possibly empty, sequence of white-space characters (as specified by the isspace function), a subject sequence resembling an integer represented in some radix determined by the value of base, and a final string of one or more unrecognized characters, including the terminating null character of the input string. Then, they attempt to convert the subject sequence to an integer, and return the result.
If the value of base is zero, the expected form of the subject sequence is that of an integer constant, optionally preceded by a plus or minus sign, but not including an integer suffix. If the value of base is between 2 and 36 (inclusive), the expected form of the subject sequence is a sequence of letters and digits representing an integer with the radix specified by base, optionally preceded by a plus or minus sign, but not including an integer suffix. The letters from a (or A) through z (or Z) are ascribed the values 10 through 35; only letters and digits whose ascribed values are less than that of base are permitted. If the value of base is 16, the characters 0x or 0X may optionally precede the sequence of letters and digits, following the sign if present.
The subject sequence is defined as the longest initial subsequence of the input string, starting with the first non-white-space character, that is of the expected form. The subject sequence contains no characters if the input string is empty or consists entirely of white space, or if the first non-white-space character is other than a sign or a permissible letter or digit.
If the subject sequence has the expected form and the value of base is zero, the sequence of characters starting with the first digit is interpreted as an integer constant. If the subject sequence has the expected form and the value of base is between 2 and 36, it is used as the base for conversion, ascribing to each letter its value as given above. If the subject sequence begins with a minus sign, the value resulting from the conversion is negated (in the return type). A pointer to the final string is stored in the object pointed to by endptr, provided that endptr is not a null pointer.
In other than the "C" locale, additional locale-specific subject sequence forms may be accepted.
If the subject sequence is empty or does not have the expected form, no conversion is performed; the value of nptr is stored in the object pointed to by endptr, provided that endptr is not a null pointer.
Definition at line 400 of file CrtWrapper.c.
unsigned long strtoul | ( | const char * | nptr, |
char ** | endptr, | ||
int | base | ||
) |
Definition at line 415 of file CrtWrapper.c.
time_t time | ( | time_t * | timer | ) |
time function.
Get the system time as seconds elapsed since midnight, January 1, 1970.
Definition at line 27 of file ConstantTimeClock.c.
int tolower | ( | int | c | ) |
Definition at line 430 of file CrtWrapper.c.
|
extern |
Copyright (c) 2024, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition at line 12 of file CrtWrapper.c.
|
extern |
Definition at line 14 of file CrtWrapper.c.
|
extern |
Definition at line 73 of file ConstantTimeClock.c.