CK_ARRAY_PUT_UNIQUE(3)
π ck_array_put_unique β the manual page, but make it bestie π
okay so bestie, you know ck_array_put_unique(3)? yeah. the Concurrency Kit girlies know. it's from libck, you link it with -lck, and it's about slipping a unique pointer into an array. no dupes. no drama. let's get into it β¨
πΈ NAME πΈ
ck_array_put_unique β attempt immediate or deferred insertion of a unique pointer into array
like. the whole vibe is: put a pointer in the array, but only if it's not already there. unique queen behavior only π
π§ LIBRARY π§
Concurrency Kit (libck, -lck)
β¨ SYNOPSIS β¨
#include <ck_array.h>
int
ck_array_put_unique(ck_array_t *array, void *pointer);
π DESCRIPTION π
so the way that ck_array_put_unique(3) works is β it attempts to insert the value of pointer into the array that array points to. that's the mission. that's the assignment. π«Ά
now, heads up: this function may incur additional memory allocations if not enough memory has been allocated in the array for a new entry. so like, it might go shopping for more memory mid-operation. no cap. π
also, the operation is free to apply the operation immediately if there is an opportunity for elimination with a pending (uncommitted) remove operation. so it might just do the thing right now, right on the spot, if the timing is cute. it's giving main character energy fr fr.
and the most important part: the function will not make any modifications if the pointer already exists in the array. nope. not touching it. if you're already in the club, you're already in the club, we're not re-adding you. periodt. π
π RETURN VALUES π
1β thepointeralready exists in the array. you're already iconic, bestie, nothing to do here π0β the put operation succeeded. slay!! π₯-1β error, because of internal memory allocation failures. it's giving broke. π
π SEE ALSO π
the whole friend group, go read them too:
ck_array_init(3)ck_array_commit(3)ck_array_put(3)ck_array_remove(3)ck_array_deinit(3)ck_array_length(3)ck_array_buffer(3)ck_array_initialized(3)CK_ARRAY_FOREACH(3)
Additional information available at http://concurrencykit.org/ π
okay that's the whole page!! this one is from October 18, 2013 and it lives under the name CK_ARRAY_PUT_UNIQUE(3) β mwah, take care of her, she's an icon πβ¨π
π¦ 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 2013 Samy Al Bahra
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms