static void menu_action_setting_disp_set_label(file_list_t* list, unsigned *w, unsigned type, unsigned i, const char *label, char *s, size_t len, const char *entry_label, const char *path, char *s2, size_t len2) { *s = '\0'; *w = 19; menu_setting_get_label(list, s, len, w, type, label, entry_label, i); strlcpy(s2, path, len2); }
static void menu_action_setting_disp_set_label(file_list_t* list, unsigned *w, unsigned type, unsigned i, const char *label, char *s, size_t len, const char *entry_label, const char *path, char *s2, size_t len2) { rarch_system_info_t *system = NULL; uint32_t hash_label = menu_hash_calculate(label); runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &system); *s = '\0'; *w = 19; switch (hash_label) { case MENU_LABEL_LOAD_CONTENT_HISTORY: *w = strlen(label); break; case MENU_LABEL_SYSTEM_INFORMATION: *w = 2; break; case MENU_LABEL_DEBUG_INFORMATION: *w = 2; break; case MENU_LABEL_ACHIEVEMENT_LIST: *w = 2; break; } if (type >= MENU_SETTINGS_PLAYLIST_ASSOCIATION_START) { char playlist_name_with_ext[PATH_MAX_LENGTH]; unsigned i; bool found_matching_core_association = false; settings_t *settings = config_get_ptr(); struct string_list *str_list = string_split(settings->playlist_names, ";"); struct string_list *str_list2 = string_split(settings->playlist_cores, ";"); strlcpy(playlist_name_with_ext, path, sizeof(playlist_name_with_ext)); strlcat(playlist_name_with_ext, ".lpl", sizeof(playlist_name_with_ext)); for (i = 0; i < str_list->size; i++) { if (!strcmp(str_list->elems[i].data, playlist_name_with_ext)) { if (str_list->size != str_list2->size) break; if (str_list2->elems[i].data == NULL) break; found_matching_core_association = true; strlcpy(s, str_list2->elems[i].data, len); } } string_list_free(str_list); string_list_free(str_list2); if (!strcmp(s, "DETECT") || !found_matching_core_association) strlcpy(s, "N/A", len); else { char buf[PATH_MAX_LENGTH]; core_info_list_t *list = NULL; runloop_ctl(RUNLOOP_CTL_CURRENT_CORE_LIST_GET, &list); if (core_info_list_get_display_name(list, s, buf, sizeof(buf))) strlcpy(s, buf, len); } } else if (type >= MENU_SETTINGS_CORE_OPTION_START) { const char *core_opt = NULL; if (!system) return; core_opt = core_option_get_val(system->core_options, type - MENU_SETTINGS_CORE_OPTION_START); strlcpy(s, "", len); if (core_opt) strlcpy(s, core_opt, len); } else menu_setting_get_label(list, s, len, w, type, label, entry_label, i); strlcpy(s2, path, len2); }