mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-26 12:27:44 +00:00
Updated source to match SDL function prototype style
This commit is contained in:
@@ -32,16 +32,14 @@
|
||||
#include "SDL_system.h"
|
||||
|
||||
|
||||
char *
|
||||
SDL_GetBasePath(void)
|
||||
char *SDL_GetBasePath(void)
|
||||
{
|
||||
/* The current working directory is / on Android */
|
||||
SDL_Unsupported();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char *
|
||||
SDL_GetPrefPath(const char *org, const char *app)
|
||||
char *SDL_GetPrefPath(const char *org, const char *app)
|
||||
{
|
||||
const char *path = SDL_AndroidGetInternalStoragePath();
|
||||
if (path) {
|
||||
|
||||
@@ -33,8 +33,7 @@
|
||||
#include "SDL_stdinc.h"
|
||||
#include "SDL_filesystem.h"
|
||||
|
||||
char *
|
||||
SDL_GetBasePath(void)
|
||||
char *SDL_GetBasePath(void)
|
||||
{
|
||||
@autoreleasepool {
|
||||
NSBundle *bundle = [NSBundle mainBundle];
|
||||
@@ -68,8 +67,7 @@ SDL_GetBasePath(void)
|
||||
}
|
||||
}
|
||||
|
||||
char *
|
||||
SDL_GetPrefPath(const char *org, const char *app)
|
||||
char *SDL_GetPrefPath(const char *org, const char *app)
|
||||
{
|
||||
@autoreleasepool {
|
||||
char *retval = NULL;
|
||||
|
||||
@@ -28,15 +28,13 @@
|
||||
#include "SDL_error.h"
|
||||
#include "SDL_filesystem.h"
|
||||
|
||||
char *
|
||||
SDL_GetBasePath(void)
|
||||
char *SDL_GetBasePath(void)
|
||||
{
|
||||
SDL_Unsupported();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char *
|
||||
SDL_GetPrefPath(const char *org, const char *app)
|
||||
char *SDL_GetPrefPath(const char *org, const char *app)
|
||||
{
|
||||
SDL_Unsupported();
|
||||
return NULL;
|
||||
|
||||
@@ -32,15 +32,13 @@
|
||||
|
||||
#include <emscripten/emscripten.h>
|
||||
|
||||
char *
|
||||
SDL_GetBasePath(void)
|
||||
char *SDL_GetBasePath(void)
|
||||
{
|
||||
char *retval = "/";
|
||||
return SDL_strdup(retval);
|
||||
}
|
||||
|
||||
char *
|
||||
SDL_GetPrefPath(const char *org, const char *app)
|
||||
char *SDL_GetPrefPath(const char *org, const char *app)
|
||||
{
|
||||
const char *append = "/libsdl/";
|
||||
char *retval;
|
||||
|
||||
@@ -34,8 +34,7 @@
|
||||
#include "SDL_stdinc.h"
|
||||
#include "SDL_filesystem.h"
|
||||
|
||||
char *
|
||||
SDL_GetBasePath(void)
|
||||
char *SDL_GetBasePath(void)
|
||||
{
|
||||
image_info info;
|
||||
int32 cookie = 0;
|
||||
@@ -69,8 +68,7 @@ SDL_GetBasePath(void)
|
||||
}
|
||||
|
||||
|
||||
char *
|
||||
SDL_GetPrefPath(const char *org, const char *app)
|
||||
char *SDL_GetPrefPath(const char *org, const char *app)
|
||||
{
|
||||
// !!! FIXME: is there a better way to do this?
|
||||
const char *home = SDL_getenv("HOME");
|
||||
|
||||
@@ -35,15 +35,13 @@
|
||||
SDL_FORCE_INLINE char *MakePrefPath(const char *app);
|
||||
SDL_FORCE_INLINE int CreatePrefPathDir(const char *pref);
|
||||
|
||||
char *
|
||||
SDL_GetBasePath(void)
|
||||
char *SDL_GetBasePath(void)
|
||||
{
|
||||
char *base_path = SDL_strdup("romfs:/");
|
||||
return base_path;
|
||||
}
|
||||
|
||||
char *
|
||||
SDL_GetPrefPath(const char *org, const char *app)
|
||||
char *SDL_GetPrefPath(const char *org, const char *app)
|
||||
{
|
||||
char *pref_path = NULL;
|
||||
if (app == NULL) {
|
||||
|
||||
@@ -24,15 +24,13 @@
|
||||
|
||||
#ifdef SDL_FILESYSTEM_NACL
|
||||
|
||||
char *
|
||||
SDL_GetBasePath(void)
|
||||
char *SDL_GetBasePath(void)
|
||||
{
|
||||
SDL_Unsupported();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char *
|
||||
SDL_GetPrefPath(const char *org, const char *app)
|
||||
char *SDL_GetPrefPath(const char *org, const char *app)
|
||||
{
|
||||
SDL_Unsupported();
|
||||
return NULL;
|
||||
|
||||
@@ -36,8 +36,7 @@
|
||||
#include <os2.h>
|
||||
|
||||
|
||||
char *
|
||||
SDL_GetBasePath(void)
|
||||
char *SDL_GetBasePath(void)
|
||||
{
|
||||
PTIB tib;
|
||||
PPIB pib;
|
||||
@@ -71,8 +70,7 @@ SDL_GetBasePath(void)
|
||||
return OS2_SysToUTF8(acBuf);
|
||||
}
|
||||
|
||||
char *
|
||||
SDL_GetPrefPath(const char *org, const char *app)
|
||||
char *SDL_GetPrefPath(const char *org, const char *app)
|
||||
{
|
||||
PSZ pszPath;
|
||||
CHAR acBuf[CCHMAXPATH];
|
||||
|
||||
@@ -31,8 +31,7 @@
|
||||
#include "SDL_error.h"
|
||||
#include "SDL_filesystem.h"
|
||||
|
||||
char *
|
||||
SDL_GetBasePath(void)
|
||||
char *SDL_GetBasePath(void)
|
||||
{
|
||||
char *retval;
|
||||
size_t len;
|
||||
@@ -78,8 +77,7 @@ static void recursive_mkdir(const char *dir)
|
||||
mkdir(tmp, S_IRWXU);
|
||||
}
|
||||
|
||||
char *
|
||||
SDL_GetPrefPath(const char *org, const char *app)
|
||||
char *SDL_GetPrefPath(const char *org, const char *app)
|
||||
{
|
||||
char *retval = NULL;
|
||||
size_t len;
|
||||
|
||||
@@ -31,8 +31,7 @@
|
||||
#include "SDL_error.h"
|
||||
#include "SDL_filesystem.h"
|
||||
|
||||
char *
|
||||
SDL_GetBasePath(void)
|
||||
char *SDL_GetBasePath(void)
|
||||
{
|
||||
char *retval = NULL;
|
||||
size_t len;
|
||||
@@ -46,8 +45,7 @@ SDL_GetBasePath(void)
|
||||
return retval;
|
||||
}
|
||||
|
||||
char *
|
||||
SDL_GetPrefPath(const char *org, const char *app)
|
||||
char *SDL_GetPrefPath(const char *org, const char *app)
|
||||
{
|
||||
char *retval = NULL;
|
||||
size_t len;
|
||||
|
||||
@@ -129,8 +129,7 @@ static _kernel_oserror *createDirectoryRecursive(char *path)
|
||||
return _kernel_swi(OS_File, ®s, ®s);
|
||||
}
|
||||
|
||||
char *
|
||||
SDL_GetBasePath(void)
|
||||
char *SDL_GetBasePath(void)
|
||||
{
|
||||
_kernel_swi_regs regs;
|
||||
_kernel_oserror *error;
|
||||
@@ -157,8 +156,7 @@ SDL_GetBasePath(void)
|
||||
return retval;
|
||||
}
|
||||
|
||||
char *
|
||||
SDL_GetPrefPath(const char *org, const char *app)
|
||||
char *SDL_GetPrefPath(const char *org, const char *app)
|
||||
{
|
||||
char *canon, *dir, *retval;
|
||||
size_t len;
|
||||
|
||||
@@ -45,8 +45,7 @@
|
||||
|
||||
/* QNX's /proc/self/exefile is a text file and not a symlink. */
|
||||
#if !defined(__QNXNTO__)
|
||||
static char *
|
||||
readSymLink(const char *path)
|
||||
static char *readSymLink(const char *path)
|
||||
{
|
||||
char *retval = NULL;
|
||||
ssize_t len = 64;
|
||||
@@ -129,8 +128,7 @@ static char *search_path_for_binary(const char *bin)
|
||||
}
|
||||
#endif
|
||||
|
||||
char *
|
||||
SDL_GetBasePath(void)
|
||||
char *SDL_GetBasePath(void)
|
||||
{
|
||||
char *retval = NULL;
|
||||
|
||||
@@ -271,8 +269,7 @@ SDL_GetBasePath(void)
|
||||
return retval;
|
||||
}
|
||||
|
||||
char *
|
||||
SDL_GetPrefPath(const char *org, const char *app)
|
||||
char *SDL_GetPrefPath(const char *org, const char *app)
|
||||
{
|
||||
/*
|
||||
* We use XDG's base directory spec, even if you're not on Linux.
|
||||
|
||||
@@ -39,16 +39,14 @@
|
||||
#include "SDL_filesystem.h"
|
||||
#include "SDL_rwops.h"
|
||||
|
||||
char *
|
||||
SDL_GetBasePath(void)
|
||||
char *SDL_GetBasePath(void)
|
||||
{
|
||||
const char *basepath = "app0:/";
|
||||
char *retval = SDL_strdup(basepath);
|
||||
return retval;
|
||||
}
|
||||
|
||||
char *
|
||||
SDL_GetPrefPath(const char *org, const char *app)
|
||||
char *SDL_GetPrefPath(const char *org, const char *app)
|
||||
{
|
||||
const char *envr = "ux0:/data/";
|
||||
char *retval = NULL;
|
||||
|
||||
@@ -32,8 +32,7 @@
|
||||
#include "SDL_stdinc.h"
|
||||
#include "SDL_filesystem.h"
|
||||
|
||||
char *
|
||||
SDL_GetBasePath(void)
|
||||
char *SDL_GetBasePath(void)
|
||||
{
|
||||
DWORD buflen = 128;
|
||||
WCHAR *path = NULL;
|
||||
@@ -83,8 +82,7 @@ SDL_GetBasePath(void)
|
||||
return retval;
|
||||
}
|
||||
|
||||
char *
|
||||
SDL_GetPrefPath(const char *org, const char *app)
|
||||
char *SDL_GetPrefPath(const char *org, const char *app)
|
||||
{
|
||||
/*
|
||||
* Vista and later has a new API for this, but SHGetFolderPath works there,
|
||||
@@ -175,15 +173,13 @@ SDL_GetPrefPath(const char *org, const char *app)
|
||||
#ifdef SDL_FILESYSTEM_XBOX
|
||||
#include "SDL_filesystem.h"
|
||||
#include "SDL_error.h"
|
||||
char *
|
||||
SDL_GetBasePath(void)
|
||||
char *SDL_GetBasePath(void)
|
||||
{
|
||||
SDL_Unsupported();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char *
|
||||
SDL_GetPrefPath(const char *org, const char *app)
|
||||
char *SDL_GetPrefPath(const char *org, const char *app)
|
||||
{
|
||||
SDL_Unsupported();
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user