45 Commits

Author SHA1 Message Date
jdgleaver
334a43a7c5 Prevent unnecessary extraction (to disk) of compressed content files + task_content.c clean-ups 2021-05-20 17:08:51 +01:00
twinaphex
1811bd6885 Fix issue in https://github.com/libretro/neocd_libretro/issues/58 2021-04-16 19:34:06 +02:00
twinaphex
f48dc0ff5b Reorder structs, alignment 2020-08-15 20:38:31 +02:00
Autechre
343a04e2b8
Merge pull request #11027 from schellingb/archive_cleanup_1b
Use MMAP again for ZIP loading/parsing
2020-07-16 03:28:54 +02:00
Bernhard Schelling
b03cdbd0da First set of cleanups to archive handling (Rev B)
- Don't read the entire archive file into memory on systems without HAVE_MMAP
- Support ZIP files between 2GB ~ 4GB on 32bit architectures
- Remove zip exclusive members from `file_archive_transfer`
- Add `zip_context_t` for zip like the already existing `sevenzip_context_t`
- Unify cleanups of zip and 7z in `file_archive_file_backend::archive_parse_file_free`
- Handle some sizes and offsets as int64_t (preparation for future Zip64 support)
- Handle ZIP compression methods in `zlib_stream_decompress_data_to_file_init` not in `file_archive_perform_mode`
- Return progress of 7z iterating with `file_archive_parse_file_progress`
- Uses MMAP where available, for files up to 256MB
2020-07-16 02:47:59 +09:00
Twinaphex
367530683c Get rid of unused variables 2020-07-15 19:47:45 +02:00
twinaphex
06064a0527 Revert "Bring back MMAP support"
This reverts commit 32dcff3880a32521e49916dc56e8b04f56ed6b45.
2020-07-13 23:52:23 +02:00
Bernhard Schelling
32dcff3880 Bring back MMAP support
Will be used where available for files up to 256MB
2020-07-14 03:04:01 +09:00
Bernhard Schelling
a978b939ff Fix C89 build 2020-07-14 01:56:48 +09:00
Bernhard Schelling
54db0fe515 Fix memory leak
Properly release buffers for extracted files from ZIP
Use RETRO_VFS_SEEK_POSITION_START instead of SEEK_SET for filestream_seek
2020-07-14 00:29:46 +09:00
Bernhard Schelling
0ddb073784 First set of cleanups to archive handling
- Don't read the entire archive file into memory on systems without HAVE_MMAP
- Support ZIP files between 2GB ~ 4GB on 32bit architectures
- Remove zip exclusive members from `file_archive_transfer`
- Add `zip_context_t` for zip like the already existing `sevenzip_context_t`
- Unify cleanups of zip and 7z in `file_archive_file_backend::archive_parse_file_free`
- Handle some sizes and offsets as int64_t (preparation for future Zip64 support)
- Handle compression methods in `zlib_stream_decompress_data_to_file_init` not in `file_archive_perform_mode`
- Return progress of 7z iterating with `file_archive_parse_file_progress`
2020-07-12 00:51:35 +09:00
twinaphex
1ae20ea17c Style nits - turn macro names into upper-case - some while style nits 2020-06-26 20:00:19 +02:00
twinaphex
b9f65af98a (Libretro-common) Sync 2020-06-24 15:05:03 +02:00
twinaphex
cd9ca691ca (libretro-common) Update copyright 2020-01-31 15:43:42 +01:00
twinaphex
22d762be67 We need to split up zlib headers in libretro-common to its own separate
dir
2019-05-27 03:40:14 +02:00
twinaphex
2b401ce13b (archive_file) Small optimizations - use one strlen less in one instance 2019-04-27 02:39:33 +02:00
twinaphex
64460824aa Fix another CXX_BUILD warning 2019-01-31 20:21:04 +01:00
Brad Parker
16fffd67ea Normalize archive progress calculation 2019-01-16 17:22:46 -05:00
twinaphex
768ebbfdb5 Merge commit 'ce9ce1d35387ef8144e53bf071396fa075bfb6c5' as 'libretro-common' 2018-05-12 17:56:34 +02:00
twinaphex
0548349991 Remove libretro-common 2018-05-12 17:56:14 +02:00
twinaphex
7bc66ae710 Buildfixes for MSVC 2015 2018-05-03 15:20:06 +02:00
twinaphex
de111ea903 Should fix some zip archives potentially not working on Linux; the
stream member of zlib was being set to random memory, so it was
attempted
 to be freed on line 73 of trans_stream_zlib.c
