TianoCore EDK2
master
Loading...
Searching...
No Matches
UnitTestHostCrtWrapper.c
Go to the documentation of this file.
1
11
#include <stdio.h>
12
13
#include <Base.h>
14
#include <
Library/DebugLib.h
>
15
16
/* Convert character to lowercase */
17
int
18
tolower (
19
int
c
20
)
21
{
22
if
((
'A'
<= (c)) && ((c) <=
'Z'
)) {
23
return
(c - (
'A'
-
'a'
));
24
}
25
26
return
(c);
27
}
28
29
/* Compare first n bytes of string s1 with string s2, ignoring case */
30
int
31
strncasecmp (
32
const
char
*s1,
33
const
char
*s2,
34
size_t
n
35
)
36
{
37
int
Val;
38
39
ASSERT (s1 !=
NULL
);
40
ASSERT (s2 !=
NULL
);
41
42
if
(n != 0) {
43
do
{
44
Val = tolower (*s1) - tolower (*s2);
45
if
(Val != 0) {
46
return
Val;
47
}
48
49
++s1;
50
++s2;
51
if
(*s1 ==
'\0'
) {
52
break
;
53
}
54
}
while
(--n != 0);
55
}
56
57
return
0;
58
}
59
60
/* Read formatted data from a string */
61
int
62
sscanf (
63
const
char
*buffer,
64
const
char
*format,
65
...
66
)
67
{
68
//
69
// Null sscanf() function implementation to satisfy the linker, since
70
// no direct functionality logic dependency in present UEFI cases.
71
//
72
return
0;
73
}
74
75
uid_t
76
getuid (
77
void
78
)
79
{
80
return
0;
81
}
82
83
uid_t
84
geteuid (
85
void
86
)
87
{
88
return
0;
89
}
90
91
gid_t
92
getgid (
93
void
94
)
95
{
96
return
0;
97
}
98
99
gid_t
100
getegid (
101
void
102
)
103
{
104
return
0;
105
}
106
107
unsigned
int
108
sleep (
109
unsigned
int
seconds
110
)
111
{
112
return
0;
113
}
114
115
int
116
gettimeofday (
117
struct
timeval
*tv,
118
struct
timezone *tz
119
)
120
{
121
tv->tv_sec = 0;
122
tv->tv_usec = 0;
123
return
0;
124
}
125
126
int
errno = 0;
127
long
timezone;
NULL
#define NULL
Definition:
Base.h:319
DebugLib.h
timeval
Definition:
CrtLibSupport.h:146
CryptoPkg
Library
BaseCryptLib
SysCall
UnitTestHostCrtWrapper.c
Generated on Fri Nov 15 2024 18:01:05 for TianoCore EDK2 by
1.9.6