Move config-file code to SDK

This commit is contained in:
twinaphex 2014-10-22 03:35:04 +02:00
parent 156b2e44fc
commit 2997af48fa
23 changed files with 111 additions and 95 deletions

View File

@ -120,8 +120,8 @@ OBJ += frontend/frontend.o \
libretro-sdk/compat/compat.o \
cheats.o \
core_info.o \
conf/config_file.o \
conf/config_file_userdata.o \
libretro-sdk/file/config_file.o \
libretro-sdk/file/config_file_userdata.o \
screenshot.o \
gfx/scaler/scaler.o \
gfx/shader/shader_null.o \
@ -632,7 +632,7 @@ endif
# Joyconfig binary
JOYCONFIG_OBJ += tools/retroarch-joyconfig.o \
conf/config_file.o \
libretro-sdk/file/config_file.o \
libretro-sdk/file/file_path.o \
libretro-sdk/string/string_list.o \
libretro-sdk/compat/compat.o \

View File

@ -18,7 +18,7 @@
#include "dsp_filter.h"
#include "../dynamic.h"
#include "../conf/config_file_userdata.h"
#include <file/config_file_userdata.h>
#include "filters/dspfilter.h"
#include <file/file_path.h>
#include "../file_ext.h"

View File

@ -17,7 +17,7 @@
#ifdef RARCH_INTERNAL
#include "../../performance.h"
#endif
#include "../../conf/config_file_userdata.h"
#include <file/config_file_userdata.h>
#include <string.h>
static const rarch_resampler_t *resampler_drivers[] = {

View File

@ -1,48 +0,0 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
* Copyright (C) 2011-2014 - Daniel De Matteis
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _LIBRETRO_SDK_CONFIG_FILE_USERDATA_H
#define _LIBRETRO_SDK_CONFIG_FILE_USERDATA_H
#include <string.h>
#include "config_file.h"
struct config_file_userdata
{
config_file_t *conf;
const char *prefix[2];
};
int config_userdata_get_float(void *userdata, const char *key_str,
float *value, float default_value);
int config_userdata_get_int(void *userdata, const char *key_str,
int *value, int default_value);
int config_userdata_get_float_array(void *userdata, const char *key_str,
float **values, unsigned *out_num_values,
const float *default_values, unsigned num_default_values);
int config_userdata_get_int_array(void *userdata, const char *key_str,
int **values, unsigned *out_num_values,
const int *default_values, unsigned num_default_values);
int config_userdata_get_string(void *userdata, const char *key_str,
char **output, const char *default_output);
void config_userdata_free(void *ptr);
#endif

View File

@ -18,7 +18,7 @@
#ifndef CORE_INFO_H_
#define CORE_INFO_H_
#include "conf/config_file.h"
#include <file/config_file.h>
#include <stddef.h>
#ifdef __cplusplus

View File

@ -15,7 +15,7 @@
#include "core_options.h"
#include <string.h>
#include "conf/config_file.h"
#include <file/config_file.h>
#include <file/dir_list.h>
#include <compat/posix_string.h>
#include <compat/strl.h>

View File

@ -805,7 +805,6 @@ const char *config_get_default_joypad(void);
const char *config_get_default_menu(void);
#endif
#include "conf/config_file.h"
bool config_save_file(const char *path);
void rarch_main_state_new(void);

View File

@ -16,7 +16,7 @@
#include "filter.h"
#include "filters/softfilter.h"
#include "../dynamic.h"
#include "../conf/config_file_userdata.h"
#include <file/config_file_userdata.h>
#include "../general.h"
#include <file/file_path.h>
#include "../file_ext.h"

View File

@ -32,7 +32,7 @@
#include <string.h>
#include <compat/strl.h>
#include <compat/posix_string.h>
#include "../../conf/config_file.h"
#include <file/config_file.h>
#include "../../dynamic.h"
#include <file/file_path.h>

View File

@ -17,8 +17,8 @@
#define SHADER_PARSE_H
#include <boolean.h>
#include <file/config_file.h>
#include "../state_tracker.h"
#include "../../conf/config_file.h"
#include <retro_miscellaneous.h>
#ifdef __cplusplus

View File

@ -72,8 +72,8 @@ CONFIG FILE
#undef strcasecmp
#endif
#include "../conf/config_file.c"
#include "../conf/config_file_userdata.c"
#include "../libretro-sdk/file/config_file.c"
#include "../libretro-sdk/file/config_file_userdata.c"
#include "../core_options.c"
/*============================================================

View File

@ -18,7 +18,7 @@
#include "input_autodetect.h"
#include "../driver.h"
#include "../conf/config_file.h"
#include <file/config_file.h>
#include "../general.h"
#include <stdint.h>

View File

@ -18,7 +18,7 @@
#include "../driver.h"
#include "../libretro.h"
#include "../gfx/image/image.h"
#include "../conf/config_file.h"
#include <file/config_file.h>
#include <compat/posix_string.h>
#include "input_common.h"
#include <file/file_path.h>

View File

@ -16,7 +16,6 @@
#include "input_common.h"
#include "keyboard_line.h"
#include "../general.h"
#include "../conf/config_file.h"
#include <file/file_path.h>
#include <unistd.h>
#include <stdint.h>

View File

@ -13,7 +13,7 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#include "config_file.h"
#include <file/config_file.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>

View File

@ -14,7 +14,7 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#include "config_file_userdata.h"
#include <file/config_file_userdata.h>
#include <string/string_list.h>
#define get_array_setup() \

View File

@ -1,16 +1,23 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
/* Copyright (C) 2010-2014 The RetroArch team
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (config_file.h).
* ---------------------------------------------------------------------------------------
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
* Permission is hereby granted, free of charge,
* to any person obtaining a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

View File

@ -1,17 +1,23 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
* Copyright (C) 2011-2014 - Daniel De Matteis
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
/* Copyright (C) 2010-2014 The RetroArch team
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (config_file_macros.h).
* ---------------------------------------------------------------------------------------
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
* Permission is hereby granted, free of charge,
* to any person obtaining a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef __LIBRETRO_SDK_CONFIG_FILE_MACROS_H__
@ -64,4 +70,3 @@
#define CONFIG_GET_PATH_EXTERN(var, key) CONFIG_GET_PATH_BASE(conf, g_extern, var, key)
#endif

View File

@ -0,0 +1,54 @@
/* Copyright (C) 2010-2014 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (config_file_userdata.h).
* ---------------------------------------------------------------------------------------
*
* Permission is hereby granted, free of charge,
* to any person obtaining a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef _LIBRETRO_SDK_CONFIG_FILE_USERDATA_H
#define _LIBRETRO_SDK_CONFIG_FILE_USERDATA_H
#include <string.h>
#include "config_file.h"
struct config_file_userdata
{
config_file_t *conf;
const char *prefix[2];
};
int config_userdata_get_float(void *userdata, const char *key_str,
float *value, float default_value);
int config_userdata_get_int(void *userdata, const char *key_str,
int *value, int default_value);
int config_userdata_get_float_array(void *userdata, const char *key_str,
float **values, unsigned *out_num_values,
const float *default_values, unsigned num_default_values);
int config_userdata_get_int_array(void *userdata, const char *key_str,
int **values, unsigned *out_num_values,
const int *default_values, unsigned num_default_values);
int config_userdata_get_string(void *userdata, const char *key_str,
char **output, const char *default_output);
void config_userdata_free(void *ptr);
#endif

View File

@ -47,7 +47,7 @@ extern "C" {
#include <rthreads/rthreads.h>
#include "../general.h"
#include "../gfx/scaler/scaler.h"
#include "../conf/config_file.h"
#include <file/config_file.h>
#include "../audio/utils.h"
#include "ffemu.h"
#include <assert.h>

View File

@ -13,8 +13,8 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#include "conf/config_file.h"
#include "conf/config_file_macros.h"
#include <file/config_file.h>
#include <file/config_file_macros.h>
#include <compat/strl.h>
#include <compat/posix_string.h>
#include "config.def.h"

View File

@ -17,7 +17,7 @@
#define __RARCH_SETTINGS_DATA_H__
#include <stdint.h>
#include "conf/config_file.h"
#include <file/config_file.h>
#include <retro_miscellaneous.h>
#include "settings_list.h"

View File

@ -17,7 +17,7 @@
#include "config.h"
#endif
#include "conf/config_file.h"
#include <file/config_file.h>
#include <stdio.h>
#include <stdlib.h>
#include <compat/getopt.h>