Skip to content

Commit 37d4499

Browse files
Update SDL_filesystem.inc to 3.4.4
1 parent 634834c commit 37d4499

2 files changed

Lines changed: 45 additions & 10 deletions

File tree

units/SDL3.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ interface
118118
{$I SDL_dialog.inc} // 3.4.4
119119
{$I SDL_messagebox.inc} // 3.4.4
120120
{$I SDL_time.inc} // 3.4.4
121-
{$I SDL_filesystem.inc} // 3.2.0
121+
{$I SDL_filesystem.inc} // 3.4.4
122122
{$I SDL_atomic.inc} // 3.2.0
123123
{$I SDL_hidapi.inc} // 3.2.0
124124
{$I SDL_metal.inc} // 3.2.0

units/SDL_filesystem.inc

Lines changed: 44 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@
5151
* - `parent`: the containing directory of the bundle. For example:
5252
* `/Applications/SDLApp/`
5353
*
54+
* **Android Specific Functionality**: This function returns "./", which
55+
* allows filesystem operations to use internal storage and the asset system.
56+
*
5457
* **Nintendo 3DS Specific Functionality**: This function returns "romfs"
5558
* directory of the application as it is uncommon to store resources outside
5659
* the executable. As such it is not a writable directory.
@@ -59,10 +62,12 @@
5962
* Windows, '/' on most other platforms).
6063
*
6164
* \returns an absolute path in UTF-8 encoding to the application data
62-
* directory. nil will be returned on error or when the platform
65+
* directory. NULL will be returned on error or when the platform
6366
* doesn't implement this functionality, call SDL_GetError() for more
6467
* information.
6568
*
69+
* \threadsafety It is safe to call this function from any thread.
70+
*
6671
* \since This function is available since SDL 3.2.0.
6772
*
6873
* \sa SDL_GetPrefPath
@@ -109,6 +114,12 @@ function SDL_GetBasePath: PAnsiChar; cdecl;
109114
* - ...only use letters, numbers, and spaces. Avoid punctuation like "Game
110115
* Name 2: Bad Guy's Revenge!" ... "Game Name 2" is sufficient.
111116
*
117+
* Due to historical mistakes, `org` is allowed to be NULL or "". In such
118+
* cases, SDL will omit the org subdirectory, including on platforms where it
119+
* shouldn't, and including on platforms where this would make your app fail
120+
* certification for an app store. New apps should definitely specify a real
121+
* string for `org`.
122+
*
112123
* The returned path is guaranteed to end with a path separator ('\\' on
113124
* Windows, '/' on most other platforms).
114125
*
@@ -119,6 +130,8 @@ function SDL_GetBasePath: PAnsiChar; cdecl;
119130
* etc.). This should be freed with SDL_free() when it is no longer
120131
* needed.
121132
*
133+
* \threadsafety It is safe to call this function from any thread.
134+
*
122135
* \since This function is available since SDL 3.2.0.
123136
*
124137
* \sa SDL_GetBasePath
@@ -194,18 +207,20 @@ const
194207
* \returns either a null-terminated C string containing the full path to the
195208
* folder, or nil if an error happened.
196209
*
210+
* \threadsafety It is safe to call this function from any thread.
211+
*
197212
* \since This function is available since SDL 3.2.0.
198213
}
199214
function SDL_GetUserFolder(folder: TSDL_Folder): PAnsiChar; cdecl;
200215
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetUserFolder' {$ENDIF} {$ENDIF};
201216

