Skip to content

Add two functions to retrieve more file data#230

Open
ScaledLizard wants to merge 1 commit intotwogood:mainfrom
ScaledLizard:pr-file-accessors
Open

Add two functions to retrieve more file data#230
ScaledLizard wants to merge 1 commit intotwogood:mainfrom
ScaledLizard:pr-file-accessors

Conversation

@ScaledLizard
Copy link
Copy Markdown

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>

UNSHIELD_API int unshield_file_directory (Unshield* unshield, int index);
UNSHIELD_API size_t unshield_file_size (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);
Copy link
Copy Markdown
Contributor

@kratz00 kratz00 Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it not make sense to also expose https://github.com/twogood/unshield/blob/main/lib/cabfile.h#L60-L63
otherwise nobody knows what the magic uint16 means?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the flags also need to be moved or copied to the public header.

return 0;
}/*}}}*/

UNSHIELD_API uint64_t unshield_file_size_compressed(Unshield* unshield, int index)/*{{{*/
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
UNSHIELD_API uint64_t unshield_file_size_compressed(Unshield* unshield, int index)/*{{{*/
uint64_t unshield_file_size_compressed(Unshield* unshield, int index)/*{{{*/

It still think this is not needed for function definitions

return 0;
}/*}}}*/

UNSHIELD_API uint16_t unshield_file_flags_raw(Unshield* unshield, int index)/*{{{*/
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
UNSHIELD_API uint16_t unshield_file_flags_raw(Unshield* unshield, int index)/*{{{*/
uint16_t unshield_file_flags_raw(Unshield* unshield, int index)/*{{{*/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants