mirror of
https://github.com/libretro/RetroArch
synced 2025-03-02 19:13:34 +00:00
Mov code to paths.c
This commit is contained in:
parent
1dd28bdf9f
commit
5aebdb7484
@ -38,6 +38,7 @@
|
||||
#include "input/input_remapping.h"
|
||||
#include "defaults.h"
|
||||
#include "core.h"
|
||||
#include "paths.h"
|
||||
#include "retroarch.h"
|
||||
#include "runloop.h"
|
||||
#include "verbosity.h"
|
||||
@ -3217,48 +3218,6 @@ bool config_replace(char *path)
|
||||
return true;
|
||||
}
|
||||
|
||||
static char path_libretro[PATH_MAX_LENGTH];
|
||||
|
||||
char *config_get_active_core_path_ptr(void)
|
||||
{
|
||||
return path_libretro;
|
||||
}
|
||||
|
||||
const char *config_get_active_core_path(void)
|
||||
{
|
||||
return path_libretro;
|
||||
}
|
||||
|
||||
bool config_active_core_path_is_empty(void)
|
||||
{
|
||||
return !path_libretro[0];
|
||||
}
|
||||
|
||||
size_t config_get_active_core_path_size(void)
|
||||
{
|
||||
return sizeof(path_libretro);
|
||||
}
|
||||
|
||||
void config_set_active_core_path(const char *path)
|
||||
{
|
||||
strlcpy(path_libretro, path, sizeof(path_libretro));
|
||||
}
|
||||
|
||||
void config_clear_active_core_path(void)
|
||||
{
|
||||
*path_libretro = '\0';
|
||||
}
|
||||
|
||||
const char *config_get_active_path(void)
|
||||
{
|
||||
global_t *global = global_get_ptr();
|
||||
|
||||
if (!string_is_empty(global->path.config))
|
||||
return global->path.config;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void config_free_state(void)
|
||||
{
|
||||
}
|
||||
|
@ -631,20 +631,6 @@ bool config_overlay_enable_default(void);
|
||||
|
||||
void config_free(void);
|
||||
|
||||
const char *config_get_active_path(void);
|
||||
|
||||
const char *config_get_active_core_path(void);
|
||||
|
||||
char *config_get_active_core_path_ptr(void);
|
||||
|
||||
void config_set_active_core_path(const char *path);
|
||||
|
||||
void config_clear_active_core_path(void);
|
||||
|
||||
bool config_active_core_path_is_empty(void);
|
||||
|
||||
size_t config_get_active_core_path_size(void);
|
||||
|
||||
void config_free_state(void);
|
||||
|
||||
settings_t *config_get_ptr(void);
|
||||
|
@ -30,8 +30,8 @@
|
||||
#include "../ui/ui_companion_driver.h"
|
||||
#include "../tasks/tasks_internal.h"
|
||||
|
||||
#include "../configuration.h"
|
||||
#include "../driver.h"
|
||||
#include "../paths.h"
|
||||
#include "../retroarch.h"
|
||||
#include "../runloop.h"
|
||||
|
||||
|
@ -56,7 +56,7 @@
|
||||
#include "../msg_hash.h"
|
||||
#include "../defaults.h"
|
||||
#include "../driver.h"
|
||||
#include "../core.h"
|
||||
#include "../paths.h"
|
||||
#include "../dynamic.h"
|
||||
#include "../runloop.h"
|
||||
#include "../verbosity.h"
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include "menu_shader.h"
|
||||
#include "../file_path_special.h"
|
||||
#include "../configuration.h"
|
||||
#include "../paths.h"
|
||||
#include "../runloop.h"
|
||||
#include "../verbosity.h"
|
||||
|
||||
|
43
paths.c
43
paths.c
@ -13,6 +13,7 @@
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <retro_miscellaneous.h>
|
||||
#include <compat/strl.h>
|
||||
#include <file/file_path.h>
|
||||
#include <lists/string_list.h>
|
||||
@ -30,6 +31,7 @@
|
||||
#include "command.h"
|
||||
#include "content.h"
|
||||
#include "dynamic.h"
|
||||
#include "movie.h"
|
||||
#include "file_path_special.h"
|
||||
|
||||
#include "core.h"
|
||||
@ -41,6 +43,7 @@
|
||||
#define MENU_VALUE_NO_CORE 0x7d5472cbU
|
||||
|
||||
static char current_savefile_dir[PATH_MAX_LENGTH] = {0};
|
||||
static char path_libretro[PATH_MAX_LENGTH] = {0};
|
||||
|
||||
void path_set_redirect(void)
|
||||
{
|
||||
@ -411,3 +414,43 @@ void path_fill_names(void)
|
||||
file_path_str(FILE_PATH_IPS_EXTENSION),
|
||||
sizeof(global->name.ips));
|
||||
}
|
||||
|
||||
char *config_get_active_core_path_ptr(void)
|
||||
{
|
||||
return path_libretro;
|
||||
}
|
||||
|
||||
const char *config_get_active_core_path(void)
|
||||
{
|
||||
return path_libretro;
|
||||
}
|
||||
|
||||
bool config_active_core_path_is_empty(void)
|
||||
{
|
||||
return !path_libretro[0];
|
||||
}
|
||||
|
||||
size_t config_get_active_core_path_size(void)
|
||||
{
|
||||
return sizeof(path_libretro);
|
||||
}
|
||||
|
||||
void config_set_active_core_path(const char *path)
|
||||
{
|
||||
strlcpy(path_libretro, path, sizeof(path_libretro));
|
||||
}
|
||||
|
||||
void config_clear_active_core_path(void)
|
||||
{
|
||||
*path_libretro = '\0';
|
||||
}
|
||||
|
||||
const char *config_get_active_path(void)
|
||||
{
|
||||
global_t *global = global_get_ptr();
|
||||
|
||||
if (!string_is_empty(global->path.config))
|
||||
return global->path.config;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
14
paths.h
14
paths.h
@ -35,6 +35,20 @@ void path_set_basename(const char *path);
|
||||
|
||||
const char *path_get_current_savefile_dir(void);
|
||||
|
||||
const char *config_get_active_path(void);
|
||||
|
||||
const char *config_get_active_core_path(void);
|
||||
|
||||
char *config_get_active_core_path_ptr(void);
|
||||
|
||||
void config_set_active_core_path(const char *path);
|
||||
|
||||
void config_clear_active_core_path(void);
|
||||
|
||||
bool config_active_core_path_is_empty(void);
|
||||
|
||||
size_t config_get_active_core_path_size(void);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
|
@ -61,6 +61,7 @@
|
||||
#include "configuration.h"
|
||||
#include "driver.h"
|
||||
#include "movie.h"
|
||||
#include "paths.h"
|
||||
#include "retroarch.h"
|
||||
#include "runloop.h"
|
||||
#include "file_path_special.h"
|
||||
|
@ -85,6 +85,7 @@
|
||||
#include "../retroarch.h"
|
||||
#include "../file_path_special.h"
|
||||
#include "../core.h"
|
||||
#include "../paths.h"
|
||||
#include "../verbosity.h"
|
||||
|
||||
#ifdef HAVE_7ZIP
|
||||
|
Loading…
x
Reference in New Issue
Block a user