Skip to content

Commit

Permalink
Remove unused functions rz_search_find, listcb
Browse files Browse the repository at this point in the history
  • Loading branch information
DMaroo committed Apr 2, 2022
1 parent 12e7116 commit a9c1ca5
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 25 deletions.
2 changes: 1 addition & 1 deletion librz/core/cmd/cmd_search.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ static void do_string_search(RzCore *core, struct search_parameters *param) {
return;
}
if (search->params->backwards) {
rz_search_string_prepare_backward(search);
rz_search_params_string_prepare_backward(search->params);
}
rz_cons_break_push(NULL, NULL);
// TODO search cross boundary
Expand Down
1 change: 0 additions & 1 deletion librz/include/rz_search.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ RZ_API RzSearch *rz_search_new(RZ_OWN RZ_NONNULL RzSearchParams *params);
RZ_API int rz_search_params_set_mode(RzSearchParams *params, RzSearchMode mode);
RZ_API RzSearch *rz_search_free(RzSearch *s);

RZ_API RzList /*<RzSearchHit>*/ *rz_search_find(RzSearch *s, ut64 addr, const ut8 *buf, int len);
RZ_API int rz_search_update(RzSearch *s, ut64 from, const ut8 *buf, long len);

/* keyword management */
Expand Down
24 changes: 1 addition & 23 deletions librz/search/search.c
Original file line number Diff line number Diff line change
Expand Up @@ -508,28 +508,6 @@ RZ_API int rz_search_update(RzSearch *s, ut64 from, const ut8 *buf, long len) {
return ret;
}

static int listcb(RzSearchKeyword *k, void *user, ut64 addr) {
RzSearchHit *hit = RZ_NEW0(RzSearchHit);
if (!hit) {
return 0;
}
hit->kw = k;
hit->addr = addr;
rz_list_append(user, hit);
return 1;
}

RZ_API RzList *rz_search_find(RzSearch *s, ut64 addr, const ut8 *buf, int len) {
RzList *ret = rz_list_new();
if (!s->callback) {
rz_search_set_callback(s, listcb, ret);
} else {
rz_search_set_callback(s, s->callback, ret);
}
rz_search_update(s, addr, buf, len);
return ret;
}

/* --- keywords --- */
RZ_API int rz_search_params_kw_add(RzSearchParams *params, RzSearchKeyword *kw) {
if (!kw || !kw->keyword_length) {
Expand All @@ -541,7 +519,7 @@ RZ_API int rz_search_params_kw_add(RzSearchParams *params, RzSearchKeyword *kw)
}

// Reverse bin_keyword & bin_binmask for backward search
RZ_API void rz_search_string_prepare_backward(RzSearchParams *params) {
RZ_API void rz_search_params_string_prepare_backward(RzSearchParams *params) {
RzListIter *iter;
RzSearchKeyword *kw;
// Precondition: !kw->binmask_length || kw->keyword_length % kw->binmask_length == 0
Expand Down

0 comments on commit a9c1ca5

Please sign in to comment.