You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Obtain file information via unshield_get_file_descriptor #228
ArchiveAccess uses libunshield to unpack .cab files. ArchiveAccess provides data about files that can be unpacked, to allow the user to choose what to inspect closer. I currently obtain this information via unshield_get_file_descriptor:
In order to do this, I export the function unshield_get_file_descriptor, which is an internal function in official builds. However, a cleaner way to do this would be via proper access functions. I propose to provide several access functions:
uint64_t unshield_get_uncompressed_size(Unshield* unshield, UnshieldFileGroup* file_group, int index);
uint64_t unshield_get_compressed_size(Unshield* unshield, UnshieldFileGroup* file_group, int index);
uint32_t unshield_get_attributes(Unshield* unshield, UnshieldFileGroup* file_group, int index);
There are other ways, like exposing all this data via one function, but these approaches would be less flexible. My questions:
If I would implement this, would you accept it in libunshield, or you would you rather go a different route?
Did I miss that there is a feature for doing this already?
I would basically accept this contribution, it just needs to blend in with the existing public API. The current public interface uses unshield_file_ prefix for file information and no existing API takes UnshieldFileGroup* as a parameter.
We already have unshield_file_size for the uncompressed size, so it could get a sibling for compressed size.
Regarding unshield_get_attributes I guess we also would need to expose the FILE_* values for the flags. Maybe a name like unshield_file_raw_flags or unshield_file_flags_raw would be more suitable to blend in?
So maybe these functions?
uint64_t unshield_file_size_compressed(Unshield* unshield, int index);
uint32_t/uint16_t unshield_file_flags_raw(Unshield* unshield, int index);
Activity
twogood commentedon Apr 8, 2026
Hi Björn,
I would basically accept this contribution, it just needs to blend in with the existing public API. The current public interface uses
unshield_file_prefix for file information and no existing API takes UnshieldFileGroup* as a parameter.We already have
unshield_file_sizefor the uncompressed size, so it could get a sibling for compressed size.Regarding unshield_get_attributes I guess we also would need to expose the FILE_* values for the flags. Maybe a name like
unshield_file_raw_flagsorunshield_file_flags_rawwould be more suitable to blend in?So maybe these functions?
uint64_t unshield_file_size_compressed(Unshield* unshield, int index);
uint32_t/uint16_t unshield_file_flags_raw(Unshield* unshield, int index);
Cheers,
David
ScaledLizard commentedon Apr 8, 2026
Here is the pull request:
#230