Turn setting_find_setting static

This commit is contained in:
twinaphex 2015-06-03 11:59:14 +02:00
parent 501786416d
commit f42d0a7f7c
2 changed files with 40 additions and 43 deletions

View File

@ -283,6 +283,44 @@ static rarch_setting_t *menu_setting_get_ptr(void)
return menu->list_settings;
}
/**
* setting_reset:
* @settings : pointer to settings
* @name : name of setting to search for
*
* Search for a setting with a specified name (@name).
*
* Returns: pointer to setting if found, NULL otherwise.
**/
static rarch_setting_t* setting_find_setting(
rarch_setting_t* settings, const char* name)
{
bool found = false;
if (!settings || !name)
return NULL;
for (; settings->type != ST_NONE; settings++)
{
if (settings->type <= ST_GROUP && !strcmp(settings->name, name))
{
found = true;
break;
}
}
if (!found)
return NULL;
if (settings->short_description && settings->short_description[0] == '\0')
return NULL;
if (settings->read_handler)
settings->read_handler(settings);
return settings;
}
rarch_setting_t *menu_setting_find(const char *label)
{
rarch_setting_t *settings = menu_setting_get_ptr();
@ -438,43 +476,6 @@ static void setting_reset_setting(rarch_setting_t* setting)
setting->change_handler(setting);
}
/**
* setting_reset:
* @settings : pointer to settings
* @name : name of setting to search for
*
* Search for a setting with a specified name (@name).
*
* Returns: pointer to setting if found, NULL otherwise.
**/
rarch_setting_t* setting_find_setting(rarch_setting_t* settings,
const char* name)
{
bool found = false;
if (!settings || !name)
return NULL;
for (; settings->type != ST_NONE; settings++)
{
if (settings->type <= ST_GROUP && !strcmp(settings->name, name))
{
found = true;
break;
}
}
if (!found)
return NULL;
if (settings->short_description && settings->short_description[0] == '\0')
return NULL;
if (settings->read_handler)
settings->read_handler(settings);
return settings;
}
/**
* setting_set_with_string_representation:

View File

@ -217,19 +217,15 @@ int menu_setting_generic(rarch_setting_t *setting);
int menu_setting_set(unsigned type, const char *label,
unsigned action, bool wraparound);
rarch_setting_t *menu_setting_find(const char *label);
/**
* setting_find_setting:
* @settings : pointer to settings
* menu_setting_find:
* @name : name of setting to search for
*
* Search for a setting with a specified name (@name).
*
* Returns: pointer to setting if found, NULL otherwise.
**/
rarch_setting_t* setting_find_setting(rarch_setting_t* settings,
const char* name);
rarch_setting_t *menu_setting_find(const char *label);
/**
* setting_set_with_string_representation: