Add support for including slices of binary files #192
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds 2 new forms of
incbin
:incbin(relative_filename, start)
: includesrelative_filename
starting from offsetstart
incbin(relative_filename, start, size)
: includessize
bytes fromrelative_filename
starting from offsetstart
I'd also like to make
incbinstr
andinchexstr
work similarly, but I'm not sure how to make it work (extra clarification for PR message that wasn't in the commit message:incbinstr
andinchexstr
go straight from a bitvec to a bigint with no interveningVec<u8>
step, so I can't slice it as easily as I canincbin
).When #191 gets merged,
ensure_inc_args
can be replaced with a call toquery.ensure_min_max_arg_number(1,3)?;
. Since I don't have that merged locally, I just wrote a quick and dirty function to do it.