Go to the source code of this file.
|
static BOOL | seta_eval (LPCTSTR expr) |
|
static LPCTSTR | skip_ws (LPCTSTR p) |
|
static LPTSTR | GetQuotedString (TCHAR *p) |
|
INT | cmd_set (LPTSTR param) |
|
static INT | ident_len (LPCTSTR p) |
|
static INT | seta_identval (LPCTSTR ident) |
|
static BOOL | calc (INT *lval, TCHAR op, INT rval) |
|
static BOOL | seta_stmt (LPCTSTR *p_, INT *result) |
|
static BOOL | seta_unaryTerm (LPCTSTR *p_, INT *result) |
|
static BOOL | seta_mulTerm (LPCTSTR *p_, INT *result) |
|
static BOOL | seta_ltorTerm (LPCTSTR *p_, INT *result, LPCTSTR ops, BOOL(*subTerm)(LPCTSTR *, INT *)) |
|
static BOOL | seta_addTerm (LPCTSTR *p_, INT *result) |
|
static BOOL | seta_logShiftTerm (LPCTSTR *p_, INT *result) |
|
static BOOL | seta_bitAndTerm (LPCTSTR *p_, INT *result) |
|
static BOOL | seta_bitExclOrTerm (LPCTSTR *p_, INT *result) |
|
static BOOL | seta_bitOrTerm (LPCTSTR *p_, INT *result) |
|
static BOOL | seta_expr (LPCTSTR *p_, INT *result) |
|
static BOOL | seta_assignment (LPCTSTR *p_, INT *result) |
|
◆ ENV_BUFFER_SIZE
Definition at line 42 of file set.c.
◆ PARSE_IDENT
Value:do { \
} while (0)
static INT ident_len(LPCTSTR p)
_In_ ULONG _In_ ULONG_PTR ident
Definition at line 271 of file set.c.
◆ calc()
Definition at line 291 of file set.c.
292{
294 {
295 case '*':
297 break;
298
299 case '/':
300 {
302 {
303
307 }
309 break;
310 }
311
312 case '%':
313 {
315 {
316
320 }
322 break;
323 }
324
325 case '+':
327 break;
328 case '-':
330 break;
331 case '&':
333 break;
334 case '^':
336 break;
337 case '|':
339 break;
340
341 default:
345 }
347}
#define ConErrResPuts(uID)
#define ConErrPuts(szStr)
#define STRING_INVALID_OPERAND
◆ cmd_set()
Definition at line 72 of file set.c.
73{
78
80 {
82 return 0;
83 }
84
86
87
89 {
91 if (lpEnv)
92 {
93 lpOutput = lpEnv;
94 while (*lpOutput)
95 {
96
97 if (*lpOutput !=
_T(
'='))
98 {
101 }
102 lpOutput +=
_tcslen(lpOutput) + 1;
103 }
105 }
106
107 retval = 0;
108 goto Quit;
109 }
110
111
113 {
115
116
117
119
123 {
124#if 0
125
126 retval = 9165;
127#endif
130 }
131 else
132 {
133 retval = 0;
134 }
135 goto Quit;
136 }
137
139 {
144 {
146 retval = 1;
147 goto Quit;
148 }
149
153
155 {
156 retval = 1;
157 goto Quit;
158 }
159 retval = 0;
160 goto Quit;
161 }
162
164
167 {
168
170 {
171
173 retval = 1;
174 goto Quit;
175 }
176
179 {
180 retval = 1;
181 goto Quit;
182 }
183 }
184 else
185 {
186
190
191
192
193
194
195
196
197
198
199
200
201
204
205
207 bRestoreSpace = (
p !=
NULL);
211
213 if (lpEnv)
214 {
215 lpOutput = lpEnv;
216 while (*lpOutput)
217 {
218
219 if (!
_tcsnicmp(lpOutput, pOrgParam,
p - pOrgParam) ||
221 {
225 }
226 lpOutput +=
_tcslen(lpOutput) + 1;
227 }
229 }
230
231
232
233 if (bRestoreSpace)
235
236 if (!bFound)
237 {
239 retval = 1;
240 goto Quit;
241 }
242 }
243
244Quit:
246 {
247 if (retval != 0)
249 }
250 else
251 {
253 }
254
255 return retval;
256}
VOID ConOutResPaging(BOOL StartPaging, UINT resID)
#define ConOutPrintf(szStr,...)
#define ConErrResPrintf(uID,...)
#define ConOutPuts(szStr)
#define STRING_SYNTAX_COMMAND_INCORRECT
#define STRING_SET_ENV_ERROR
static VOID StripQuotes(LPSTR in)
static VOID ConInString(LPWSTR lpInput, DWORD dwLength)
static BOOL seta_eval(LPCTSTR expr)
static LPTSTR GetQuotedString(TCHAR *p)
static LPCTSTR skip_ws(LPCTSTR p)
#define FreeEnvironmentStrings
LPSTR WINAPI GetEnvironmentStrings(void)
#define SetEnvironmentVariable
◆ GetQuotedString()
◆ ident_len()
◆ seta_addTerm()
Definition at line 491 of file set.c.
492{
494}
static BOOL seta_mulTerm(LPCTSTR *p_, INT *result)
static BOOL seta_ltorTerm(LPCTSTR *p_, INT *result, LPCTSTR ops, BOOL(*subTerm)(LPCTSTR *, INT *))
Referenced by seta_logShiftTerm().
◆ seta_assignment()
Definition at line 579 of file set.c.
580{
584 INT identlen, exprval;
585
587 if (identlen)
588 {
590
591
593 {
596 }
597
599 {
601
602
605 {
607 goto evaluate;
608 }
609
610
612 }
613
615 {
617
618
621 {
623 goto evaluate;
624 }
625
626
629 {
631 goto evaluate;
632 }
633
634
636 }
637 }
638
639evaluate:
640
642 {
645
648
650
652 {
653
654 case '=':
655 identval = exprval;
656 break;
657
658
659 case '<':
660 {
661
662
663 if (exprval < 0 || exprval >= (8 * sizeof(identval)))
664 identval = 0;
665 else
666 identval <<= exprval;
667 break;
668 }
669
670
671 case '>':
672 identval >>= exprval;
673 break;
674
675
676 default:
677 if (!
calc(&identval,
op, exprval))
679 }
680
684 exprval = identval;
685 }
686 else
687 {
688
692 }
693
697}
GLenum GLuint GLenum GLsizei const GLchar * buf
static INT seta_identval(LPCTSTR ident)
static BOOL seta_assignment(LPCTSTR *p_, INT *result)
static BOOL seta_expr(LPCTSTR *p_, INT *result)
#define PARSE_IDENT(ident, identlen, p)
Referenced by seta_assignment(), and seta_stmt().
◆ seta_bitAndTerm()
Definition at line 503 of file set.c.
504{
507
508
511
512
514 {
517
518
521 break;
522
523
525
526
529
530
532 {
533 case '<':
534 {
535
536
537 if (rval < 0 || rval >= (8 * sizeof(lval)))
538 lval = 0;
539 else
541 break;
542 }
543
544 case '>':
546 break;
547
548 default:
552 }
553 }
554
558}
static BOOL seta_logShiftTerm(LPCTSTR *p_, INT *result)
Referenced by seta_bitExclOrTerm().
◆ seta_bitExclOrTerm()
Definition at line 561 of file set.c.
562{
564}
static BOOL seta_bitAndTerm(LPCTSTR *p_, INT *result)
Referenced by seta_bitOrTerm().
◆ seta_bitOrTerm()
Definition at line 567 of file set.c.
568{
570}
static BOOL seta_bitExclOrTerm(LPCTSTR *p_, INT *result)
Referenced by seta_expr().
◆ seta_eval()
Definition at line 723 of file set.c.
724{
726
728 {
732 }
735
736
738 {
742 }
743
744
747
749}
static BOOL seta_stmt(LPCTSTR *p_, INT *result)
Referenced by cmd_set().
◆ seta_expr()
Definition at line 573 of file set.c.
574{
576}
static BOOL seta_bitOrTerm(LPCTSTR *p_, INT *result)
Referenced by seta_assignment().
◆ seta_identval()
◆ seta_logShiftTerm()
Definition at line 497 of file set.c.
498{
500}
static BOOL seta_addTerm(LPCTSTR *p_, INT *result)
Referenced by seta_bitAndTerm().
◆ seta_ltorTerm()
◆ seta_mulTerm()
Definition at line 416 of file set.c.
417{
421
423 {
426
429
431 {
432 case '!':
434 break;
435 case '~':
437 break;
438 case '-':
440 break;
441#if 0
442 case '+':
444 break;
445#endif
446 }
447 }
448 else
449 {
452 }
453
457}
static BOOL seta_unaryTerm(LPCTSTR *p_, INT *result)
Referenced by seta_addTerm(), and seta_mulTerm().
◆ seta_stmt()
◆ seta_unaryTerm()
Definition at line 353 of file set.c.
354{
357
359 {
364 {
368 }
370 }
372 {
375
376
378 {
379
380 ConErrPuts(
_T(
"Invalid number. Numbers are limited to 32-bits of precision.\n"));
383 }
384
385
386
387
388
390 {
391
392 ConErrPuts(
_T(
"Invalid number. Numeric constants are either decimal (42), hexadecimal (0x2A), or octal (052).\n"));
395 }
397 }
399 {
404 }
405 else
406 {
410 }
413}
#define STRING_EXPECTED_CLOSE_PAREN
#define STRING_EXPECTED_NUMBER_OR_VARIABLE
Referenced by seta_mulTerm().
◆ skip_ws()
Definition at line 48 of file set.c.
49{
50 while (*
p && *
p <=
_T(
' '))
53}
Referenced by cmd_set(), findend(), GetQuotedString(), import_file(), process_preprocessor(), seta_assignment(), seta_bitAndTerm(), seta_ltorTerm(), seta_mulTerm(), seta_stmt(), seta_unaryTerm(), and tokenize().