| 823 | } |
| 824 | |
| 825 | struct symbol *sym_find(const char *name) |
| 826 | { |
| 827 | struct symbol *symbol = NULL; |
| 828 | int hash = 0; |
| 829 | |
| 830 | if (!name) |
| 831 | return NULL; |
| 832 | |
| 833 | if (name[0] && !name[1]) { |
| 834 | switch (name[0]) { |
| 835 | case 'y': return &symbol_yes; |
| 836 | case 'm': return &symbol_mod; |
| 837 | case 'n': return &symbol_no; |
| 838 | } |
| 839 | } |
| 840 | hash = strhash(name) % SYMBOL_HASHSIZE; |
| 841 | |
| 842 | for (symbol = symbol_hash[hash]; symbol; symbol = symbol->next) { |
| 843 | if (symbol->name && |
| 844 | !strcmp(symbol->name, name) && |
| 845 | !(symbol->flags & SYMBOL_CONST)) |
| 846 | break; |
| 847 | } |
| 848 | |
| 849 | return symbol; |
| 850 | } |
| 851 | |
| 852 | struct sym_match { |
| 853 | struct symbol *sym; |
no test coverage detected