Move rarch_main_init_wrap to frontend.c and turn it into

a static function
This commit is contained in:
twinaphex 2016-01-25 05:45:37 +01:00
parent 854937483d
commit fd94cbdefe
3 changed files with 71 additions and 82 deletions

View File

@ -176,6 +176,77 @@ static void history_playlist_push(content_playlist_t *playlist,
NULL);
}
/**
* rarch_main_init_wrap:
* @args : Input arguments.
* @argc : Count of arguments.
* @argv : Arguments.
*
* Generates an @argc and @argv pair based on @args
* of type rarch_main_wrap.
**/
static void rarch_main_init_wrap(
const struct rarch_main_wrap *args,
int *argc, char **argv)
{
#ifdef HAVE_FILE_LOGGER
int i;
#endif
*argc = 0;
argv[(*argc)++] = strdup("retroarch");
if (!args->no_content)
{
if (args->content_path)
{
RARCH_LOG("Using content: %s.\n", args->content_path);
argv[(*argc)++] = strdup(args->content_path);
}
else
{
#ifdef HAVE_MENU
RARCH_LOG("No content, starting dummy core.\n");
argv[(*argc)++] = strdup("--menu");
#endif
}
}
if (args->sram_path)
{
argv[(*argc)++] = strdup("-s");
argv[(*argc)++] = strdup(args->sram_path);
}
if (args->state_path)
{
argv[(*argc)++] = strdup("-S");
argv[(*argc)++] = strdup(args->state_path);
}
if (args->config_path)
{
argv[(*argc)++] = strdup("-c");
argv[(*argc)++] = strdup(args->config_path);
}
#ifdef HAVE_DYNAMIC
if (args->libretro_path)
{
argv[(*argc)++] = strdup("-L");
argv[(*argc)++] = strdup(args->libretro_path);
}
#endif
if (args->verbose)
argv[(*argc)++] = strdup("-v");
#ifdef HAVE_FILE_LOGGER
for (i = 0; i < *argc; i++)
RARCH_LOG("arg #%d: %s\n", i, argv[i]);
#endif
}
/**
* main_load_content:
* @argc : Argument count.

View File

@ -1199,76 +1199,6 @@ error:
return 1;
}
/**
* rarch_main_init_wrap:
* @args : Input arguments.
* @argc : Count of arguments.
* @argv : Arguments.
*
* Generates an @argc and @argv pair based on @args
* of type rarch_main_wrap.
**/
void rarch_main_init_wrap(const struct rarch_main_wrap *args,
int *argc, char **argv)
{
#ifdef HAVE_FILE_LOGGER
int i;
#endif
*argc = 0;
argv[(*argc)++] = strdup("retroarch");
if (!args->no_content)
{
if (args->content_path)
{
RARCH_LOG("Using content: %s.\n", args->content_path);
argv[(*argc)++] = strdup(args->content_path);
}
else
{
#ifdef HAVE_MENU
RARCH_LOG("No content, starting dummy core.\n");
argv[(*argc)++] = strdup("--menu");
#endif
}
}
if (args->sram_path)
{
argv[(*argc)++] = strdup("-s");
argv[(*argc)++] = strdup(args->sram_path);
}
if (args->state_path)
{
argv[(*argc)++] = strdup("-S");
argv[(*argc)++] = strdup(args->state_path);
}
if (args->config_path)
{
argv[(*argc)++] = strdup("-c");
argv[(*argc)++] = strdup(args->config_path);
}
#ifdef HAVE_DYNAMIC
if (args->libretro_path)
{
argv[(*argc)++] = strdup("-L");
argv[(*argc)++] = strdup(args->libretro_path);
}
#endif
if (args->verbose)
argv[(*argc)++] = strdup("-v");
#ifdef HAVE_FILE_LOGGER
for (i = 0; i < *argc; i++)
RARCH_LOG("arg #%d: %s\n", i, argv[i]);
#endif
}
#define FAIL_CPU(simd_type) do { \
RARCH_ERR(simd_type " code is compiled in, but CPU does not support this feature. Cannot continue.\n"); \
retro_fail(1, "validate_cpu_features()"); \

View File

@ -180,18 +180,6 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data);
**/
int rarch_main_init(int argc, char *argv[]);
/**
* rarch_main_init_wrap:
* @args : Input arguments.
* @argc : Count of arguments.
* @argv : Arguments.
*
* Generates an @argc and @argv pair based on @args
* of type rarch_main_wrap.
**/
void rarch_main_init_wrap(const struct rarch_main_wrap *args,
int *argc, char **argv);
/**
* rarch_main_deinit:
*