| 829 | } |
| 830 | |
| 831 | static int |
| 832 | str2value(const char *str, int *value, struct dict *table) |
| 833 | { |
| 834 | int i; |
| 835 | |
| 836 | if (value == NULL) |
| 837 | return (EINVAL); |
| 838 | |
| 839 | for (i = 0; table[i].d_name != NULL; i++) { |
| 840 | if (strcasecmp(table[i].d_name, str) == 0) { |
| 841 | *value = table[i].d_value; |
| 842 | return (0); |
| 843 | } |
| 844 | } |
| 845 | |
| 846 | return (EINVAL); |
| 847 | } |
| 848 | |
| 849 | static int |
| 850 | str2id(const char *str, id_t *value) |
no test coverage detected