2018-04-25 10:10:22 +02:00
twinaphex
be7eb4de1c Update libretro-common 2018-04-16 08:57:17 +02:00
twinaphex
bd73d4b98a Cleanups 2018-01-17 06:44:16 +01:00
gblues
6904101c44 Clean up trailing whitespace
== DETAILS

Really simple code cleanup, because my editor flags trailing whitespaces
and it's pretty annoying.
2017-12-12 00:24:18 -08:00
twinaphex
50b07ad8c4 Move retro_le to archive_file_zlib.c 2017-06-28 04:20:52 +02:00
Twinaphex
b7b3b2cb5f Try to prevent truckload of warnings on iOS 2017-02-26 10:33:03 +01:00
twinaphex
64bb848daf Update headers (pt. 2 - libretro-common) 2017-01-22 13:58:20 +01:00
twinaphex
89820220b7 (libretro-common) Cleanup/style nits for archive_file_{7z/zlib} 2016-12-19 00:12:24 +01:00
twinaphex
4029709658 Fix warning 2016-11-27 14:50:42 +01:00
Gregor Richards
096eb072e1 Replacing archive_file_zlib backend with trans_stream 2016-11-26 15:48:58 -05:00
twinaphex
4fb6808321 libretro-common is MIT and we don't want individual copyright
per authors here; RetroArch is GPL and it's fine there
2016-10-27 19:52:58 +02:00
twinaphex
88e88e92f3 Prevent crash with zipped roms 2016-10-27 19:50:19 +02:00
Brad Parker
d1d5584d18 update copyright 2016-10-27 11:47:10 -04:00
twinaphex
6310f53587 Prevent some implicit memsets and reduce the size of some
char variables
2016-10-27 10:45:53 +02:00
Brad Parker
af98ee1c8a Add CRC calculation function that works with archives with or without a path inside (first file is used if no path)
Add all archive's contents to database scan list when scanning files and directories

Allow scanning a single file that is an archive

Remove unnecessary prototypes from archive_file.h

Simplify retrieving of CRCs from archives when scanning
2016-09-25 00:15:05 -04:00
Brad Parker
2a75b88d89 file_archive_extract_first_file can choose any file now 2016-09-18 21:22:13 -04:00
Brad Parker
a7ffead8f6 fix more memory corruption 2016-09-18 15:20:27 -04:00
Brad Parker
dbbd49f9f9 merge with master, remove alignment test code 2016-09-18 12:44:00 -04:00
Brad Parker
f13bce4e50 - use the detected stream backend's crc32 function
- remove zlib/7zip ifdef from archive_file.c, task_content.c and task_database.c
- don't re-compute CRC from one stored in archive
2016-09-18 12:31:24 -04:00
twinaphex
c2e2d41452 C89_BUILD fixes 2016-09-18 18:28:33 +02:00
Brad Parker
7c29fd6c33 create 7z archive backend, enables scanning of 7z content 2016-09-18 10:31:21 -04:00
twinaphex
8ba1f2fca6 (libretro-common) archive_file_zlib.c - cleanup 2016-04-08 02:54:37 +02:00
twinaphex
3720cf87e7 Rename retro_file to file_stream 2016-03-20 16:29:14 +01:00
twinaphex
c7e13e2bcd (libretro-common) Rename file_archive to archive_file 2016-03-20 16:14:40 +01:00