| 364 | } |
| 365 | |
| 366 | int |
| 367 | title_to_mon( |
| 368 | const char *str, |
| 369 | int *rank_indx, |
| 370 | int *title_length) |
| 371 | { |
| 372 | int i, j; |
| 373 | |
| 374 | /* Loop through each of the roles */ |
| 375 | for (i = 0; roles[i].name.m; i++) { |
| 376 | /* loop through each of the rank titles for role #i */ |
| 377 | for (j = 0; j < 9; j++) { |
| 378 | if (roles[i].rank[j].m |
| 379 | && str_start_is(str, roles[i].rank[j].m, TRUE)) { |
| 380 | if (rank_indx) |
| 381 | *rank_indx = j; |
| 382 | if (title_length) |
| 383 | *title_length = Strlen(roles[i].rank[j].m); |
| 384 | return roles[i].mnum; |
| 385 | } |
| 386 | if (roles[i].rank[j].f |
| 387 | && str_start_is(str, roles[i].rank[j].f, TRUE)) { |
| 388 | if (rank_indx) |
| 389 | *rank_indx = j; |
| 390 | if (title_length) |
| 391 | *title_length = Strlen(roles[i].rank[j].f); |
| 392 | return roles[i].mnum; |
| 393 | } |
| 394 | } |
| 395 | } |
| 396 | if (title_length) |
| 397 | *title_length = 0; |
| 398 | return NON_PM; |
| 399 | } |
| 400 | |
| 401 | void |
| 402 | max_rank_sz(void) |
no test coverage detected