mirror of
https://github.com/libretro/RetroArch
synced 2025-03-13 07:14:43 +00:00
Add config_get_float.
This commit is contained in:
parent
c305f4347d
commit
751761d99c
@ -419,6 +419,22 @@ bool config_get_double(config_file_t *conf, const char *key, double *in)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool config_get_float(config_file_t *conf, const char *key, float *in)
|
||||
{
|
||||
struct entry_list *list = conf->entries;
|
||||
|
||||
while (list)
|
||||
{
|
||||
if (strcmp(key, list->key) == 0)
|
||||
{
|
||||
*in = (float)strtod(list->value, NULL);
|
||||
return true;
|
||||
}
|
||||
list = list->next;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool config_get_int(config_file_t *conf, const char *key, int *in)
|
||||
{
|
||||
struct entry_list *list = conf->entries;
|
||||
|
@ -49,6 +49,8 @@ bool config_entry_exists(config_file_t *conf, const char *entry);
|
||||
|
||||
// Extracts a double from config file.
|
||||
bool config_get_double(config_file_t *conf, const char *entry, double *in);
|
||||
// Extracts a float from config file.
|
||||
bool config_get_float(config_file_t *conf, const char *entry, float *in);
|
||||
// Extracts an int from config file.
|
||||
bool config_get_int(config_file_t *conf, const char *entry, int *in);
|
||||
// Extracts an uint from config file.
|
||||
|
Loading…
x
Reference in New Issue
Block a user