-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add io operation callbacks #112
Conversation
Example use in https://github.com/bwrsandman/unshield/blob/io_callbacks_example/src/isocab.c#L80-L366 for reference. |
d79b4cd
to
4258401
Compare
Awesome, looks really great at first glance! Need to review it properly of course. |
In my tests I never had to implement the callback to Also, I wasn't too sure about desired code style so I tired to match it, but let me know if some lines are too long or there's a better form for struct/global names. |
Sorry @bwrsandman for the lack of feedback. It's just that this change is not much of a priority for myself :) |
I'm still open for feedback when you have time. |
@twogood any chance you can have a look at this? |
Thanks for your patience and kind reminder. I'd love to spend more time with unshield but it always comes too far down my list of priorities. I'm running a company and must prioritize paid work and sales activities there. |
96d9169
to
70d65e7
Compare
Rebased and fixed the WIN32 compile error which was de to |
Not too sure why linking with |
appveyor is broken, also due to same constraints on my time |
@twogood can you approve the workflows. |
Well, well, well... hard to argue with those test results... |
I've rebased to trigger the new tests. |
f50514b
to
83a40e0
Compare
I started reviewing this PR and have some remarks:
Thanks in advance @bwrsandman |
83a40e0
to
dd51803
Compare
@kratz00 Thanks for looking into this. I have rebased and fixed the warnings+errors. |
I guess I can merge it with the tests passing and everything. I think what holds me back is that a "simple" function call like this:
Turns into this "monster":
What if it looked something like this instead:
Implemented as:
And so on... Note: dry-coding the above! |
Thanks @bwrsandman looks good now. @twogood
It might make sense to make all those wrapper functions - inline function for performance reasons. |
Yes possible when we have an |
|
b068e9a
to
d4fb646
Compare
I went with using the |
|
Looks so much better, thanks! |
Add `unshield_open2` and `unshield_open2_force_version` to allows overriding `fopen`, `fseek`, `ftell`, `fread`, `fwrite`, `fclose`, `opendir`, `closedir`, `readdir` which lets the user pipe data from a program without doing a round trip to the hard drive
5c5df73
to
96c363f
Compare
I have added a validation test which extracts a file with the contents "TEST" all in stack memory. I'm open to feedback to improve it. Perhaps you can help me make an actual valid I found a few missed callback calls mainly when calling |
96c363f
to
a36f503
Compare
38d09a6
to
d34151f
Compare
Switched to using One thing to note is that |
Yup, we can define what should be the default and add something like
I am good with the current state, thanks for your contribution @bwrsandman 👍 |
Thank you @bwrsandman and @kratz00 ! |
Implementation of #111
Add
unshield_open2
andunshield_open2_force_version
that allows overridingfopen
,fseek
,ftell
,fread
,fwrite
,fclose
,opendir
,closedir
,readdir
which lets the user pipe data from code without doing a roundtrip to the hard drive.