CK_HS_GET(3)
π CK_HS_GET β bestie, let's go get that key π
okay so real talk, this is a page from the Concurrency Kit manual, and the library you want is libck β link it with -lck and you're golden β¨
πΈ SYNOPSIS πΈ
#include <ck_hs.h>
void *
ck_hs_get(ck_hs_t *hs, unsigned long hash, const void *key);
π¦ DESCRIPTION π¦
okay so ck_hs_get(3) is literally the "hey do I know you?" function of the hash set world π
It hands you back a pointer to a key inside the hash set hs that is of equivalent value to the object that key points at. So like, it's not necessarily the same object, it's the matching one, iykyk.
Now listen β the key you pass in as key is expected to already have the hash value you're passing as hash. And that hash? It's supposed to have been generated beforehand using the CK_HS_HASH(3) macro. No cap, don't just make one up π
π RETURN VALUES π
- If the key you handed over is a member of
hs, you get back a pointer to the key as it's stored inhs. not a copy, the actual one, periodt. - If the key was not found in
hs? You getNULL. that's it. that's the whole vibe check. π
π ERRORS π
Behavior is undefined ifentryorhsare uninitialized. bestie I am begging you, initialize your stuff first. undefined behavior is not the moment, fr fr. π¨
π SEE ALSO π
ck_hs_init(3)ck_hs_move(3)ck_hs_destroy(3)CK_HS_HASH(3)ck_hs_iterator_init(3)ck_hs_next(3)ck_hs_put(3)ck_hs_put_unique(3)ck_hs_set(3)ck_hs_fas(3)ck_hs_remove(3)ck_hs_grow(3)ck_hs_rebuild(3)ck_hs_gc(3)ck_hs_count(3)ck_hs_reset(3)ck_hs_reset_size(3)ck_hs_stat(3)
More info? It's all waiting for you at http://concurrencykit.org/ π
and that's the whole page bestie π«Ά this one came out on September 17, 2012, from the Concurrency Kit crew β go forth, hash responsibly, and slay π β¨
π¦ 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 2012-2013 Samy Al Bahra
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms