mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-02-14 16:28:05 +00:00
(iOS) Remove some trivial wrapper functions around config_file.c
This commit is contained in:
parent
558cb0f66f
commit
d4664f47d9
@ -16,18 +16,6 @@
|
||||
#include <string.h>
|
||||
#import "config_file_helper.h"
|
||||
|
||||
config_file_t* ios_config_open_or_new(const char* path)
|
||||
{
|
||||
config_file_t* result = config_file_new(path);
|
||||
return result ? result : config_file_new(0);
|
||||
}
|
||||
|
||||
void ios_config_file_write(config_file_t* config, const char* path)
|
||||
{
|
||||
if (config)
|
||||
config_file_write(config, path);
|
||||
}
|
||||
|
||||
bool ios_config_get_bool(config_file_t* config, const char* name, bool default_)
|
||||
{
|
||||
if (!config) return default_;
|
||||
@ -37,15 +25,6 @@ bool ios_config_get_bool(config_file_t* config, const char* name, bool default_)
|
||||
return result;
|
||||
}
|
||||
|
||||
int ios_config_get_int(config_file_t* config, const char* name, int default_)
|
||||
{
|
||||
if (!config) return default_;
|
||||
|
||||
int result = default_;
|
||||
config_get_int(config, name, &result);
|
||||
return result;
|
||||
}
|
||||
|
||||
unsigned ios_config_get_uint(config_file_t* config, const char* name, unsigned default_)
|
||||
{
|
||||
if (!config) return default_;
|
||||
|
@ -18,11 +18,7 @@
|
||||
|
||||
#include "conf/config_file.h"
|
||||
|
||||
config_file_t* ios_config_open_or_new(const char* path);
|
||||
void ios_config_file_write(config_file_t* config, const char* path);
|
||||
|
||||
bool ios_config_get_bool(config_file_t* config, const char* name, bool default_);
|
||||
int ios_config_get_int(config_file_t* config, const char* name, int default_);
|
||||
unsigned ios_config_get_uint(config_file_t* config, const char* name, unsigned default_);
|
||||
double ios_config_get_double(config_file_t* config, const char* name, double default_);
|
||||
|
||||
|
@ -196,10 +196,14 @@ static RASettingData* custom_action(NSString* action)
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
config_file_t* config = ios_config_open_or_new([[RetroArch_iOS get].moduleInfo.configPath UTF8String]);
|
||||
config_file_t* config = config_file_new([[RetroArch_iOS get].moduleInfo.configPath UTF8String]);
|
||||
|
||||
if (!config)
|
||||
config = config_file_new(0);
|
||||
ios_config_set_string(config, "system_directory", [[RetroArch_iOS get].system_directory UTF8String]);
|
||||
[self writeSettings:nil toConfig:config];
|
||||
ios_config_file_write(config, [[RetroArch_iOS get].moduleInfo.configPath UTF8String]);
|
||||
if (config)
|
||||
config_file_write(config, [[RetroArch_iOS get].moduleInfo.configPath UTF8String]);
|
||||
config_file_free(config);
|
||||
|
||||
[[RetroArch_iOS get] refreshConfig];
|
||||
|
Loading…
x
Reference in New Issue
Block a user