Matching with the module name or any symbol.
| 562 | |
| 563 | // Matching with the module name or any symbol. |
| 564 | BOOL cobf::csym::match_wildcard(PCCH wild_card, PCCH string) |
| 565 | { |
| 566 | // Init. |
| 567 | PCCH s_wild; |
| 568 | PCCH s_str; |
| 569 | BOOL wild = FALSE; |
| 570 | |
| 571 | loop_start: |
| 572 | for (s_wild = wild_card, s_str = string; *s_str; ++s_str, ++s_wild) { |
| 573 | if (*s_wild == '*') |
| 574 | { |
| 575 | // Found a wildcard. |
| 576 | wild = TRUE; |
| 577 | string = s_str, wild_card = s_wild; |
| 578 | |
| 579 | // Overlooking any consecutive wildcards. |
| 580 | do { ++wild_card; } while (*wild_card == '*'); |
| 581 | |
| 582 | // Reached the end of the wildcard string. |
| 583 | if (!*wild_card) return TRUE; |
| 584 | goto loop_start; |
| 585 | } |
| 586 | // Default match. |
| 587 | else if (*s_wild != *s_str) goto wild_check; |
| 588 | }; |
| 589 | while (*s_wild == '*') ++s_wild; |
| 590 | return (!*s_wild); |
| 591 | |
| 592 | wild_check: |
| 593 | // Move to next char. |
| 594 | if (!wild) return FALSE; |
| 595 | string++; |
| 596 | goto loop_start; |
| 597 | }; |
| 598 | |
| 599 | // Check the symbol name. |
| 600 | BOOL cobf::csym::check_sym(string n_sym) |
nothing calls this directly
no outgoing calls
no test coverage detected