CK_HS_SET(3)
β¨ CK_HS_SET(3) β¨
okay bestie, welcome to ck_hs_set β the store-a-key-in-a-hash-set girlie π
this one lives in the Concurrency Kit, aka libck, so link it with -lck and you're golden π«Ά
π LIBRARY
Concurrency Kit (libck, -lck) β she's iconic, she's threaded, she's serving concurrency π§
πΈ SYNOPSIS
#include <ck_hs.h>
bool
ck_hs_set(ck_hs_t *hs, unsigned long hash, const void *key,
void **previous);
like. look at her. four args. zero drama. β¨
π DESCRIPTION
so ck_hs_set(3) literally takes the key you hand it in the key argument and stores it inside the hash set that hs points to π
but here's the tea β β the key you pass is expected to already have the hash value you put in the hash argument, and that hash was previously generated using the CK_HS_HASH(3) macro. so like, don't just make one up, bestie, that's not the vibe π
if the call to ck_hs_set(3) was successful, then your key was successfully stored in the hash set pointed to by hs. slay. β
and if the key already exists in the hash set? okay so then it gets replaced by key, and the previous value gets stored into the void pointer that previous points to π
β οΈ and ifpreviousis set toNULL, thenkeywas not a replacement for an existing entry in the hash set. no previous value for you, babe π
π RETURN VALUES
upon successful completion, ck_hs_set(3) returns true π otherwise it returns false on failure π periodt.
π¨ ERRORS
behavior is undefined if key or hs are uninitialized. like genuinely undefined, we're not playing, don't do that π
βοΈ
the function will also return false if the hash set could not be enlarged to accomodate key insertion. she tried to grow, she couldn't, it's a whole thing π
π 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_get(3)ck_hs_put(3)ck_hs_put_unique(3)ck_hs_fas(3)ck_hs_remove(3)ck_hs_grow(3)ck_hs_gc(3)ck_hs_rebuild(3)ck_hs_count(3)ck_hs_reset(3)ck_hs_reset_size(3)ck_hs_stat(3)
additional information is available at http://concurrencykit.org/ π
okay that's the whole page bestie, go forth and set your keys πβ¨ππ¦πΈπ π«Ά
Concurrency Kit, September 17, 2012 β CK_HS_SET(3) π no cap, that's the version and the date, mwah π
π¦ 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