Skip to content
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

Refactor sdb_foreach and related APIs #4471

Merged
merged 9 commits into from
May 6, 2024
Merged

Conversation

pelijah
Copy link
Contributor

@pelijah pelijah commented May 5, 2024

Your checklist for this pull request

  • I've read the guidelines for contributing to this repository
  • I made sure to follow the project's coding style
  • I've documented or updated the documentation of every function and struct this PR changes. If not so I've explained why.
  • I've added tests that prove my fix is effective or that my feature works (if possible)
  • I've updated the rizin book with the relevant information (if needed)

Detailed description

  • sdb_dump_dupnext() was replaced with sdb_dump_next() which returns pointers to mmaped/buffered file (sdb_const_get() already does the same thing)
  • sdb_dump_next() reads KV until start of hashes table is reached
  • sdb_foreach() now passes key/value lengthes SdbKv to a callback
  • sdb_foreach_list*() APIs were replaced with sdb_get_kv_list*() which return RzList sdb_get_items*() which return RzPVector instead of SdbList (it is the first step of getting rid of SdbList)

Test plan

...

Closing issues

...

XVilka

This comment was marked as resolved.

@XVilka

This comment has been minimized.

Copy link
Member

@XVilka XVilka left a comment

Choose a reason for hiding this comment

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

LGTM but needs minor renaming

librz/util/sdb/src/sdb.c Outdated Show resolved Hide resolved
librz/util/sdb/src/sdb.c Outdated Show resolved Hide resolved
librz/util/sdb/src/sdb.c Outdated Show resolved Hide resolved
librz/util/sdb/src/sdb.c Outdated Show resolved Hide resolved
librz/util/sdb/src/sdb.c Outdated Show resolved Hide resolved
librz/core/cmd/cmd_search.c Outdated Show resolved Hide resolved
librz/core/cbin.c Outdated Show resolved Hide resolved
librz/arch/platform_target_index.c Outdated Show resolved Hide resolved
librz/arch/cc.c Outdated Show resolved Hide resolved
librz/arch/analysis.c Outdated Show resolved Hide resolved
@XVilka XVilka merged commit f818ca4 into rizinorg:dev May 6, 2024
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants