diff --git a/Makefile.common b/Makefile.common index 2191037cbb..a8ae49b1ab 100644 --- a/Makefile.common +++ b/Makefile.common @@ -94,7 +94,7 @@ OBJ += frontend/frontend.o \ file.o \ libretro-sdk/file/file_list.o \ dir_list.o \ - string_list.o \ + libretro-sdk/string/string_list.o \ file_path.o \ hash.o \ driver.o \ @@ -632,6 +632,6 @@ endif JOYCONFIG_OBJ += tools/retroarch-joyconfig.o \ conf/config_file.o \ file_path.o \ - string_list.o \ + libretro-sdk/string/string_list.o \ libretro-sdk/compat/compat.o \ tools/input_common_joyconfig.o diff --git a/Makefile.ps3.salamander b/Makefile.ps3.salamander index 8cdfbbe25b..f28c134f68 100644 --- a/Makefile.ps3.salamander +++ b/Makefile.ps3.salamander @@ -19,7 +19,7 @@ endif STRIP = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-strip.exe PPU_CFLAGS += -I. -Ilibretro-sdk/include -D__CELLOS_LV2__ -DIS_SALAMANDER -DRARCH_CONSOLE -DHAVE_SYSUTILS -DHAVE_SYSMODULES -DHAVE_RARCH_EXEC -DRARCH_INTERNAL -PPU_SRCS = frontend/frontend_salamander.c frontend/frontend_context.c frontend/platform/platform_ps3.c frontend/platform/platform_null.c file_path.c dir_list.c string_list.c libretro-sdk/compat/compat.c conf/config_file.c +PPU_SRCS = frontend/frontend_salamander.c frontend/frontend_context.c frontend/platform/platform_ps3.c frontend/platform/platform_null.c file_path.c dir_list.c libretro-sdk/string/string_list.c libretro-sdk/compat/compat.c conf/config_file.c ifeq ($(HAVE_LOGGER), 1) PPU_CFLAGS += -DHAVE_LOGGER -Ilogger/netlogger diff --git a/Makefile.psp1.salamander b/Makefile.psp1.salamander index 5450930935..c6d6a7c389 100644 --- a/Makefile.psp1.salamander +++ b/Makefile.psp1.salamander @@ -31,7 +31,7 @@ PSP_EBOOT_TITLE = RetroArch PSP_EBOOT_ICON = psp1/ICON0.PNG PSP_EBOOT_PIC1 = psp1/PIC1.PNG -OBJS = frontend/frontend_salamander.o frontend/frontend_context.o frontend/platform/platform_psp.o frontend/platform/platform_null.o file_path.o string_list.o dir_list.o libretro-sdk/compat/compat.o conf/config_file.o psp1/kernel_functions.o +OBJS = frontend/frontend_salamander.o frontend/frontend_context.o frontend/platform/platform_psp.o frontend/platform/platform_null.o file_path.o libretro-sdk/string/string_list.o dir_list.o libretro-sdk/compat/compat.o conf/config_file.o psp1/kernel_functions.o PSPSDK=$(shell psp-config --pspsdk-path) include $(PSPSDK)/lib/build.mak diff --git a/Makefile.wii.salamander b/Makefile.wii.salamander index a5d80654db..95867eee20 100644 --- a/Makefile.wii.salamander +++ b/Makefile.wii.salamander @@ -39,7 +39,7 @@ LIBS := -lfat -lwiiuse -logc -lbte APP_BOOTER_DIR = wii/app_booter -OBJ = frontend/frontend_salamander.o frontend/frontend_context.o frontend/platform/platform_gx.o frontend/platform/platform_wii.o frontend/platform/platform_null.o file_path.o string_list.o dir_list.o libretro-sdk/compat/compat.o conf/config_file.o $(APP_BOOTER_DIR)/app_booter.binobj +OBJ = frontend/frontend_salamander.o frontend/frontend_context.o frontend/platform/platform_gx.o frontend/platform/platform_wii.o frontend/platform/platform_null.o file_path.o libretro-sdk/string/string_list.o dir_list.o libretro-sdk/compat/compat.o conf/config_file.o $(APP_BOOTER_DIR)/app_booter.binobj ifeq ($(HAVE_LOGGER), 1) CFLAGS += -DHAVE_LOGGER diff --git a/conf/config_file_userdata.c b/conf/config_file_userdata.c index 34f0412694..c910779a6a 100644 --- a/conf/config_file_userdata.c +++ b/conf/config_file_userdata.c @@ -15,7 +15,7 @@ */ #include "config_file_userdata.h" -#include "../string_list.h" +#include #define get_array_setup() \ struct config_file_userdata *dsp = (struct config_file_userdata*)userdata; \ diff --git a/dir_list.h b/dir_list.h index 433685e465..b69108bb92 100644 --- a/dir_list.h +++ b/dir_list.h @@ -17,7 +17,7 @@ #ifndef _DIR_LIST_H #define _DIR_LIST_H -#include "string_list.h" +#include #ifdef __cplusplus extern "C" { diff --git a/file_path.h b/file_path.h index 13fe75b7d6..780c6a3508 100644 --- a/file_path.h +++ b/file_path.h @@ -22,7 +22,7 @@ #include #include #include -#include "string_list.h" +#include #ifdef __cplusplus extern "C" { diff --git a/frontend/menu/disp/glui.c b/frontend/menu/disp/glui.c index d0baab3081..d5c0ccecfe 100644 --- a/frontend/menu/disp/glui.c +++ b/frontend/menu/disp/glui.c @@ -24,7 +24,6 @@ #include "../menu_common.h" #include "../menu_driver.h" #include "menu_display.h" -#include "../../../string_list.h" #include "../../../general.h" #include "../../../file_path.h" #include "../../../gfx/gl_common.h" diff --git a/libretro-sdk/include/string/string_list.h b/libretro-sdk/include/string/string_list.h new file mode 100644 index 0000000000..70a095826d --- /dev/null +++ b/libretro-sdk/include/string/string_list.h @@ -0,0 +1,78 @@ +/* Copyright (C) 2010-2014 The RetroArch team + * + * --------------------------------------------------------------------------------------- + * The following license statement only applies to this file (string_list.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_STRING_LIST_H +#define __LIBRETRO_SDK_STRING_LIST_H + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +union string_list_elem_attr +{ + bool b; + int i; + void *p; +}; + +struct string_list_elem +{ + char *data; + union string_list_elem_attr attr; +}; + +struct string_list +{ + struct string_list_elem *elems; + size_t size; + size_t cap; +}; + +bool string_list_find_elem(const struct string_list *list, const char *elem); + +bool string_list_find_elem_prefix(const struct string_list *list, + const char *prefix, const char *elem); + +struct string_list *string_split(const char *str, const char *delim); + +struct string_list *string_list_new(void); + +bool string_list_append(struct string_list *list, const char *elem, + union string_list_elem_attr attr); + +void string_list_free(struct string_list *list); + +void string_list_join_concat(char *buffer, size_t size, + const struct string_list *list, const char *sep); + +void string_list_set(struct string_list *list, unsigned idx, + const char *str); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/string_list.c b/libretro-sdk/string/string_list.c similarity index 70% rename from string_list.c rename to libretro-sdk/string/string_list.c index 587166bea0..14654d6035 100644 --- a/string_list.c +++ b/libretro-sdk/string/string_list.c @@ -1,22 +1,28 @@ -/* 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 (string_list.c). + * --------------------------------------------------------------------------------------- * - * You should have received a copy of the GNU General Public License along with RetroArch. - * If not, see . + * 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. */ #include #include -#include "string_list.h" +#include #include #include #include diff --git a/string_list.h b/string_list.h deleted file mode 100644 index efcfc43f76..0000000000 --- a/string_list.h +++ /dev/null @@ -1,72 +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 . - */ - -#ifndef __RARCH_STRING_LIST_H -#define __RARCH_STRING_LIST_H - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -union string_list_elem_attr -{ - bool b; - int i; - void *p; -}; - -struct string_list_elem -{ - char *data; - union string_list_elem_attr attr; -}; - -struct string_list -{ - struct string_list_elem *elems; - size_t size; - size_t cap; -}; - -bool string_list_find_elem(const struct string_list *list, const char *elem); - -bool string_list_find_elem_prefix(const struct string_list *list, - const char *prefix, const char *elem); - -struct string_list *string_split(const char *str, const char *delim); - -struct string_list *string_list_new(void); - -bool string_list_append(struct string_list *list, const char *elem, - union string_list_elem_attr attr); - -void string_list_free(struct string_list *list); - -void string_list_join_concat(char *buffer, size_t size, - const struct string_list *list, const char *sep); - -void string_list_set(struct string_list *list, unsigned idx, - const char *str); - -#ifdef __cplusplus -} -#endif - -#endif