View Single Post
  #189  
Old Yesterday, 03:32
Lord.Freddy's Avatar
Lord.Freddy Lord.Freddy is offline
Registered User
 
Join Date: Apr 2022
Location: ...
Posts: 56
Thanks: 237
Thanked 48 Times in 27 Posts
Lord.Freddy is on a distinguished road
MPZ Wrapper v2

Changelog:
Code:
▪︎ Complete rewrite of the wrapper core — replaced the old C++/coroutine-based implementation with a cleaner C89-compatible state-machine design.
▪︎ More reliable DLL handling — MpzSlimmer.dll is now loaded from the executable directory with validation and safer dependency/search-path handling.
▪︎ Safer codec execution — codec crashes and unexpected failures are caught and reported instead of leaving the process hanging or terminating silently.
▪︎ Robust input/output handling — improved Win32 I/O, buffering, seeking, partial reads/writes and support for both regular files and stdin/stdout.
▪︎ Configurable I/O buffer size — buffer size can now be specified from the command line for better control over performance and memory usage.
▪︎ Progress reporting — file-to-file operations now show processing progress.
▪︎ 2 GB stream protection — inputs and outputs exceeding the codec's supported 32-bit limit are detected and rejected safely.
▪︎ Same-file protection — prevents accidentally using the same file as both input and output.
▪︎ Automatic cleanup on failure — incomplete output files are removed when processing fails, avoiding misleading/corrupted results.
▪︎ Better command-line interface — explicit c / d modes, - for stdin/stdout, optional buffer size, and -h / --help.
▪︎ Overall stability improvements — numerous edge cases around EOF, pipes, large files, errors and cleanup were handled explicitly instead of relying on the old coroutine behavior.
In short: v2 is not just a small update; it is a substantial rewrite focused on reliability, safer error handling, better I/O, easier usage and a much cleaner codebase.
Compiled with: gcc-14.2.0-mingw-w64msvcrt-12.0.0

The source code will be added to the post shortly, once I’ve finished a few final cleanups and adjustments.
Attached Files
File Type: zip MPZ_Wrapper_v2.zip (89.2 KB, 15 views)
Reply With Quote
The Following 3 Users Say Thank You to Lord.Freddy For This Useful Post:
DomoVoi_96 (Yesterday), Dunnowho69 (Yesterday), ScOOt3r (Yesterday)