| 877 | } |
| 878 | |
| 879 | int |
| 880 | str2gend(const char *str) |
| 881 | { |
| 882 | int i, len; |
| 883 | |
| 884 | /* Is str valid? */ |
| 885 | if (!str || !str[0]) |
| 886 | return ROLE_NONE; |
| 887 | |
| 888 | /* Match as much of str as is provided */ |
| 889 | len = Strlen(str); |
| 890 | for (i = 0; i < ROLE_GENDERS; i++) { |
| 891 | /* Does it match the adjective? */ |
| 892 | if (!strncmpi(str, genders[i].adj, len)) |
| 893 | return i; |
| 894 | /* Or the filecode? */ |
| 895 | if (!strcmpi(str, genders[i].filecode)) |
| 896 | return i; |
| 897 | } |
| 898 | if ((len == 1 && (*str == '*' || *str == '@')) |
| 899 | || !strncmpi(str, randomstr, len)) |
| 900 | return ROLE_RANDOM; |
| 901 | |
| 902 | /* Couldn't find anything appropriate */ |
| 903 | return ROLE_NONE; |
| 904 | } |
| 905 | |
| 906 | boolean |
| 907 | validalign(int rolenum, int racenum, int alignnum) |
no test coverage detected