CK_RHS_APPLY(3)
π CK_RHS_APPLY(3) π
okay bestie, welcome to the ck_rhs_apply(3) page β this is the Concurrency Kit one, and honestly? it's giving "let me just casually reach into a hash set and do a lil something to a value" β¨
πΈ NAME πΈ
ck_rhs_apply β apply a function to hash set value π
π LIBRARY π
Concurrency Kit (libck, -lck) π«Ά
β¨ SYNOPSIS β¨
#include <ck_rhs.h>
void *
ck_rhs_apply_fn_t(void *key, void *closure);
bool
ck_rhs_apply(ck_rhs_t *hs, unsigned long hash, const void *key,
ck_rhs_apply_fn_t *function, void *argument);
π DESCRIPTION π
so here's the tea β β ck_rhs_apply(3) goes and looks up the hash set slot that's associated with key, and then it hands that slot over to the function pointed to by function so it can do its lil thing π₯
and like, this callback is lowkey powerful: it can remove or replace the value. how? by returning NULL to remove it, or by returning a pointer to another object that has an identical key to replace it. iconic behaviour, no cap π
the first argument that gets passed to function is a pointer to the object that was found in the hash set, and the second argument is the argument pointer that you passed in to ck_rhs_apply(3) itself. cute, right? π
and if the pointer that function returns is equivalent to that first argument? then literally nothing happens β no modification is made to the hash set. it's giving "we're good, no changes needed" π
π RETURN VALUES π
- if it all goes well,
ck_rhs_apply(3)returnstrueπ - otherwise it returns
falseon failure π
π¦ SEE ALSO π¦
go read these next bestie, they're all part of the same friend group:
ck_rhs_init(3)ck_rhs_move(3)ck_rhs_destroy(3)ck_rhs_fas(3)CK_RHS_HASH(3)ck_rhs_iterator_init(3)ck_rhs_next(3)ck_rhs_get(3)ck_rhs_put(3)ck_rhs_put_unique(3)ck_rhs_remove(3)ck_rhs_grow(3)ck_rhs_rebuild(3)ck_rhs_gc(3)ck_rhs_count(3)ck_rhs_reset(3)ck_rhs_reset_size(3)ck_rhs_stat(3)
additional info available at http://concurrencykit.org/ π
and that's a wrap, babes π this page is from September 1, 2014, and it's CK_RHS_APPLY(3) β slay, periodt β¨ππ
π¦ where this page comes from
- alpine 3.24: ck-doc 0.7.2-r1 Β· BSD-2-Clause AND Apache-2.0
- debian bookworm: libck-dev 0.7.1-10 Β· BSD-2-Clause
- debian trixie: libck-dev 0.7.2-6 Β· BSD-2-Clause
- epel 10: ck-devel 0.7.2-1.el10_1 Β· BSD-2-clause AND Apache-2.0 AND BSD-3-clause
- epel 9: ck-devel 0.7.0-10.el9 Β· BSD
- fedora 43: ck-devel 0.7.2-2.fc43 Β· BSD-2-clause AND Apache-2.0 AND BSD-3-clause
- fedora 43: ck-devel 0.7.2-2.fc43 Β· BSD-2-clause AND Apache-2.0 AND BSD-3-clause
- fedora 44: ck-devel 0.7.2-4.fc44 Β· BSD-2-clause AND Apache-2.0 AND BSD-3-clause
- fedora 44: ck-devel 0.7.2-4.fc44 Β· BSD-2-clause AND Apache-2.0 AND BSD-3-clause
- nixos 26.05: ck 0.7.2
- nixpkgs unstable: ck 0.7.2
- opensuse-leap 16.0: ck-devel 0.7.2-bp160.1.9 Β· Apache-2.0 AND BSD-2-Clause
- opensuse-leap 16.0: ck-devel 0.7.2-bp160.1.9 Β· Apache-2.0 AND BSD-2-Clause
- opensuse-leap 16.0: ck-devel 0.7.2-bp160.1.9 Β· Apache-2.0 AND BSD-2-Clause
- ubuntu jammy: libck-dev 0.7.1-6ubuntu2 Β· BSD-2-Clause
- ubuntu noble: libck-dev 0.7.1-13build1 Β· BSD-2-Clause
- ubuntu questing: libck-dev 0.7.2-5ubuntu1
- ubuntu resolute: libck-dev 0.7.2-5ubuntu2 Β· BSD-2-Clause
- ubuntu stonking: libck-dev 0.7.2-11 Β· BSD-2-Clause
- Copyright 2014 Samy Al Bahra
- Copyright 2014 Backtrace I/O, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms