libcanlock(3)
π
libcanlock β the cl_split era π
okay so real talk, this whole page is about libcanlock (version 3.3.3 manual, bestie, write that down) and specifically about one little function that does one little job and does it flawlessly. no cap.
β¨ NAME β¨
cl_split β splits a Cancel-Key or Cancel-Lock, with libcanlock doing the heavy lifting π«Ά
πΈ SYNOPSIS πΈ
#include <libcanlock-3/canlock.h>
cl_hash_version cl_split(char *input, char **klstring);
and the possible return values, straight from version 3.0.0 of libcanlock, no edits:
CL_INVALID CL_SHA1 CL_SHA224 CL_SHA256 CL_SHA384 CL_SHA512
like. look at that lineup. iconic. π
π¦ DESCRIPTION π¦
so cl_split() takes a <c-key> or a <c-lock> element and splits it, exactly per RFC 8315. that's the whole gig. it's giving "one job, done right."
what happens is: the hash algorithm for <scheme> gets extracted out, and the matching ID for it gets returned. slay. π
but bestie, listen β if that hash algorithm is not found or not supported, you get CL_INVALID back. no exceptions. that's the vibe check failing, sorry.
on success, a pointer to the <c-key-string> or <c-lock-string> element (whichever one applies) gets written to klstring. and here's the cute part: that pointer points inside the string input, so no additional memory is allocated at all. zero. none. it's just pointing at what's already there, which is honestly so efficient of it. π§
on error? NULL gets written to klstring. that's it. that's the whole story. π
β RETURN VALUE β
the hash algorithm ID. and on error, CL_INVALID. periodt. π₯
π AUTHORS π
Michael Baeuerle π
(based in part on lock_strip_alpha() written by G. J. Andruk for Version 2 β shoutout to the ancestors, fr fr π«‘)
π REPORTING BUGS π
found a bug? report it to <mailto:michael.baeuerle@gmx.net>. be nice about it, bestie. π
π STANDARDS π
libcanlock tries to comply with these, and honestly? it ate:
π₯ SEE ALSO π₯
the whole friend group:
and that's the page!! π this was the libcanlock 3.3.3 manual, dated 2026-07-06, brought to you by Unix β mwah, go split some elements responsibly, ily πβ¨
π¦ where this page comes from
- epel 10: libcanlock-devel 3.3.3-2.el10_3 Β· BSD-3-Clause AND NLPL AND ICU
- π the page's license: ICU
- (c) 2018-2024 Michael Baeuerle
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms