Go to the source code of this file.
◆ cmd_if()
Definition at line 52 of file if.c.
53{
55
57 {
59 return 0;
60 }
61
63 return 1;
64}
VOID ParseErrorEx(IN PCTSTR s)
VOID ConOutResPaging(BOOL StartPaging, UINT resID)
◆ ExecuteIf()
Definition at line 66 of file if.c.
67{
71
73 {
75 if (!Left)
76 return 1;
77 }
79 if (!Right)
80 {
82 return 1;
83 }
84
86 {
87
88
91 {
93 goto fail;
94 }
96 }
98 {
99
101 }
103 {
104
107 {
109 goto fail;
110 }
112 }
114 {
120
121
123
125 IsDir = (Right[
Size - 1] ==
'\\');
126 if (IsDir)
128
131 {
132 attrs =
f.dwFileAttributes;
134 }
135 else
136 {
137
139 }
140
143 else if (IsDir)
145 else
147
148 if (IsDir)
149 Right[
Size - 1] =
'\\';
150 }
151 else
152 {
153
154
155
156
157
158
159
162
164 {
165
166 result = (StringCmp(Left, Right) == 0);
167 }
169 {
171 switch (
Cmd->If.Operator)
172 {
179 default: goto unknownOp;
180 }
181 }
182 else
183 {
184unknownOp:
185 ERR(
"Unknown IF operator 0x%x\n",
Cmd->If.Operator);
187 goto fail;
188 }
189 }
190
193
195 {
196
198 }
199 else
200 {
201
203 }
204
205fail:
208 return 1;
209}
INT ExecuteCommand(IN PARSED_COMMAND *Cmd)
LPCTSTR GetEnvVarOrSpecial(LPCTSTR varName)
PTSTR DoDelayedExpansion(IN PCTSTR Line)
#define IFFLAG_IGNORECASE
VOID error_syntax(PCTSTR s)
static INT GenericCmp(INT(WINAPI *StringCmp)(LPCTSTR, LPCTSTR), LPCTSTR Left, LPCTSTR Right)
static VOID StripQuotes(LPSTR in)
#define INVALID_HANDLE_VALUE
BOOL WINAPI FindClose(HANDLE hFindFile)
#define FILE_ATTRIBUTE_DIRECTORY
#define INVALID_FILE_ATTRIBUTES
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
#define GetFileAttributes
Referenced by ExecuteCommand().
◆ GenericCmp()
Definition at line 35 of file if.c.
37{
41 {
44 {
45
46 return (nLeft < nRight) ? -1 : (nLeft > nRight);
47 }
48 }
49 return StringCmp(Left, Right);
50}
Referenced by ExecuteIf().