| 431 | enum extended_flags { HSV = -1, HSL = -2, HSV255 = -3, HSL255 = -4 }; |
| 432 | |
| 433 | static void parse_extended_flags(char* parse_string) { |
| 434 | const char* extended_flags[] = {"(HSV)", "(HSL)", "(hsv)", "(hsl)"}; |
| 435 | const signed char replacement_codes[] = {HSV255, HSL255, HSV, HSL}; |
| 436 | I32 nflags = (I32)(sizeof(extended_flags) / sizeof(char*)); |
| 437 | |
| 438 | for (I32 i = 0; i < nflags; i++) { |
| 439 | char* found = strstr(parse_string, extended_flags[i]); |
| 440 | |
| 441 | while (found) { |
| 442 | int len_flag = (int)strlen(extended_flags[i]); |
| 443 | int len_remaining = (int)strlen(found + len_flag); |
| 444 | *found = (char)replacement_codes[i]; |
| 445 | memmove(found + 1, found + len_flag, len_remaining + 1); |
| 446 | found = strstr(parse_string, extended_flags[i]); |
| 447 | } |
| 448 | } |
| 449 | } |
| 450 | |
| 451 | #ifdef COMPILE_WITH_GUI |
| 452 | extern int las2txt_gui(int argc, char* argv[], LASreadOpener* lasreadopener); |