LDFLAGS += `pkg-config --libs glib-2.0 libosso dbus-1 hildon-fm-2`
endif
ifeq "$(PLATFORM)" "libretro"
+OBJS += libretro-common/compat/fopen_utf8.o
OBJS += frontend/libretro.o
CFLAGS += -Ilibretro-common/include
CFLAGS += -DFRONTEND_SUPPORTS_RGB565
#include "revision.h"
#include <libretro.h>
+#include <compat/fopen_utf8.h>
#include "libretro_core_options.h"
#ifdef _3DS
{
char line[1024];
char name[PATH_MAX];
- FILE *f = fopen(file, "r");
+ FILE *f = fopen_utf8(file, "r");
if (!f)
return false;
long size;
const char *name;
- f = fopen(path, "rb");
+ f = fopen_utf8(path, "rb");
if (f == NULL)
return false;
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
***************************************************************************/
+#include <compat/fopen_utf8.h>
+
#include "psxcommon.h"
#include "plugins.h"
#include "cdrom.h"
return -1;
}
- if ((fi = fopen(tocname, "r")) == NULL) {
+ if ((fi = fopen_utf8(tocname, "r")) == NULL) {
// try changing extension to .cue (to satisfy some stupid tutorials)
strcpy(tocname + strlen(tocname) - 4, ".cue");
- if ((fi = fopen(tocname, "r")) == NULL) {
+ if ((fi = fopen_utf8(tocname, "r")) == NULL) {
// if filename is image.toc.bin, try removing .bin (for Brasero)
strcpy(tocname, isofile);
t = strlen(tocname);
if (t >= 8 && strcmp(tocname + t - 8, ".toc.bin") == 0) {
tocname[t - 4] = '\0';
- if ((fi = fopen(tocname, "r")) == NULL) {
+ if ((fi = fopen_utf8(tocname, "r")) == NULL) {
return -1;
}
}
return -1;
}
- if ((fi = fopen(cuename, "r")) == NULL) {
+ if ((fi = fopen_utf8(cuename, "r")) == NULL) {
return -1;
}
else
tmp = tmpb;
strncpy(incue_fname, tmp, incue_max_len);
- ti[numtracks + 1].handle = fopen(filepath, "rb");
+ ti[numtracks + 1].handle = fopen_utf8(filepath, "rb");
// update global offset if this is not first file in this .cue
if (numtracks + 1 > 1) {
strncasecmp(isofile + strlen(isofile) - 4, ".cd", 3) == 0)) {
// user selected .cue/.cdX as image file, use it's data track instead
fclose(cdHandle);
- cdHandle = fopen(filepath, "rb");
+ cdHandle = fopen_utf8(filepath, "rb");
}
}
}
return -1;
}
- if ((fi = fopen(ccdname, "r")) == NULL) {
+ if ((fi = fopen_utf8(ccdname, "r")) == NULL) {
return -1;
}
return -1;
}
- if ((fi = fopen(mdsname, "rb")) == NULL) {
+ if ((fi = fopen_utf8(mdsname, "rb")) == NULL) {
return -1;
}
return -1;
}
- subHandle = fopen(subname, "rb");
+ subHandle = fopen_utf8(subname, "rb");
if (subHandle == NULL) {
return -1;
}
return 0; // it's already open
}
- cdHandle = fopen(GetIsoFile(), "rb");
+ cdHandle = fopen_utf8(GetIsoFile(), "rb");
if (cdHandle == NULL) {
SysPrintf(_("Could't open '%s' for reading: %s\n"),
GetIsoFile(), strerror(errno));
p = alt_bin_filename + strlen(alt_bin_filename) - 4;
for (i = 0; i < sizeof(exts) / sizeof(exts[0]); i++) {
strcpy(p, exts[i]);
- tmpf = fopen(alt_bin_filename, "rb");
+ tmpf = fopen_utf8(alt_bin_filename, "rb");
if (tmpf != NULL)
break;
}
// make sure we have another handle open for cdda
if (numtracks > 1 && ti[1].handle == NULL) {
- ti[1].handle = fopen(bin_filename, "rb");
+ ti[1].handle = fopen_utf8(bin_filename, "rb");
}
cdda_cur_sector = 0;
cdda_file_offset = 0;
// TODO: Implement caches & cycle penalty.
+#include <compat/fopen_utf8.h>
+
#include "psxmem.h"
#include "psxmem_map.h"
#include "r3000a.h"
if (strcmp(Config.Bios, "HLE") != 0) {
sprintf(bios, "%s/%s", Config.BiosDir, Config.Bios);
- f = fopen(bios, "rb");
+ f = fopen_utf8(bios, "rb");
if (f == NULL) {
SysMessage(_("Could not open BIOS:\"%s\". Enabling HLE Bios!\n"), bios);
* 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307 USA. *
***************************************************************************/
+#include <compat/fopen_utf8.h>
+
/*
* SIO functions.
*/
if (*str == 0)
return;
- f = fopen(str, "rb");
+ f = fopen_utf8(str, "rb");
if (f == NULL) {
SysPrintf(_("The memory card %s doesn't exist - creating it\n"), str);
CreateMcd(str);
- f = fopen(str, "rb");
+ f = fopen_utf8(str, "rb");
if (f != NULL) {
struct stat buf;
if (mcd == NULL || *mcd == 0 || strcmp(mcd, "none") == 0)
return;
- f = fopen(mcd, "r+b");
+ f = fopen_utf8(mcd, "r+b");
if (f != NULL) {
struct stat buf;
int s = MCD_SIZE;
int i = 0, j;
- f = fopen(mcd, "wb");
+ f = fopen_utf8(mcd, "wb");
if (f == NULL)
return;
--- /dev/null
+/* Copyright (C) 2010-2020 The RetroArch team
+ *
+ * ---------------------------------------------------------------------------------------
+ * The following license statement only applies to this file (fopen_utf8.c).
+ * ---------------------------------------------------------------------------------------
+ *
+ * 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 <compat/fopen_utf8.h>
+#include <encodings/utf.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#if defined(_WIN32_WINNT) && _WIN32_WINNT < 0x0500 || defined(_XBOX)
+#ifndef LEGACY_WIN32
+#define LEGACY_WIN32
+#endif
+#endif
+
+#ifdef _WIN32
+#undef fopen
+
+void *fopen_utf8(const char * filename, const char * mode)
+{
+#if defined(LEGACY_WIN32)
+ FILE *ret = NULL;
+ char * filename_local = utf8_to_local_string_alloc(filename);
+
+ if (!filename_local)
+ return NULL;
+ ret = fopen(filename_local, mode);
+ if (filename_local)
+ free(filename_local);
+ return ret;
+#else
+ wchar_t * filename_w = utf8_to_utf16_string_alloc(filename);
+ wchar_t * mode_w = utf8_to_utf16_string_alloc(mode);
+ FILE* ret = NULL;
+
+ if (filename_w && mode_w)
+ ret = _wfopen(filename_w, mode_w);
+ if (filename_w)
+ free(filename_w);
+ if (mode_w)
+ free(mode_w);
+ return ret;
+#endif
+}
+#endif
--- /dev/null
+/* Copyright (C) 2010-2020 The RetroArch team
+ *
+ * ---------------------------------------------------------------------------------------
+ * The following license statement only applies to this file (boolean.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_BOOLEAN_H
+#define __LIBRETRO_SDK_BOOLEAN_H
+
+#ifndef __cplusplus
+
+#if defined(_MSC_VER) && _MSC_VER < 1800 && !defined(SN_TARGET_PS3)
+/* Hack applied for MSVC when compiling in C89 mode as it isn't C99 compliant. */
+#define bool unsigned char
+#define true 1
+#define false 0
+#else
+#include <stdbool.h>
+#endif
+
+#endif
+
+#endif
--- /dev/null
+/* Copyright (C) 2010-2020 The RetroArch team
+ *
+ * ---------------------------------------------------------------------------------------
+ * The following license statement only applies to this file (fopen_utf8.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_COMPAT_FOPEN_UTF8_H
+#define __LIBRETRO_SDK_COMPAT_FOPEN_UTF8_H
+
+#ifdef _WIN32
+/* Defined to error rather than fopen_utf8, to make it clear to everyone reading the code that not worrying about utf16 is fine */
+/* TODO: enable */
+/* #define fopen (use fopen_utf8 instead) */
+void *fopen_utf8(const char * filename, const char * mode);
+#else
+#define fopen_utf8 fopen
+#endif
+#endif
--- /dev/null
+/* Copyright (C) 2010-2020 The RetroArch team
+ *
+ * ---------------------------------------------------------------------------------------
+ * The following license statement only applies to this file (utf.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_ENCODINGS_UTF_H
+#define _LIBRETRO_ENCODINGS_UTF_H
+
+#include <stdint.h>
+#include <stddef.h>
+
+#include <boolean.h>
+
+#include <retro_common_api.h>
+
+RETRO_BEGIN_DECLS
+
+enum CodePage
+{
+ CODEPAGE_LOCAL = 0, /* CP_ACP */
+ CODEPAGE_UTF8 = 65001 /* CP_UTF8 */
+};
+
+size_t utf8_conv_utf32(uint32_t *out, size_t out_chars,
+ const char *in, size_t in_size);
+
+bool utf16_conv_utf8(uint8_t *out, size_t *out_chars,
+ const uint16_t *in, size_t in_size);
+
+size_t utf8len(const char *string);
+
+size_t utf8cpy(char *d, size_t d_len, const char *s, size_t chars);
+
+const char *utf8skip(const char *str, size_t chars);
+
+uint32_t utf8_walk(const char **string);
+
+bool utf16_to_char_string(const uint16_t *in, char *s, size_t len);
+
+char* utf8_to_local_string_alloc(const char *str);
+
+char* local_to_utf8_string_alloc(const char *str);
+
+wchar_t* utf8_to_utf16_string_alloc(const char *str);
+
+char* utf16_to_utf8_string_alloc(const wchar_t *str);
+
+RETRO_END_DECLS
+
+#endif
RETRO_LANGUAGE_GREEK = 17,
RETRO_LANGUAGE_TURKISH = 18,
RETRO_LANGUAGE_SLOVAK = 19,
+ RETRO_LANGUAGE_PERSIAN = 20,
+ RETRO_LANGUAGE_HEBREW = 21,
+ RETRO_LANGUAGE_ASTURIAN = 22,
+ RETRO_LANGUAGE_FINNISH = 23,
RETRO_LANGUAGE_LAST,
/* Ensure sizeof(enum) == sizeof(int) */
* state of rumble motors in controllers.
* A strong and weak motor is supported, and they can be
* controlled indepedently.
+ * Should be called from either retro_init() or retro_load_game().
+ * Should not be called from retro_set_environment().
+ * Returns false if rumble functionality is unavailable.
*/
#define RETRO_ENVIRONMENT_GET_INPUT_DEVICE_CAPABILITIES 24
/* uint64_t * --
* fallback, stderr).
*/
+#define RETRO_ENVIRONMENT_GET_INPUT_MAX_USERS 61
+ /* unsigned * --
+ * Unsigned value is the number of active input devices
+ * provided by the frontend. This may change between
+ * frames, but will remain constant for the duration
+ * of each frame.
+ * If callback returns true, a core need not poll any
+ * input device with an index greater than or equal to
+ * the number of active devices.
+ * If callback returns false, the number of active input
+ * devices is unknown. In this case, all input devices
+ * should be considered active.
+ */
+
+#define RETRO_ENVIRONMENT_SET_AUDIO_BUFFER_STATUS_CALLBACK 62
+ /* const struct retro_audio_buffer_status_callback * --
+ * Lets the core know the occupancy level of the frontend
+ * audio buffer. Can be used by a core to attempt frame
+ * skipping in order to avoid buffer under-runs.
+ * A core may pass NULL to disable buffer status reporting
+ * in the frontend.
+ */
+
+#define RETRO_ENVIRONMENT_SET_MINIMUM_AUDIO_LATENCY 63
+ /* const unsigned * --
+ * Sets minimum frontend audio latency in milliseconds.
+ * Resultant audio latency may be larger than set value,
+ * or smaller if a hardware limit is encountered. A frontend
+ * is expected to honour requests up to 512 ms.
+ *
+ * - If value is less than current frontend
+ * audio latency, callback has no effect
+ * - If value is zero, default frontend audio
+ * latency is set
+ *
+ * May be used by a core to increase audio latency and
+ * therefore decrease the probability of buffer under-runs
+ * (crackling) when performing 'intensive' operations.
+ * A core utilising RETRO_ENVIRONMENT_SET_AUDIO_BUFFER_STATUS_CALLBACK
+ * to implement audio-buffer-based frame skipping may achieve
+ * optimal results by setting the audio latency to a 'high'
+ * (typically 6x or 8x) integer multiple of the expected
+ * frame time.
+ *
+ * WARNING: This can only be called from within retro_run().
+ * Calling this can require a full reinitialization of audio
+ * drivers in the frontend, so it is important to call it very
+ * sparingly, and usually only with the users explicit consent.
+ * An eventual driver reinitialize will happen so that audio
+ * callbacks happening after this call within the same retro_run()
+ * call will target the newly initialized driver.
+ */
+
/* VFS functionality */
/* File paths:
retro_usec_t reference;
};
+/* Notifies a libretro core of the current occupancy
+ * level of the frontend audio buffer.
+ *
+ * - active: 'true' if audio buffer is currently
+ * in use. Will be 'false' if audio is
+ * disabled in the frontend
+ *
+ * - occupancy: Given as a value in the range [0,100],
+ * corresponding to the occupancy percentage
+ * of the audio buffer
+ *
+ * - underrun_likely: 'true' if the frontend expects an
+ * audio buffer underrun during the
+ * next frame (indicates that a core
+ * should attempt frame skipping)
+ *
+ * It will be called right before retro_run() every frame. */
+typedef void (RETRO_CALLCONV *retro_audio_buffer_status_callback_t)(
+ bool active, unsigned occupancy, bool underrun_likely);
+struct retro_audio_buffer_status_callback
+{
+ retro_audio_buffer_status_callback_t callback;
+};
+
/* Pass this to retro_video_refresh_t if rendering to hardware.
* Passing NULL to retro_video_refresh_t is still a frame dupe as normal.
* */
struct retro_system_info
{
/* All pointers are owned by libretro implementation, and pointers must
- * remain valid until retro_deinit() is called. */
+ * remain valid until it is unloaded. */
const char *library_name; /* Descriptive name of library. Should not
* contain any version numbers, etc. */
--- /dev/null
+/* Copyright (C) 2010-2020 The RetroArch team
+ *
+ * ---------------------------------------------------------------------------------------
+ * The following license statement only applies to this file (retro_common_api.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_COMMON_RETRO_COMMON_API_H
+#define _LIBRETRO_COMMON_RETRO_COMMON_API_H
+
+/*
+This file is designed to normalize the libretro-common compiling environment
+for public API headers. This should be leaner than a normal compiling environment,
+since it gets #included into other project's sources.
+*/
+
+/* ------------------------------------ */
+
+/*
+Ordinarily we want to put #ifdef __cplusplus extern "C" in C library
+headers to enable them to get used by c++ sources.
+However, we want to support building this library as C++ as well, so a
+special technique is called for.
+*/
+
+#define RETRO_BEGIN_DECLS
+#define RETRO_END_DECLS
+
+#ifdef __cplusplus
+
+#ifdef CXX_BUILD
+/* build wants everything to be built as c++, so no extern "C" */
+#else
+#undef RETRO_BEGIN_DECLS
+#undef RETRO_END_DECLS
+#define RETRO_BEGIN_DECLS extern "C" {
+#define RETRO_END_DECLS }
+#endif
+
+#else
+
+/* header is included by a C source file, so no extern "C" */
+
+#endif
+
+/*
+IMO, this non-standard ssize_t should not be used.
+However, it's a good example of how to handle something like this.
+*/
+#ifdef _MSC_VER
+#ifndef HAVE_SSIZE_T
+#define HAVE_SSIZE_T
+#if defined(_WIN64)
+typedef __int64 ssize_t;
+#elif defined(_WIN32)
+typedef int ssize_t;
+#endif
+#endif
+#elif defined(__MACH__)
+#include <sys/types.h>
+#endif
+
+#ifdef _MSC_VER
+#if _MSC_VER >= 1800
+#include <inttypes.h>
+#else
+#ifndef PRId64
+#define PRId64 "I64d"
+#define PRIu64 "I64u"
+#define PRIuPTR "Iu"
+#endif
+#endif
+#else
+/* C++11 says this one isn't needed, but apparently (some versions of) mingw require it anyways */
+/* https://stackoverflow.com/questions/8132399/how-to-printf-uint64-t-fails-with-spurious-trailing-in-format */
+/* https://github.com/libretro/RetroArch/issues/6009 */
+#ifndef __STDC_FORMAT_MACROS
+#define __STDC_FORMAT_MACROS 1
+#endif
+#include <inttypes.h>
+#endif
+#ifndef PRId64
+#error "inttypes.h is being screwy"
+#endif
+#define STRING_REP_INT64 "%" PRId64
+#define STRING_REP_UINT64 "%" PRIu64
+#define STRING_REP_USIZE "%" PRIuPTR
+
+/*
+I would like to see retro_inline.h moved in here; possibly boolean too.
+
+rationale: these are used in public APIs, and it is easier to find problems
+and write code that works the first time portably when theyre included uniformly
+than to do the analysis from scratch each time you think you need it, for each feature.
+
+Moreover it helps force you to make hard decisions: if you EVER bring in boolean.h,
+then you should pay the price everywhere, so you can see how much grief it will cause.
+
+Of course, another school of thought is that you should do as little damage as possible
+in as few places as possible...
+*/
+
+/* _LIBRETRO_COMMON_RETRO_COMMON_API_H */
+#endif
-/* Copyright (C) 2010-2018 The RetroArch team
+/* Copyright (C) 2010-2020 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (retro_inline.h).
* See the COPYING file in the top-level directory.
*/
+#include <compat/fopen_utf8.h>
+
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int i, ret;
FILE *f;
- f = fopen(cd_fname, "rb");
+ f = fopen_utf8(cd_fname, "rb");
if (f == NULL) {
err("missing file: %s: ", cd_fname);
perror(NULL);
return -1;
}
- f = fopen(table_fname, "rb");
+ f = fopen_utf8(table_fname, "rb");
if (f == NULL) {
err("missing file: %s: ", table_fname);
perror(NULL);
break;
}
- cd_file = fopen(cd_fname, "rb");
+ cd_file = fopen_utf8(cd_fname, "rb");
if (cd_file == NULL) {
err("failed to open: %s: ", table_fname);
perror(NULL);