TICKIT_UTF8_PUT(3)
π TICKIT_UTF8_PUT π
okay bestie, welcome to the tickit_utf8_put page, straight out of the Library Functions Manual β¨ this one's a lil cutie: it's the function that takes a codepoint and yeets the right UTF-8 bytes into your buffer. lowkey iconic behavior.
π NAME π
tickit_utf8_put β append a UTF-8 encoded codepoint to a buffer π¦
β¨ SYNOPSIS β¨
#include <tickit.h>
size_t tickit_utf8_put(char *str, size_t len, long codepoint);
Link with -ltickit. yes bestie you gotta link it, no cap π
πΈ DESCRIPTION πΈ
so here's the tea, fr fr. tickit_utf8_put() appends bytes into a buffer so that the buffer represents the codepoint you handed it. the UTF-8 bytes go in directly, starting right at str, and then the function hands you back the total number of bytes it appended. that's it, that's the whole vibe. β¨
you tell it how much room it's got with len. and listen β if the buffer is not long enough, it does not half-write anything: the buffer gets left unmodified and you get -1 back instead. no messy leftovers, we love a clean exit π
also, plot twist: if str is NULL, the function doesn't write anything at all β it just returns the number of bytes it would need to represent that codepoint. perfect for when you're just doing a lil vibe check on the size first, iykyk π§
π IMPORTANT: this function does not expect your buffer to be NUL-terminated, and it will not terminate the buffer with a NUL byte when it's done. do not assume there's a '\0' waiting at the end. there is not. it's giving DIY energy, you handle that part yourself bestie π
π₯ RETURN VALUE π₯
tickit_utf8_put() returns the number of bytes appended to the buffer, or -1 if the buffer was not long enough. that's the whole menu π
π SEE ALSO π
go read those too, they're the besties of this page π«Ά
and that's a wrap on TICKIT_UTF8_PUT(3), Library Functions Manual edition β the footer said TICKIT_UTF8_PUT(3) and honestly? periodt. πβ¨π go append some codepoints, main character πβ
π¦ where this page comes from
- alpine 3.24: libtickit-doc 0.4.6-r0 Β· MIT
- debian bookworm: libtickit-dev 0.4.3-1 Β· MIT
- debian trixie: libtickit-dev 0.4.3-2 Β· MIT
- fedora 43: libtickit-devel 0.4.5-2.fc43 Β· MIT
- fedora 43: libtickit-devel 0.4.5-2.fc43 Β· MIT
- fedora 44: libtickit-devel 0.4.5-3.fc44 Β· MIT
- fedora 44: libtickit-devel 0.4.5-3.fc44 Β· MIT
- nixos 26.05: libtickit 0.4.5
- nixpkgs unstable: libtickit 0.4.6
- ubuntu jammy: libtickit-dev 0.4.1-1 Β· MIT
- ubuntu noble: libtickit-dev 0.4.3-1.1build1 Β· MIT
- ubuntu questing: libtickit-dev 0.4.3-2
- ubuntu resolute: libtickit-dev 0.4.3-2build1 Β· MIT
- ubuntu stonking: libtickit-dev 0.4.3-2build1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms