-
-
Notifications
You must be signed in to change notification settings - Fork 379
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
Port search commands (/
) to newshell
#2212
Conversation
637b549
to
fdf7318
Compare
602e077
to
67220ef
Compare
f5675f1
to
908f2bf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the RzSearchParameters split make sense, but I'd have a new _new
API that accepts a RzSearchParameters
structure to initialize the search. I think starting writing unit tests will definitely help to find out what is the best way to deal with this.
I'd see something like the following:
RzSearchParams params = {
.mode = RZ_SEARCH_STRING,
.string_min = 3,
.string_max = 10,
};
RzSearch *s = rz_search_new(¶ms);
note that some of the parameters may be meaningful only for a specific "search mode". In such cases it may make sense to have RzSearchParameters composed of a union for the data, selected by the search_mode
field.
@@ -844,6 +844,36 @@ static const ut32 colormap[256] = { | |||
0xffffff, | |||
}; | |||
|
|||
static void incAlphaBuffer(ut8 *buf, int bufsz) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what are these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are some functions that I needed to keep such that the build passes, I will refactor them in the end.
8681936
to
7b7744a
Compare
* This will allow for a generic search function, since all search parameters can be represented using the `RzSearchParams` struct * Also, the struct contains search parameters, so any search function (whose job is to "search") would never need to modify any of these params. This allows for some sort of contraint/invariance and will help in making sure that the search functions which get implemented are correct. * Also added `search.minlength` and `search.maxlength` in `cconfig.c`
* Rename `RzSearchParameters` to `RzSearchParams` * Rename struct member names * Add `rz_search_params_new`, `rz_core_search_params_new` and `rz_search_params_free` * Rename `rz_search_set_mode` to `rz_search_params_set_mode`
…zSearchParams` counterpart
It needs rebase. If you finish some particular command or few of them - probably better to focus on that, so the porting is incremental. Otherwise, we have to postpone this for 0.6.0 |
@DMaroo do you plan to continue working on this? Otherwise it probably better to close this one and start from scratch. |
@XVilka I have been very low on time lately. So I don't expect any progress on this for a while. Closing it seems reasonable. I'll open a new PR whenever I get done with the porting. |
Changes have become stale and there are too many conflicts. Closing this PR for now. ETA on this is undecided. |
I'm going to work on this as discussed on mattermost. I will start with |
Your checklist for this pull request
Detailed description
This PR ports the search commands (
/
) to Rizin newshell.Test plan
Once the porting is done, the build and CI should be green. Maybe I'll add tests for any new features that get added during the porting.
Closing issues
Closes #1586.
Tracked by #1342.