Commit Graph

116 Commits

Author SHA1 Message Date
Lauri Kasanen b13e4d878d Constify the archivers pointers.
These were writable for no reason, taking up .data space.
2012-10-22 23:32:05 -04:00
Ryan C. Gordon c188729b12 Backport from default branch: clean up the thread ID mess in platform_unix.
Backported from hg changeset f254870dd7dd.
2012-08-02 02:57:55 -04:00
Ryan C. Gordon fb149451b8 Don't sort if there's nothing to do (prevents array underflow, too).
(transplanted from 662a7e180c480ff7731493b688aee27e8e010887)
2012-06-07 10:21:43 -04:00
Ryan C. Gordon c710fb637a Backported fixes for bogus homedir bug to stable-2.0 branch.
Fixes http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=553174
2010-03-21 12:29:49 -04:00
Ryan C. Gordon 78037a7ccb Valgrind fix: avoid overlapping memcpy() in sorting routines (thanks, JLM!). 2009-02-28 01:34:02 -05:00
Ryan C. Gordon c5ee3d965c Fixed crash on zero-byte read/write (thanks, Ensiform!). 2007-07-11 22:11:29 +00:00
Ryan C. Gordon 0d45ce01c4 Added PHYSFS_symbolicLinksPermitted(). 2007-04-01 22:06:37 +00:00
Ryan C. Gordon 777eec4254 Added PHYSFS_isInit() function. 2007-04-01 21:24:19 +00:00
Ryan C. Gordon 60dfcae88b Try the DIR archiver first, since there's no sense in trying to open a
directory as a file in all the other archivers first.
2007-03-31 06:52:27 +00:00
Ryan C. Gordon 0e3233a205 Don't put comments in BAIL_* macros where we want an empty argument...
apparently it aggravates some compilers. Thanks to Chris Taylor for this one.
2007-03-29 05:39:16 +00:00
Ryan C. Gordon 7386320811 Replaced some Malloc and all the alloca() calls with __PHYSFS_smallAlloc(),
which will stack allocate small (128 or less bytes) blocks and Malloc the
 rest...naturally these now have to be paired with __PHYSFS_smallFree() calls,
 so you can't be as lazy as a basic alloca() would let you be. The benefit is
 both less malloc pressure for those temporary allocations and better stack
 overflow safety (so if some jerk tries to push a 78 megabyte string through
 the library as a filename, we won't try to strcpy it to the stack).
2007-03-24 03:54:58 +00:00
Ryan C. Gordon 030e84f356 Cleanups in calculateBaseDir. 2007-03-21 05:22:48 +00:00
Ryan C. Gordon 857d9bc84d Since all the platform layers were using the same cut-and-paste of the
malloc/realloc/free allocator, I moved it into physfs.c as a default, which
 is used if the platform layer doesn't offer a platform-specific default
 allocator, which none do at this point, but will soon.
2007-03-20 18:33:56 +00:00
Ryan C. Gordon 4530776d5b PHYSFS_init() should fail if argv0 is NULL and we can't do without it. 2007-03-19 20:13:37 +00:00
Ryan C. Gordon 607d39a1d3 Bunch of work on Unicode...added case-folding stricmp, removed
platform-specific stricmp implementations, changed appropriate calls to an
ASCII-only stricmp that ignores locale. Fixed case on UTF-8 API entry points.
2007-03-15 08:16:23 +00:00
Ryan C. Gordon 1a6f1787fa Fixes for BeOS and gcc2. 2007-03-12 03:41:20 +00:00
Ryan C. Gordon 53bbe35ddd Renamed LICENSE to LICENSE.txt 2007-03-11 10:10:28 +00:00
Ryan C. Gordon ca2489418e Removed config.h references from old autotools build system. 2007-03-11 09:44:21 +00:00
Ryan C. Gordon c6273ae317 Killed MIX archiver. 2007-03-10 06:41:26 +00:00
Ryan C. Gordon 9d42a71574 Killed some #ifdefs and whitespace. 2007-03-10 06:24:56 +00:00
Ryan C. Gordon d8f69c0e93 Changed PHYSFS_SUPPORTS_LZMA to PHYSFS_SUPPORTS_7Z. 2007-03-09 08:17:56 +00:00
Ryan C. Gordon c527092aed 7zip support, written by Dennis Schridde, and heavily Ryanified by me. 2006-04-11 14:33:48 +00:00
Ryan C. Gordon b7a3aeaccd Fixed version of locateInStringList() from Matze Braun. 2005-10-12 22:03:28 +00:00
Ryan C. Gordon 499631936f Don't leave internal structures temporarily modified before calling an
application callback, so that state is sane if they call into the API
 from inside the callback.
2005-09-18 22:27:05 +00:00
Ryan C. Gordon 6e7e45cdaf API BREAKAGE: Changed PHYSFS_enumerateFilesCallback() to pass the originally
requested directory back to the app.
2005-09-18 21:44:42 +00:00
Ryan C. Gordon 67746179d3 Some tweaks to PHYSFS_Allocator. 2005-09-09 14:07:43 +00:00
Ryan C. Gordon bbb0cab5ee Fixed bug in verifyPath() that was breaking PHYSFS_setSaneConfig() and other
corner cases.
2005-08-20 04:46:25 +00:00
Ryan C. Gordon 6e33ae594d Fixed warning in physfs.c. 2005-07-23 23:39:37 +00:00
Ryan C. Gordon 779e526014 Allow a mount point of NULL to mean "/". 2005-07-23 23:10:27 +00:00
Ryan C. Gordon 3a0e6fa051 Builds on Mac Classic again. 2005-03-14 12:05:07 +00:00
Ryan C. Gordon d840403c1c All memory management now goes through allocation hooks instead of directly to
C runtime malloc/realloc/free...
2005-03-14 11:49:30 +00:00
Ryan C. Gordon 2211ea7240 Fixed an error string. 2005-03-14 07:33:37 +00:00
Ryan C. Gordon a2cc461727 More mountpoint work and other cleanups. 2005-03-14 07:15:40 +00:00
Ryan C. Gordon d992f4325a Cleaned up some mallocs. 2005-03-13 21:16:15 +00:00
Ryan C. Gordon 38a1c7f559 If rejecting an archive for not matching a mount point, set an error state,
otherwise, PHYSFS_openRead could fail with a null error message.
2005-03-13 21:03:31 +00:00
Ryan C. Gordon 67776da8cc Split off sanitizePlatformIndependentPath() from verifySecurity(), which makes
this faster and reduces malloc() pressure. Plus cleanups, and other mount
 work.
2005-03-13 12:03:05 +00:00
Ryan C. Gordon 93adbf1d88 First chunk of PHYSFS_mount() implementation. Incomplete! 2005-03-13 09:09:26 +00:00
Ryan C. Gordon e2c199b8ab Fixed infinite loop in enum code (thanks, Adam!) 2004-10-31 12:20:00 +00:00
Ryan C. Gordon bdd4ca0d93 Fixed a strcpy bug. 2004-10-30 09:31:54 +00:00
Ryan C. Gordon 3e06b381e9 Removed profiling code. 2004-10-07 02:10:01 +00:00
Ryan C. Gordon c2c71fb55f Removed LinkedStringList and related code. 2004-09-29 06:37:20 +00:00
Ryan C. Gordon c2765f8571 Added callback APIs and ripped up the internals everywhere to use them. 2004-09-29 06:09:29 +00:00
Ryan C. Gordon 8641e4e7ef Changed PHYSFS_file to PHYSFS_File to match rest of API's naming
convention. This won't break binary compat (function signatures are
extern "C" so name mangling doesn't apply), and I've placed a typedef
for the old name to support legacy source code.
2004-09-26 13:17:54 +00:00
Ryan C. Gordon 90031c81f3 Did the same thing to FileHandles than I did to DirHandles, but this
triggered massive tweaking in physfs.c. A lot of code got little
cleanups, which was nice. Less malloc pressure, too, since opening a
file used to allocate a ton of crap and mush it together...now it's
basically down to one structure and the instance data in whatever
archiver.
2004-09-26 13:00:59 +00:00
Ryan C. Gordon 94759513d9 Cleaned up archiver interface to not deal with DirHandles anymore,
which simplifies things, removes some responsibility and code
duplication from the archivers, and trims some malloc pressure.
Also ripped up the allocation hook code a little. We'll try to screw
with memory locking later, since it makes everything ugly and
complex. Oh well.
2004-09-26 00:25:04 +00:00
Ryan C. Gordon c0acfc0118 Initial structure for replacable allocator work. 2004-09-23 06:45:36 +00:00
Ryan C. Gordon f3af262a99 Don't throw away buffer if a seek is totally within existing cache. 2004-08-23 03:34:03 +00:00
Ryan C. Gordon 44cd602b46 Westwood MIX archive support. 2004-04-09 06:36:09 +00:00
Ryan C. Gordon efdc4ac8a6 Added Doom WAD support. 2003-12-15 04:01:18 +00:00
Ryan C. Gordon 1400b98be7 Readded new qpak archiver. 2003-07-21 00:27:27 +00:00