Commit Graph

115 Commits

Author SHA1 Message Date
Ozkan Sezer 49662cd826 minor update to endian macros from SDL. 2022-09-29 18:55:04 +03:00
Ryan C. Gordon 4d9bcc3d1a
atomic: __PHYSFS_ATOMIC_(DECR|INCR) should return final value.
Fixes #46.
2022-09-29 10:53:18 -04:00
Ryan C. Gordon f0c7367b0f
Update endian detection from latest in SDL2.
Fixes #43.
2022-06-15 13:54:21 -04:00
Ryan C. Gordon 17b691b0ea
Let several archives be case-insensitive.
(and several more probably _should_ be but I don't have the details on
them at the moment. But now it's just changing a 1 to a 0 to fix those!)
2022-05-20 17:36:06 -04:00
Ozkan Sezer cd2e055454 added __PHYSFS_ATOMIC_INCR and __PHYSFS_ATOMIC_DECR for watcom compiler 2022-04-16 10:52:01 -04:00
Ozkan Sezer 02b6a7f084 fixed windows symbol exports 2022-04-16 10:52:01 -04:00
Matthew Albrecht d24ce15922 Include alloca.h on Solaris and Linux platforms. 2021-06-30 08:52:57 -04:00
Ryan C. Gordon 5ea6ba7557 msvc: Move stdarg.h include ahead of __PHYSFS_msvc_vsnprintf declaration. 2021-04-29 15:00:16 -04:00
Ryan C. Gordon 500033f37d Allow builds to opt-out or opt-in to specific archivers, whichever's easier. 2019-01-26 03:00:29 -05:00
Ryan C. Gordon 62d24e228f Fixed mounting a symlink to a real directory. 2017-10-26 14:21:36 -04:00
Ryan C. Gordon 4e0d3d55e9 Make PHYSFS_EnumerateCallback return an enum instead of an int. 2017-08-19 10:40:27 -04:00
Ryan C. Gordon 5fb9119ebc windows: Disable _CRT_SECURE_NO_WARNINGS again. 2017-08-16 21:19:16 -04:00
Ryan C. Gordon 735fd14ea4 Whoops, patched to compile. 2017-08-14 21:17:22 -04:00
Ryan C. Gordon 692d5e8219 Fixed some warnings that Xcode brought up. 2017-08-14 19:58:56 -04:00
Ryan C. Gordon f425f051db Little tweaks to __PHYSFS_initSmallAlloc(). 2017-08-14 13:57:57 -04:00
Ryan C. Gordon 9c9325c2c5 Filled in more documentation. 2017-08-14 01:28:30 -04:00
Ryan C. Gordon dd68246737 7z: do global initialization once without risking a race condition. 2017-08-13 22:53:38 -04:00
Ryan C. Gordon ee9687bca9 Reworked enumeration to be more powerful.
Now callbacks can stop further enumeration and report errors, if they had a
catastrophic issue or just found what they needed and don't need to process
any more items.

Also, the actual enumerators can report errors instead of silently dropping
items. This led to several other fixes as all these implementations got
audited and reworked.

The original, non-callback enumerator now returns NULL if it can't produce a
complete list instead of dropping items and returning a partial list.
2017-08-12 02:19:22 -04:00
Ryan C. Gordon b082bc3432 Removed __PHYSFS_stricmpASCII functions.
Nothing was using them, except one OS/2 thing that could live with stricmp.
2017-08-11 01:45:29 -04:00
Ryan C. Gordon d1f2637ca8 utf8: big improvements to case-insensitive UTF-8 string compare.
- Dramatically reduce RAM usage: uses between 8 and 11 kilobytes less static
memory for its internal case-folding tables.
- Actually works now. It would fail unconditionally if a codepoint folded
into multiple codepoints, even if the compared string contained those exact
codepoints.
- Now a public API!
- Removed __PHYSFS_utf8strnicmp(): nothing was using it, it was incorrect
anyhow, and what does 'n' represent when either string might case-fold to
something larger in-flight, anyhow?
2017-08-11 01:39:22 -04:00
Ryan C. Gordon f0eb5c0db9 Marked a bunch of things as "FIXME-3.0" that I want resolved before 3.0 ships. 2017-08-06 15:54:44 -04:00
Ryan C. Gordon 1d6c519c5e windows: Patched to compile! (...?) 2017-08-06 12:27:18 -04:00
Ryan C. Gordon 2176364a16 windows: (maybe) patched to compile on Visual Studio. 2017-08-06 12:19:33 -04:00
Ryan C. Gordon a7ce178eec Add basic atomic operations for refcounting, etc. 2017-08-06 09:21:38 -04:00
Ryan C. Gordon 61bdee4d78 __PHYSFS_platformDeinit() should return void.
What are you going to do if this fails, anyhow?
2017-08-06 01:30:58 -04:00
Ryan C. Gordon 1e2650b6fc Serious cleanup and update of Windows RT support.
This compiles for WinRT, but isn't otherwise tested at all yet.
2017-07-24 03:29:33 -04:00
Ryan C. Gordon a5461ddcd9 Some minor preprocessor nitpicks. 2017-07-24 02:36:58 -04:00
Ryan C. Gordon 6d91dde273 Rename __PHYSFS_Archiver_SZIP to __PHYSFS_Archiver_7Z. 2017-07-22 13:50:03 -04:00
Ryan C. Gordon 03097332ca unpacked: let archivers specify create and modified times, hook up to iso9660. 2017-07-21 22:01:51 -04:00
Ryan C. Gordon 3c9351c0ad unpacked: let archivers "abandon" the archive instead of closing it.
This lets you preserve the PHYSFS_Io in case of error during archive opening.
2017-07-21 19:01:41 -04:00
Ryan C. Gordon d3ac612b61 DirTrees and unpacked archives shouldn't demand a count of entries for init. 2017-07-21 13:54:42 -04:00
Ryan C. Gordon a5d3dd498e Rewrote the 7zip archiver.
This also updates the LZMA SDK to something more modern, which is now public
domain code, and squashed it into a single header for easier building.
2017-07-17 12:26:50 -04:00
Ryan C. Gordon 62ad133862 Reworked the "unpacked" archivers to use DirTree.
This cleaned up a lot of code and improved things, and also allowed a lot of
the restrictions on unpacked archivers to be removed.
2017-07-16 04:39:14 -04:00
Ryan C. Gordon ffa1836335 Moved ZIP tree management up to a higher level, to be reused elsewhere. 2017-07-15 15:59:55 -04:00
Ryan C. Gordon 5afd9754e2 Reenable QPAK support by default. 2017-07-16 04:34:52 -04:00
Ryan C. Gordon 19b15d34a1 Cleaned up what symbols are exported from the library. 2017-07-12 15:41:12 -04:00
Ryan C. Gordon c2c1c7ac30 Removed __PHYSFS_platformSetDefaultAllocator(); nothing uses it now.
We can pull it back from revision control if something needs it later.
2017-07-11 23:52:13 -04:00
Ryan C. Gordon 73070339a4 Simplify CMakeLists.txt, etc.
Try to test things with preprocessor macros instead of CMake, and get rid of
silly options like turning off thread safety.
2017-07-11 23:32:46 -04:00
Ryan C. Gordon cf11d2ec99 Workaround snprintf() deficiencies on Visual Studio. 2017-07-09 17:46:53 -04:00
Ryan C. Gordon 59a07020a8 Turn on all the archivers by default.
(Except for the lzma archiver, since it needs a bunch of external code.)

The difference in binary size, for Linux/amd64 compiled for size (-Os),
is 4 kilobytes. It's senseless to not just compile them all in.
2017-07-08 18:25:20 -04:00
Ryan C. Gordon 32da097a55 Cleanup BAIL_* and GOTO_* macros to be less cluttered.
This also fixes really aggressive compiler warnings about the "if (!ERRPASS)"
construct producing unreachable code.
2017-07-06 11:51:41 -04:00
Ryan C. Gordon 58bca6ae05 Watcom C should include malloc.h to make the alloca macro available. 2017-07-05 21:30:39 -04:00
Ryan C. Gordon 15c18b0c04 os2: added OS/2 support back in.
With the release of ArcaOS, this is a live platform again.

This code probably doesn't compile yet; I've just given it a first shot at
resolving the changes between the last OS/2-supported revision and now.

This still needs Unicode support added in any case.
2017-07-05 21:29:37 -04:00
Francesco Bertolaccini e4206408e5 Add support for VDF 2017-06-20 13:22:41 -04:00
Ryan C. Gordon c3cc732a70 Updated byte order tests to match what SDL does now.
That is: you're more likely to be on Linux or a little-endian machine,
so deal with the non-Linux bigendian as the exceptional case.
2016-02-25 02:55:11 -05:00
Ryan C. Gordon 32d4f4541e HTTPS all the things. 2016-02-25 02:51:28 -05:00
Ryan C. Gordon b479c57bcb zip: Reworked how we organize ZIP entries.
We now use a hashtable for lookups of specific paths, and organize the
entries into a directory tree. The end result is fast lookup and fast
enumeration without having to search a sorted array or tapdance with
substrings...which means the rare, mysterious bug where we failed
to find an existing file should be gone now, too.
2016-02-25 02:20:52 -05:00
Ryan C. Gordon acd00dda94 Fixed a comment. 2016-02-25 01:16:42 -05:00
Ryan C. Gordon e608c5c3de Move __PHYSFS_strdup() declaration up with other string helpers. 2016-02-25 00:40:17 -05:00
Martin Ahrnbom 9d55f3f099 Added support for WinRT 8.1 Universal Apps.
Hopefully this will work on Win10 as well... Only time will tell!
Here's what's changed:
1. Added a platform_winrt.cpp file. It's based on platform_windows.c but has some WinRT-specific changes.
2. Changed physfs_platforms.h to define PHYSFS_PLATFORM_WINRT when running on WinRT. PHYSFS_PLATFORM_WINDOWS should also be defined, as WinRT behaves a lot like "normal" Windows and this flag is tested against in multiple parts of the PhysFS source code.
3. Changed platform_windows.c to not be used when PHYSFS_PLATFORM_WINRT is defined.
4. In order to work on Windows ARM devices, I had to change in physfs_internal.h, to include _M_ARM as a flag for running on ARM as "ARM" and "__arm__" aren't defined when running on a Windows ARM device.

What I've tested:
* Setting up a "sane folder configuration"
* Reading and writing files
* Mounting zip files
* Using seek & tell
* Checking file length

All of these work fine. I couldn't get the actual test software to run on WinRT, but it seems like eveyrthing's working. I've tested these things on my Windows 8.1 computer, as well as my Lumia 920 which is currently running Windows 8.1.
2015-03-29 07:03:30 +02:00