202217
{ Abstract filesystem interface }
218+
203219
{*
204220
* Types of filesystem entries.
205221
*
206-
* Note that there may be other sorts of items on a filesystem: devices,
207-
* symlinks, named pipes, etc. They are currently reported as
208-
* SDL_PATHTYPE_OTHER.
222+
* Note that there may be other sorts of items on a filesystem: devices, named
223+
* pipes, etc. They are currently reported as SDL_PATHTYPE_OTHER.
209224
*
210225
* \since This enum is available since SDL 3.2.0.
211226
*
@@ -268,6 +283,8 @@ const
268283
* \returns true on success or false on failure; call SDL_GetError() for more
269284
* information.
270285
*
286+
* \threadsafety It is safe to call this function from any thread.
287+
*
271288
* \since This function is available since SDL 3.2.0.
272289
}
273290
function SDL_CreateDirectory(path: PAnsiChar): Boolean; cdecl;
@@ -335,6 +352,8 @@ type
335352
* \returns true on success or false on failure; call SDL_GetError() for more
336353
* information.
337354
*
355+
* \threadsafety It is safe to call this function from any thread.
356+
*
338357
* \since This function is available since SDL 3.2.0.
339358
}
340359
function SDL_EnumerateDirectory(path: PAnsiChar; callback: TSDL_EnumerateDirectoryCallback; userdata: Pointer): Boolean; cdecl;
@@ -350,6 +369,8 @@ function SDL_EnumerateDirectory(path: PAnsiChar; callback: TSDL_EnumerateDirecto
350369
* \returns true on success or false on failure; call SDL_GetError() for more
351370
* information.
352371
*
372+
* \threadsafety It is safe to call this function from any thread.
373+
*
353374
* \since This function is available since SDL 3.2.0.
354375
}
355376
function SDL_RemovePath(path: PAnsiChar): Boolean; cdecl;
@@ -358,7 +379,7 @@ function SDL_RemovePath(path: PAnsiChar): Boolean; cdecl;
358379
{*
359380
* Rename a file or directory.
360381
*
361-
* If the file at `newpath` already exists, it will replaced.
382+
* If the file at `newpath` already exists, it will be replaced.
362383
*
363384
* Note that this will not copy files across filesystems/drives/volumes, as
364385
* that is a much more complicated (and possibly time-consuming) operation.
@@ -374,6 +395,8 @@ function SDL_RemovePath(path: PAnsiChar): Boolean; cdecl;
374395
* \returns true on success or false on failure; call SDL_GetError() for more
375396
* information.
376397
*
398+
* \threadsafety It is safe to call this function from any thread.
399+
*
377400
* \since This function is available since SDL 3.2.0.
378401
}
379402
function SDL_RenamePath(oldpath: PAnsiChar; newpath: PAnsiChar): Boolean; cdecl;
@@ -415,6 +438,10 @@ function SDL_RenamePath(oldpath: PAnsiChar; newpath: PAnsiChar): Boolean; cdecl;
415438
* \returns true on success or false on failure; call SDL_GetError() for more
416439
* information.
417440
*
441+
* \threadsafety It is safe to call this function from any thread, but this
442+
* operation is not atomic, so the app might need to protect
443+
* access to specific paths from other threads if appropriate.
444+
*
418445
* \since This function is available since SDL 3.2.0.
419446
}
420447
function SDL_CopyFile(oldpath: PAnsiChar; newpath: PAnsiChar): Boolean; cdecl;
@@ -423,12 +450,18 @@ function SDL_CopyFile(oldpath: PAnsiChar; newpath: PAnsiChar): Boolean; cdecl;
423450
{*
424451
* Get information about a filesystem path.
425452
*
453+
* Symlinks, on filesystems that support them, are always followed, so you
454+
* will always get information on what the symlink eventually points to, and
455+
* not the symlink itself.
456+
*
426457
* \param path the path to query.
427-
* \param info a Pointer filled in with information about the path, or nil to
458+
* \param info a pointer filled in with information about the path, or NULL to
428459
* check for the existence of a file.
429460
* \returns true on success or false if the file doesn't exist, or another
430461
* failure; call SDL_GetError() for more information.
431462
*
463+
* \threadsafety It is safe to call this function from any thread.
464+
*
432465
* \since This function is available since SDL 3.2.0.
433466
}
434467
function SDL_GetPathInfo(path: PAnsiChar; info: PSDL_PathInfo): Boolean; cdecl;
@@ -438,10 +471,10 @@ function SDL_GetPathInfo(path: PAnsiChar; info: PSDL_PathInfo): Boolean; cdecl;
438471
* Enumerate a directory tree, filtered by pattern, and return a list.
439472
*
440473
* Files are filtered out if they don't match the string in `pattern`, which
441-
* may contain wildcard characters '\*' (match everything) and '?' (match one
442-
* character). If pattern is nil, no filtering is done and all results are
474+
* may contain wildcard characters `*` (match everything) and `?` (match one
475+
* character). If pattern is NULL, no filtering is done and all results are
443476
* returned. Subdirectories are permitted, and are specified with a path
444-
* separator of '/'. Wildcard characters '\*' and '?' never match a path
477+
* separator of `/`. Wildcard characters `*` and `?` never match a path
445478
* separator.
446479
*
447480
* `flags` may be set to SDL_GLOB_CASEINSENSITIVE to make the pattern matching
@@ -485,6 +518,8 @@ function SDL_GlobDirectory(path: PAnsiChar; pattern: PAnsiChar; flags: TSDL_Glob
485518
* platform-dependent notation. nil if there's a problem. This
486519
* should be freed with SDL_free() when it is no longer needed.
487520
*
521+
* \threadsafety It is safe to call this function from any thread.
522+
*
488523
* \since This function is available since SDL 3.2.0.
489524
}
490525
function SDL_GetCurrentDirectory: PAnsiChar; cdecl;

0 commit comments

Comments
 (0)