Repository navigation
Add two functions to retrieve more file data - #230
Conversation
…ressed, unshield_file_flags_raw
Let's have consistent signatures and potentially fix these in twogood#227 Co-authored-by: Steffen Pankratz <kratz00@gmx.de> Signed-off-by: David Eriksson <david@activout.se>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 11 minutes. View limit details
WalkthroughTwo new public API functions are added to expose file metadata: Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes 🚥 Pre-merge checks | ✅ 3
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🐰 Two new friends hop into the fold, Comment |
There was a problem hiding this comment.
♻️ Duplicate comments (1)
lib/libunshield.h (1)
122-122:⚠️ Potential issue | 🟠 MajorExpose the file flag constants alongside
unshield_file_flags_raw.Without the
FILE_*flag definitions (currently in internallib/cabfile.h), consumers ofunshield_file_flags_rawhave no way to interpret the returneduint16_t. Please move/copy the relevant flag constants (e.g.FILE_COMPRESSED,FILE_INVALID,FILE_SPLIT,FILE_OBFUSCATED) into this public header so the new accessor is actually usable.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@lib/libunshield.h` at line 122, Add the file flag constants used by unshield_file_flags_raw to the public header so callers can interpret the returned uint16_t: copy or move the relevant definitions (e.g. FILE_COMPRESSED, FILE_INVALID, FILE_SPLIT, FILE_OBFUSCATED and any associated bit masks) from internal lib/cabfile.h into lib/libunshield.h, ensure they use the same integer types and values as the originals, and keep them guarded by the same visibility macro (UNSHIELD_API or plain defines) so consumers can include libunshield.h and decode the flags returned by unshield_file_flags_raw.
🧹 Nitpick comments (1)
lib/libunshield.h (1)
121-122: Optional: align declarations with the existing column layout.Neighboring declarations (lines 115–120) align return types into a fixed column; the two new lines break that alignment and push the parameter list out. Purely cosmetic — feel free to ignore.
Proposed tweak
-UNSHIELD_API uint64_t unshield_file_size_compressed(Unshield* unshield, int index); -UNSHIELD_API uint16_t unshield_file_flags_raw (Unshield* unshield, int index); +UNSHIELD_API uint64_t unshield_file_size_compressed (Unshield* unshield, int index); +UNSHIELD_API uint16_t unshield_file_flags_raw (Unshield* unshield, int index);🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@lib/libunshield.h` around lines 121 - 122, The two new declarations unshield_file_size_compressed and unshield_file_flags_raw break the header's column alignment; update their spacing to match the existing declaration layout (align the return types and push parameter lists into the same column as other prototypes) so they visually line up with the neighboring declarations like the ones at lines 115–120; adjust spaces between UNSHIELD_API, the return type (uint64_t / uint16_t), the function name, and the parameter list to follow the established column alignment.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@lib/libunshield.h`:
- Line 122: Add the file flag constants used by unshield_file_flags_raw to the
public header so callers can interpret the returned uint16_t: copy or move the
relevant definitions (e.g. FILE_COMPRESSED, FILE_INVALID, FILE_SPLIT,
FILE_OBFUSCATED and any associated bit masks) from internal lib/cabfile.h into
lib/libunshield.h, ensure they use the same integer types and values as the
originals, and keep them guarded by the same visibility macro (UNSHIELD_API or
plain defines) so consumers can include libunshield.h and decode the flags
returned by unshield_file_flags_raw.
---
Nitpick comments:
In `@lib/libunshield.h`:
- Around line 121-122: The two new declarations unshield_file_size_compressed
and unshield_file_flags_raw break the header's column alignment; update their
spacing to match the existing declaration layout (align the return types and
push parameter lists into the same column as other prototypes) so they visually
line up with the neighboring declarations like the ones at lines 115–120; adjust
spaces between UNSHIELD_API, the return type (uint64_t / uint16_t), the function
name, and the parameter list to follow the established column alignment.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: bedb9870-a1a1-4c0b-a022-510ba54c6d86
📒 Files selected for processing (2)
lib/file.clib/libunshield.h
…ressed, unshield_file_flags_raw
Let's have consistent signatures and potentially fix these in twogood#227 Co-authored-by: Steffen Pankratz <kratz00@gmx.de> Signed-off-by: David Eriksson <david@activout.se>
de20f1c to
ae804d2
Compare
|
What this change does: Adds accessors for compressed size and raw file flags. Compressed size is useful to library clients inspecting archives without extracting them. Should fix: Publish and document the flag constants alongside The existing macOS suite passed (24/24). I found no new extraction regression in the accessor implementation. #227 also contains these accessors, so the two PRs overlap. Verdict: A useful, modest contribution. Merge with the flag definitions/documentation and keep the accessor addition in this PR. Branch update correction: The initial update used a force-pushed rebase. The original PR commits have now been restored as first-parent history with a merge commit, pushed normally without force. Both the original and previously rebased commits remain reachable. The reviewed file contents are unchanged. Review basis: main |
Restore the original contribution commits as the first-parent history. Keep the reviewed conflict resolutions and current main without rewriting published history again.
|
Thanks @ScaledLizard ! |
Add two functions to retrieve more file data: unshield_file_size_compressed, unshield_file_flags_raw.
Since the functions return uint64_t and uint16_t, we should also add this:
#include <stdint.h>
Summary by CodeRabbit