| 522 | } |
| 523 | |
| 524 | int gmode_parse(const char *list) // convert a list of mode acronyms to a bitmask |
| 525 | { |
| 526 | char *buf = newstring(list), *b; |
| 527 | int res = 0; |
| 528 | for(char *p = strtok_r(buf, "|", &b); p; p = strtok_r(NULL, "|", &b)) |
| 529 | { |
| 530 | loopi(GMODE_NUM) if(!strcasecmp(p, modeacronymnames[i + 1])) res |= 1 << i; |
| 531 | } |
| 532 | delete buf; |
| 533 | return res; |
| 534 | } |
| 535 | |
| 536 | char *gmode_enum(int gm, char *buf) // convert mode bitmask to string with sorted list of mode acronyms |
| 537 | { |