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 */
17int
18tolower (
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 */
30int
31strncasecmp (
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 */
61int
62sscanf (
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
75uid_t
76getuid (
77 void
78 )
79{
80 return 0;
81}
82
83uid_t
84geteuid (
85 void
86 )
87{
88 return 0;
89}
90
91gid_t
92getgid (
93 void
94 )
95{
96 return 0;
97}
98
99gid_t
100getegid (
101 void
102 )
103{
104 return 0;
105}
106
107unsigned int
108sleep (
109 unsigned int seconds
110 )
111{
112 return 0;
113}
114
115int
116gettimeofday (
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
126int errno = 0;
127long timezone;
#define NULL
Definition: Base.h:319