diff options
author | Jo-Philipp Wich <jo@mein.io> | 2024-10-11 19:10:59 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2024-12-02 15:07:26 +0100 |
commit | 47b54cf5a4b6166944efa4ee4cd023d73ebe6c3e (patch) | |
tree | 93f53b0374553d5647d6cef4797bf08daa105e12 /vm.c | |
parent | b0b5d93846a1fb9d1d94992d5fdf508ef345e87d (diff) |
types: introduce `ucv_array_sort_r()` and `ucv_object_sort_r()`
Introduce two new functions for ordering arrays and object keys which
utilize a different compare callback signature and allow passing a user
provided pointer to the comparison callback.
The main advantages of the `ucv_*_sort_r()` flavors are the ability to
pass custom context to comparisons via the user data pointer and the
invocation of the comparison callback with direct `uc_value_t *` pointers
instead of opaque `const void *` arguments pointing to `uc_value_t *` or
json-c internal `struct lh_entry *` pointers respectively.
Suggested-by: Isaac de Wolff <idewolff@vincitech.nl>
[align naming and whitespace with the rest of the codebase, rename some
variables for clarity, group sort related changes into two commits,
drop constness from `uc_value_t *` compare function arguments]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'vm.c')
0 files changed, 0 insertions, 0 deletions