| 609 | } |
| 610 | |
| 611 | static void ARC_parse_params(cache_t *cache, |
| 612 | const char *cache_specific_params) { |
| 613 | ARC_params_t *params = (ARC_params_t *)(cache->eviction_params); |
| 614 | |
| 615 | char *params_str = strdup(cache_specific_params); |
| 616 | char *old_params_str = params_str; |
| 617 | |
| 618 | while (params_str != NULL && params_str[0] != '\0') { |
| 619 | /* different parameters are separated by comma, |
| 620 | * key and value are separated by = */ |
| 621 | char *key = strsep((char **)¶ms_str, "="); |
| 622 | // char *value = strsep((char **)¶ms_str, ","); |
| 623 | |
| 624 | // skip the white space |
| 625 | while (params_str != NULL && *params_str == ' ') { |
| 626 | params_str++; |
| 627 | } |
| 628 | |
| 629 | if (strcasecmp(key, "print") == 0) { |
| 630 | printf("parameters: %s\n", ARC_current_params(params)); |
| 631 | exit(0); |
| 632 | } else { |
| 633 | ERROR("%s does not have parameter %s\n", cache->cache_name, key); |
| 634 | exit(1); |
| 635 | } |
| 636 | } |
| 637 | |
| 638 | free(old_params_str); |
| 639 | } |
| 640 | |
| 641 | // *********************************************************************** |
| 642 | // **** **** |
nothing calls this directly
no test coverage detected