src/filesystem


Log

Author Commit Date CI Message
Cameron Cawley 9ee6942e 2021-09-22T14:01:00 Improve RISC OS implementations of SDL_GetBasePath and SDL_GetPrefPath
Cameron Cawley 3db898c5 2020-02-13T22:32:35 riscos: Implement SDL_GetPrefPath()
Sam Lantinga 345c161f 2021-09-22T09:06:45 Fixed some accidental uses of external C runtime functions
Phillip Trudeau bc7ac134 2021-06-11T09:22:41 Windows: Fix SDL_GetBasePath() truncating paths SDL_GetBasePath grows its path buffer for long paths, but GetModuleFileNameExW always truncates and succeeds, so `len` was always equal to (buflen - 1) which is 127. This is easily fixed by checking for (buflen - 1) instead of buflen. For paths longer than MAX_PATH, this problem sometimes got hidden by Windows path shortening ("C:\PROGRA~1\" etc.). Tested on Windows 10 x64 19041 and 10586.
Ryan C. Gordon 03503423 2021-04-19T23:31:23 filesystem: Better OpenBSD support for SDL_GetBasePath(). Fixes #3752.
Ivan Epifanov e58a955e 2021-03-08T18:39:00 Deprecate dolcesdk
Ivan Epifanov ca5e5d61 2020-12-18T16:34:24 VITASDK compatibility
Ivan Epifanov 194c8138 2020-11-02T19:55:01 Fix filesystem
Ivan Epifanov 41d6c80b 2020-11-02T19:01:25 Filesystem module
Cameron Cawley 391bb80b 2021-03-05T16:53:06 Replace duplicate functions and lstrlen/lstrcat with SDL string functions
Charlie Birks 1a48ca66 2021-02-04T16:20:54 emscripten: Create directory recursively in GetPrefPath
Ozkan Sezer 265a1cc9 2021-01-05T15:50:02 use WIN_StringToUTF8W instead of WIN_StringToUTF8 where needed (#2) cf. bug #5435. - SDL_wasapi_win32.c (GetWasapiDeviceName): pwszVal is WCHAR* - windows/SDL_sysfilesystem.c (SDL_GetBasePath, SDL_GetPrefPath) - windows/SDL_sysurl.c (SDL_SYS_OpenURL): wurl is WCHAR* - SDL_windowssensor.c (ConnectSensor): bstr_name is WCHAR* - windows/SDL_systhread.c (SDL_SYS_SetupThread): strw is WCHAR*
Ozkan Sezer 01a2f276 2021-01-04T01:23:50 consistently use TEXT() macro with LoadLibrary() and GetModuleHandle() cf. bug #5435.
Sam Lantinga 9130f7c3 2021-01-02T10:25:38 Updated copyright for 2021
Ethan Lee f1c7cc71 2020-12-14T12:36:04 winrt: Buildfix for older UWP SDKs
Ethan Lee 169cfe5a 2020-12-14T11:52:09 winrt: EffectiveLocation still needs an ifdef, IsApiContractPresent is for runtime
Sam Lantinga cb361896 2020-12-09T07:16:22 Fixed bug 5235 - All internal sources should include SDL_assert.h Ryan C. Gordon We should really stick this in SDL_internal.h or something so it's always available.
Ethan Lee a7d91eba 2020-11-09T17:05:21 winrt: Add EffectiveLocation support for newer Win10 releases
Ozkan Sezer a90f0400 2020-10-15T21:37:30 os2: a _lot_ of coding style cleanup, sot that they match the SDL style. also renamed the 'debug' macro to debug_os2: the former was dangerously a common name. the binary (dll) output is precisely the same as before.
Ozkan Sezer 1d9cf23e 2020-10-14T23:01:05 os2: updated copyright dates for 2020. header guard fixes.
Ozkan Sezer 5d89217f 2020-10-14T23:01:03 os2/SDL_sysfilesystem.c: fix crash if one of the parameters is NULL Has been happening with testfilesystem from 2.0.6 and newer because of commit 572a721879ef. Also set error strings in certain error conditions. Also applied coding style / whitespace fixes, while I was there.
Ozkan Sezer 5f3f67b1 2020-10-14T23:01:03 os2/SDL_sysfilesystem.c: use OS/2 api DosCreateDir() instead of mkdir(). mkdir() from watcom and emx differ - the latter being unix-ish, so this change avoids ifdefs.
Ozkan Sezer aa790837 2020-10-14T23:01:02 os2: several warning fixes. mostly those "W007: '&array' may not produce intended result" warnings from Watcom, visible only in C++ mode. one or two others here & there.
Ozkan Sezer 74cfb81d 2020-10-14T23:01:00 os2: add port files for SDL2-2.0.4 from Andrey Vasilkin only geniconv/iconv.h (was from LGPL libiconv) is replaced with a generic minimal iconv.h based on public knowledge.
Sam Lantinga b6afbe63 2020-04-07T09:38:57 Added SDL_log.h to SDL_internal.h so logging is available everywhere
Sam Lantinga a8780c6a 2020-01-16T20:49:25 Updated copyright date for 2020
Sylvain Becker b458d7a2 2019-10-30T15:13:55 Readability: remove redundant cast to the same type
Sam Lantinga e954e32b 2019-07-18T19:33:17 Fixed bug 4726 - Fix for tvOS GetPrefPath Caleb Cornett Unlike iOS and macOS, tvOS does not have any persistent local storage. In fact, the ApplicationSupport directory pointed to by the existing Cocoa GetPrefPath() throws an error whenever any attempt is made to access it. To get any local storage on an Apple TV, our only option is to use a temporary cache directory. This patch changes the tvOS PrefPath to this cache directory and also logs a critical warning that this if developers want their save data to persist across game sessions, they must use some form of iCloud storage.
Sam Lantinga 5e13087b 2019-01-04T22:01:14 Updated copyright for 2019
sezero 40b27fd5 2018-02-12T17:00:00 revert the recent typecast assignment changes (see bug #4079) also change the void* typedefs for the two vulkan function pointers added in vulkan_internal.h into generic function pointer typedefs.
Sam Lantinga 90e72bf4 2018-01-30T18:08:34 Fixed ISO C99 compatibility SDL now builds with gcc 7.2 with the following command line options: -Wall -pedantic-errors -Wno-deprecated-declarations -Wno-overlength-strings --std=c99
Sam Lantinga e3cc5b2c 2018-01-03T10:03:25 Updated copyright for 2018
Ryan C. Gordon 00905c98 2017-08-17T03:22:44 filesystem: Patched to compile on QNX.
Ryan C. Gordon e50d3cdf 2017-08-17T02:58:46 filesystem: QNX should use SDL_LoadFile() instead of rolling it from scratch.
Ryan C. Gordon c13c45c7 2017-08-17T01:25:48 qnx: Implemented SDL_GetBasePath().
Sam Lantinga 658975f3 2017-08-11T11:32:00 Fixed bug 3639 - SDL_GetPrefPath returns a path with two consecutive slashes on Unix if org is omitted Fabian Greffrath we use SDL_GetPrefPath() in Chocolate Doom to get a reasonable directory to save and restore config files and savegames: https://github.com/chocolate-doom/chocolate-doom/blob/sdl2-branch/src/m_config.c#L2162 However, since there is no "organization" behind Chocolate Doom and there is really only one "product" called Chocolate Doom, we pass an empty string for the org parameter and the package string for app. This leads to two consecutive slashes in the path returned by SDL_GetPrefPath() like this: /home/user/.local/share//chocolate-doom/ While this is harmless, it sure looks bad. I believe that it should be possible to either pass a NULL pointer for the org parameter or at least have the function detect an empty string as a means to express "there is no origanization, just a single product". The generation of the path string to be returned by the function will have to get adapted accordingly.
Philipp Wiesemann 84aeab17 2017-07-29T23:00:14 haiku: Changed header paths to be more compatible.
Philipp Wiesemann 6086e8d3 2017-06-17T22:30:09 haiku: Fixed missing slash in path from SDL_GetPrefPath().
Philipp Wiesemann 52b7d0eb 2017-06-04T23:15:27 android: Fixed missing error message for SDL_GetBasePath().
Philipp Wiesemann 3639895e 2017-05-27T23:30:07 Removed unused errno includes.
Sam Lantinga 45b774e3 2017-01-01T18:33:28 Updated copyright for 2017
Philipp Wiesemann 51053a06 2016-08-30T21:14:13 Fixed compiling if filesystem is disabled (thanks, Elias!). Fixes Bugzilla #3414.
Sam Lantinga 4249f466 2016-01-31T21:11:15 David Carlier implemented SDL_GetBasePath() for OpenBSD
Sam Lantinga 42065e78 2016-01-02T10:10:34 Updated copyright to 2016
Philipp Wiesemann 0e45984f 2015-06-21T17:33:46 Fixed crash if initialization of EGL failed but was tried again later. The internal function SDL_EGL_LoadLibrary() did not delete and remove a mostly uninitialized data structure if loading the library first failed. A later try to use EGL then skipped initialization and assumed it was previously successful because the data structure now already existed. This led to at least one crash in the internal function SDL_EGL_ChooseConfig() because a NULL pointer was dereferenced to make a call to eglBindAPI().
Ryan C. Gordon 4d1626d0 2015-05-28T15:36:27 Windows SDL_GetBasePath: free string on failure.
Ryan C. Gordon aa43bee4 2015-05-28T15:32:45 Windows GetBasePath: fixed reallocation code.
Ryan C. Gordon 566316e0 2015-05-28T15:29:43 Windows SDL_GetBasePath: Fixed wrong variable when growing the buffer size.
Sam Lantinga bccc2ad0 2015-05-28T12:06:48 Fixed compiling and tested on Windows
Ryan C. Gordon 6d1ad384 2015-05-28T01:54:52 Windows GetBasePath should use GetModuleFileNameExW() and check for overflows. Apparently you might get strange paths from GetModuleFileName(), such as short path names or UNC filenames, so this avoids that problem. Since you have to tapdance with linking different libraries and defining macros depending on what Windows you plan to target, we dynamically load the API we need, which works on all versions of Windows (on Win7, it'll load a compatibility wrapper for the newer API location). What a mess. This also now does the right thing if there isn't enough space to store the path, looping with a larger allocated buffer each try. Fixes Bugzilla #2435.
Sam Lantinga 2c4a6ea0 2015-05-26T06:27:46 Updated the copyright year to 2015
Ryan C. Gordon b72938c8 2015-04-20T12:22:44 Windows: Always set the system timer resolution to 1ms by default. An existing hint lets apps that don't need the timer resolution changed avoid this, to save battery, etc, but this fixes several problems in timing, audio callbacks not firing fast enough, etc. Fixes Bugzilla #2944.
Philipp Wiesemann 86fb92a7 2015-04-15T21:25:15 Emscripten: Fixed memory leak if SDL_GetPrefPath() failed.
Alex Szpakowski fe6c797c 2015-04-10T23:30:31 Fixed an iOS view orientation issue when SDL_GL_CreateContext or SDL_CreateRenderer is called.
Alex Szpakowski df98b11c 2015-04-06T15:26:37 Merged default into iOS-improvements
Edward Rudd b88ca1b4 2015-02-10T16:28:56 the last parameter of XChangeProperty is the number of elements.. and when the element format is 32.. the element is "long" so we have 5 long elements here. Yes this seems confusing as on mac+linux Long is either 32 or 64bits depending on the architecture, but this is how the X11 protocol is defined. Thus 5 is the correct value for the nelts here. Not 5 or 10 depending on the architecture. More info on the confusion https://bugs.freedesktop.org/show_bug.cgi?id=16802
Philipp Wiesemann 43500a78 2015-01-31T21:06:37 Fixed comment in implementation for NaCl.
Philipp Wiesemann b48e54aa 2015-01-26T22:00:29 Fixed bug 2802 - [patch] Fix android build compiling in wrong filesystem implementation Jonas Kulla The configure script didn't differentiate between Linux and Android, unconditionally compiling in the unix implementation of SDL_sysfilesystem.c. I'm probably one of the very few people building SDL for android using classic configure + standalone toolchain, so this has gone undetected all along.
Alex Szpakowski ea5d1a8a 2015-01-15T01:15:24 Merged default into iOS-improvements
Ryan C. Gordon fe40a172 2014-12-18T00:19:52 Initial merge of Emscripten port! With this commit, you can compile SDL2 with Emscripten ( http://emscripten.org/ ), and make your SDL-based C/C++ program into a web app. This port was due to the efforts of several people, including: Charlie Birks, Sathyanarayanan Gunasekaran, Jukka Jyl?nki, Alon Zakai, Edward Rudd, Bruce Mitchener, and Martin Gerhardy. (Thanks, everyone!)
David Ludwig 70438be2 2014-12-03T10:55:23 WinRT: fixed bug whereby SDL would override an app's default orientation WinRT apps can set a default, preferred orientation via a .appxmanifest file. SDL was overriding this on app startup, and making the app use all possible orientations (landscape and portrait). Thanks to Eric Wing for the heads up on this!
David Ludwig 5fee84f2 2014-12-02T21:18:50 WinRT: removed SDL_HINT_WINRT_PREF_PATH_ROOT (introduced post-2.0.3 & pre-2.0.4) A WinRT app's Roaming folder-path can still be retrieved via calls to SDL_WinRTGetFSPathUTF8() or SDL_WinRTGetFSPathUNICODE(), if need be.
Alex Szpakowski cc0631a0 2014-12-02T02:52:45 Merged default into iOS-improvements
David Ludwig ce64b4ad 2014-11-29T10:09:30 WinRT: bug and data-integrity fixes for SDL_GetPrefPath() This change does a few things, all with regards to the WinRT implementation of SDL_GetPrefPath(): 1. it fixes a bug whereby SDL_GetPrefPath() did not create the directory it returned. On other SDL platforms, SDL_GetPrefPath() will create separate directories for its 'org' and 'app' folders. Without this, attempts to create files in the pref-path would fail, unless those directories were first created by the app, or by some other library the app used. This change makes sure that these directories get created, before SDL_GetPrefPath() returns to its caller(s). 2. it defaults to having SDL_GetPrefPath() return a WinRT 'Local' folder on all platforms. Previously, for Windows Store apps, it would have used a different, 'Roaming' folder. Files in Roaming folders can be automatically, and synchronized across multiple devices by Windows. This synchronization can happen while the app runs, with new files being copied into a running app's pref-path. Unless an app is specifically designed to handle this scenario, there is a chance that save-data could be overwritten in unwanted or unexpected ways. The default is now to use a Local folder, which does not get synchronized, and which is arguably a bit safer to use. Apps that wish to use Roaming folders can do so by setting SDL_HINT_WINRT_PREF_PATH_ROOT to "roaming", however it is recommended that one first read Microsoft's documentation for Roaming files, a link to which is provided in README-winrt.md. To preserve older pref-path selection behavior (found in SDL 2.0.3, as well as many pre-2.0.4 versions of SDL from hg.libsdl.org), which uses a Roaming path in Windows Store apps, and a Local path in Windows Phone, set SDL_HINT_WINRT_PREF_PATH_ROOT to "old". Please note that Roaming paths are not supported on Windows Phone 8.0, due to limitations in the OS itself. Attempts to use this will fail. (Windows Phone 8.1 does not have this limitation, however.) 3. It makes SDL_GetPrefPath(), when on Windows Phone 8.0, and when SDL_HINT_WINRT_PREF_PATH_ROOT is set to "roaming", return NULL, rather than silently defaulting to a Local path (then switching to a Roaming path if and when the user upgraded to Windows Phone 8.1).
David Ludwig ecc01474 2014-11-27T09:55:34 WinRT: added SDL_HINT_WINRT_PREF_PATH_ROOT SDL_HINT_WINRT_PREF_PATH_ROOT allows WinRT apps to alter the path that SDL_GetPrefPath() returns. Setting it to "local" uses the app's OS-defined Local folder, setting it to "roaming" uses the app's OS-defined Roaming folder. Roaming folder support is not available in Windows Phone 8.0. Attempts to make SDL_GetPrefPath() return a Roaming folder on this OS will be ignored. Various bits of documentation on this were added to SDL_hints.h, and to README-winrt.md
David Ludwig 506a1efc 2014-11-27T08:50:11 WinRT: removed a completed TODO item from an inline comment
David Ludwig d9a42c76 2014-11-23T08:59:01 WinRT: fixed an invalid comment in SDL_GetPrefPath() (for WinRT)
David Ludwig 13c51169 2014-11-23T08:52:10 WinRT: allowed 'roaming' and 'temp' folder paths to be retrieved on WinPhone 8.1 Windows Phone 8.0 either did not define, or provide access to, a 'RoamingFolder' or 'TemporaryFolder' for apps to use. Windows 8.0 and 8.1 do, as does Windows Phone 8.1. This change allows SDL-based Windows Phone 8.1 apps to access these folders, via either the SDL_WinRTGetFSPathUNICODE() or SDL_WinRTGetFSPathUTF8() functions. SDL_GetPrefPath(), which on WinRT, is based on SDL_WinRTGetFSPathUTF8(), will continue to return the app's 'local' folder, despite Windows 8.x counterpart apps using the 'roaming' folder, in order to preserve compatibility when 8.0-based Phone apps upgrade to 8.1-based Phone apps.
Philipp Wiesemann 9c398852 2014-11-22T22:20:40 Corrected header file documentation comment.
Pierre-Loup A. Griffais 24c86b55 2014-09-11T19:24:42 [X11] Reconcile logical keyboard state with physical state on FocusIn since the window system doesn't do it for us like other platforms. This prevents sticky keys and missed keys when going in and out of focus, for example Alt would appear to stick if switching away from an SDL app with Alt-Tab and had to be pressed again. CR: Sam
Alex Szpakowski b1a0bd10 2014-08-20T17:20:22 Merged default into iOS-improvements
Sam Lantinga d1cc47b3 2014-08-17T15:07:00 Fixed 2680 - OSX: Replace NSAutoreleasePool with @autoreleasepool Tim McDaniel This patch replaces all use of NSAutoreleasePool with the Apple recommended @autoreleasepool. @autoreleasepool is supposedly more efficient, and since it is scope based it can't be accidentally not released.
Sam Lantinga 05d87800 2014-08-11T17:25:53 Implemented SDL_GetPrefPath() on Android - it returns the path used by SDL_AndroidGetInternalStoragePath()
Alex Szpakowski 734b5233 2014-07-14T16:50:25 Misc. iOS code improvements. - Use @autoreleasepool instead of NSAutoReleasePool. - Code style fixups.
Gabriel Jacobo 6c5cb540 2014-06-20T11:01:05 Ooops, code that resists erasure, I've seen that in a movie.
Gabriel Jacobo 715a9829 2014-06-18T10:04:21 Fix file name typo, thanks Sam Clegg!
Gabriel Jacobo efa2d058 2014-06-08T18:18:13 Fixes audio for Native Client, and other fixes... - SDL_NaClMount, SDL_NaClUmount - Default mounting of https at / in SDL's main function - More documentation in README-nacl.txt
Brandon Schaefer 1f716769 2014-06-05T15:29:23 Fix warnings, only major one being an SDL_SetError not providing enough arguments.
David Ludwig 3dcb451f 2014-04-09T21:29:19 Added a README file regarding WinRT support To note, this file is currently formatted with CRLF line endings, rather than LF, to allow the file to be viewed with Notepad.
Sam Lantinga f9a58968 2014-03-13T21:21:26 Added missing copyright notices
David Ludwig e8eb1427 2014-03-10T21:21:35 build fixes for most WinRT-related files Still TODO: getting the D3D11 renderer back up and running in VC 2012.
Ryan C. Gordon 8c7ee701 2014-03-10T00:48:41 Removed unused variable.
Sam Lantinga 1367bf87 2014-03-09T11:36:47 Integrated David Ludwig's support for Windows RT
Sam Lantinga 05c23063 2014-03-09T11:06:11 Fixed line endings on WinRT source code
Ryan C. Gordon 3e541f30 2014-03-01T20:28:40 Force Windows version of SDL_GetPrefPath() to Unicode, create missing dirs. Fixes Bugzilla #2273.
Sam Lantinga 58edac3e 2014-02-02T00:53:27 Fixed bug 2374 - Update copyright for 2014... Is it that time already??
Gabriel Jacobo f848adff 2013-11-29T10:06:08 Improve Android pause/resume behavior.
David Ludwig 46740a5a 2013-11-28T22:09:21 WinRT: merged with latest SDL 2.x/HG code SDL 2.x recently accepted patches to enable OpenGL ES 2 support via Google's ANGLE library. The thought is to try to eventually merge SDL/WinRT's OpenGL code with SDL-official's.
Ryan C. Gordon 7e1289af 2013-11-24T23:56:17 Make internal SDL sources include SDL_internal.h instead of SDL_config.h The new header will include SDL_config.h, but allows for other global stuff.
Ryan C. Gordon 00003e8c 2013-11-14T11:51:24 Renamed things named after BeOS to be named after Haiku instead.
David Ludwig ea12ff9f 2013-10-28T15:52:04 WinRT: added a comment regarding the lack of SHGetFolderPath on WinRT
David Ludwig 3236fc3a 2013-10-28T15:41:22 WinRT: implemented SDL_GetBasePath and SDL_GetPrefPath
Ryan C. Gordon 609b58e4 2013-10-24T00:00:10 Fixed buffer overflow.
Ryan C. Gordon 28aa076c 2013-10-23T00:58:20 SDL_GetPrefPath() now uses the organization on all platforms. Even if that's not the general convention for a given platform.
Sam Lantinga deb8086b 2013-10-21T00:20:27 Fixed bug 2072 - Make OS X's filesystem calls use -[NSString fileSystemRepresentation] C.W. Betts The recommended way of getting a file name that POSIX file APIs can open in OS X when using an NSString is -[NSString fileSystemRepresentation]. However, the current filesystem API in hg uses -[NSString UTF8String].
Sam Lantinga 69a4351e 2013-09-30T22:35:32 Fixed bug 2121 - GCC throws error on SDL_FORCE_INLINE when compiling with -ansi
Sam Lantinga f79fc33a 2013-08-29T08:29:21 Christoph Mallon: Remove pointless if (x) before SDL_free(x)
Sam Lantinga 1d2c7796 2013-08-29T08:27:25 Christoph Mallon: Correct indendation.
Sam Lantinga 7267ea8f 2013-08-29T08:26:55 Christoph Mallon: Use SDL_arraysize()
Sam Lantinga 67c10169 2013-08-29T08:25:54 Christoph Mallon: Report an error, if creating the directories in SDL_GetPrefPath() failed.