* These are internal controls to aid developers with * testing and debugging particular aspects of the code. * They are not player options and the only place they * are documented is right here. No gameplay is altered. * * test - test whether this parser is working * ttystatus - TTY: * immediateflips - WIN32: turn off display performance * optimizati
| 573 | * fuzzer - enable fuzzer without debugger intervention. |
| 574 | */ |
| 575 | staticfn void |
| 576 | debug_fields(char *opts) |
| 577 | { |
| 578 | char *op; |
| 579 | boolean negated = FALSE; |
| 580 | |
| 581 | while ((op = strchr(opts, ',')) != 0) { |
| 582 | *op++ = 0; |
| 583 | /* recurse */ |
| 584 | debug_fields(op); |
| 585 | } |
| 586 | if (strlen(opts) > BUFSZ / 2) |
| 587 | return; |
| 588 | |
| 589 | |
| 590 | /* strip leading and trailing white space */ |
| 591 | while (isspace((uchar) *opts)) |
| 592 | opts++; |
| 593 | op = eos((char *) opts); |
| 594 | while (--op >= opts && isspace((uchar) *op)) |
| 595 | *op = '\0'; |
| 596 | |
| 597 | if (!*opts) { |
| 598 | /* empty */ |
| 599 | return; |
| 600 | } |
| 601 | while ((*opts == '!') || !strncmpi(opts, "no", 2)) { |
| 602 | if (*opts == '!') |
| 603 | opts++; |
| 604 | else |
| 605 | opts += 2; |
| 606 | negated = !negated; |
| 607 | } |
| 608 | if (match_optname(opts, "test", 4, FALSE)) |
| 609 | iflags.debug.test = negated ? FALSE : TRUE; |
| 610 | #ifdef TTY_GRAPHICS |
| 611 | if (match_optname(opts, "ttystatus", 9, FALSE)) |
| 612 | iflags.debug.ttystatus = negated ? FALSE : TRUE; |
| 613 | #endif |
| 614 | #ifdef WIN32 |
| 615 | if (match_optname(opts, "immediateflips", 14, FALSE)) |
| 616 | iflags.debug.immediateflips = negated ? FALSE : TRUE; |
| 617 | #endif |
| 618 | if (match_optname(opts, "fuzzer", 4, FALSE)) |
| 619 | iflags.fuzzerpending = TRUE; |
| 620 | return; |
| 621 | } |
| 622 | |
| 623 | #if !defined(NODUMPENUMS) |
| 624 | /* monsdump[] and objdump[] are also used in utf8map.c */ |
no test coverage detected