(retroarch.c) Add --log-file and --version

This commit is contained in:
Higor Eurípedes 2015-06-12 12:31:28 -03:00
parent 4e595b34c1
commit ecede41cb2
5 changed files with 29 additions and 2 deletions

View File

@ -1,3 +1,5 @@
HAVE_FILE_LOGGER=1
include config.mk
TARGET = retroarch

View File

@ -37,6 +37,10 @@ ifeq ($(TDM_GCC),)
LDCXXFLAGS += -static-libstdc++
endif
ifeq ($(HAVE_FILE_LOGGER), 1)
CFLAGS += -DHAVE_FILE_LOGGER -Ilogger/netlogger
endif
CFLAGS += -I./libretro-common/include
# Switches

View File

@ -457,6 +457,10 @@ static void parse_input(int argc, char *argv[])
{ "subsystem", 1, NULL, 'Z' },
{ "max-frames", 1, NULL, 'm' },
{ "eof-exit", 0, &val, 'e' },
{ "version", 0, &val, 'V' },
#ifdef HAVE_FILE_LOGGER
{ "log-file", 1, &val, 'L' },
#endif
{ NULL, 0, NULL, 0 }
};
@ -662,7 +666,7 @@ static void parse_input(int argc, char *argv[])
runloop->frames.video.max = strtoul(optarg, NULL, 10);
break;
case 0:
case 0: /* options without short variant */
switch (val)
{
case 'M':
@ -743,6 +747,16 @@ static void parse_input(int argc, char *argv[])
global->bsv.eof_exit = true;
break;
case 'V':
print_version();
exit(0);
#ifdef HAVE_FILE_LOGGER
case 'L':
global->log_file = fopen(optarg, "wb");
break;
#endif
default:
break;
}
@ -1169,6 +1183,10 @@ error:
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");

View File

@ -20,7 +20,8 @@
#include <stdarg.h>
#include <stdio.h>
#if defined(HAVE_FILE_LOGGER) && defined(RARCH_INTERNAL)
#if defined(HAVE_FILE_LOGGER) && defined(RARCH_INTERNAL) && !defined(IS_JOYCONFIG)
FILE *rarch_main_log_file(void);
#define LOG_FILE (rarch_main_log_file())
#else
#define LOG_FILE (stderr)

View File

@ -14,6 +14,8 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#define IS_JOYCONFIG
#include "retroarch-joyconfig.c"
#include "../libretro-common/dynamic/dylib.c"