Cut down on code duplication

This commit is contained in:
twinaphex 2017-11-26 06:49:58 +01:00
parent d5c30fd68c
commit edfe5e6991

View File

@ -2618,40 +2618,17 @@ static int generic_action_ok_network(const char *path,
label, type, idx, entry_idx, type_id2); label, type, idx, entry_idx, type_id2);
} }
static int action_ok_core_content_list(const char *path, #define default_action_ok_list(funcname, _id) \
const char *label, unsigned type, size_t idx, size_t entry_idx) static int (funcname)(const char *path, const char *label, unsigned type, size_t idx, size_t entry_idx) \
{ { \
return generic_action_ok_network(path, label, type, idx, entry_idx, return generic_action_ok_network(path, label, type, idx, entry_idx, _id); \
MENU_ENUM_LABEL_CB_CORE_CONTENT_LIST);
} }
static int action_ok_core_content_dirs_list(const char *path, default_action_ok_list(action_ok_core_content_list, MENU_ENUM_LABEL_CB_CORE_CONTENT_LIST)
const char *label, unsigned type, size_t idx, size_t entry_idx) default_action_ok_list(action_ok_core_content_dirs_list, MENU_ENUM_LABEL_CB_CORE_CONTENT_DIRS_LIST)
{ default_action_ok_list(action_ok_core_updater_list, MENU_ENUM_LABEL_CB_CORE_UPDATER_LIST)
return generic_action_ok_network(path, label, type, idx, entry_idx, default_action_ok_list(action_ok_thumbnails_updater_list, MENU_ENUM_LABEL_CB_THUMBNAILS_UPDATER_LIST)
MENU_ENUM_LABEL_CB_CORE_CONTENT_DIRS_LIST); default_action_ok_list(action_ok_lakka_list, MENU_ENUM_LABEL_CB_LAKKA_LIST)
}
static int action_ok_core_updater_list(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
return generic_action_ok_network(path, label, type, idx, entry_idx,
MENU_ENUM_LABEL_CB_CORE_UPDATER_LIST);
}
static int action_ok_thumbnails_updater_list(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
return generic_action_ok_network(path, label, type, idx, entry_idx,
MENU_ENUM_LABEL_CB_THUMBNAILS_UPDATER_LIST);
}
static int action_ok_lakka_list(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
return generic_action_ok_network(path, label, type, idx, entry_idx,
MENU_ENUM_LABEL_CB_LAKKA_LIST);
}
static void cb_generic_dir_download(void *task_data, static void cb_generic_dir_download(void *task_data,
void *user_data, const char *err) void *user_data, const char *err)