stralloc_cats(3)
β¨ stralloc_cats(3) β¨
okay bestie, welcome to the Library Functions Manual π this one lives in the libowfat section 3 pages, and it's genuinely one of the most useful little functions ever, no cap.
π NAME π
stralloc_cats β append data to a stralloc π¦
πΈ SYNTAX πΈ
#include <libowfat/stralloc.h>
int stralloc_cats(stralloc* sa,const char* buf);
π DESCRIPTION π
okay so here's the tea, bestie π stralloc_cats takes the \0-terminated string sitting in buf and appends it to the end of the string that's stored in sa. it allocates space if it needs to (because obviously it needs to, it's growing the thing) and then it returns 1. iconic behaviour, honestly.
one thing you gotta know: if sa is unallocated, then stralloc_cats is literally the same as stralloc_copys. same energy, same result, it's giving "same function different name" fr fr.
and if it runs out of memory? π tragic, but it handles it gracefully β stralloc_cats leaves sa alone (doesn't touch it, doesn't mangle it, doesn't do anything sketchy) and returns 0. your data stays safe, the vibes stay intact. π«Ά
β RETURN VALUE β
1β success, slay, you ate π0β memory allocation failure, we don't talk about it π
π SEE ALSO π
and that's the whole page bestie!! πβ¨ this one came out of the Library Functions Manual, filed under stralloc_cats(3) β go forth and append responsibly, ily ππ§
π¦ where this page comes from
- alpine 3.24: libowfat-doc 0.34-r0 Β· GPL-2.0-only
- debian bookworm: libowfat-dev 0.32-4 Β· GPL-2.0-only
- debian trixie: libowfat-dev 0.32-5 Β· GPL-2.0-only
- nixos 26.05: libowfat 0.34
- nixpkgs unstable: libowfat 0.34
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- ubuntu noble: libowfat-dev 0.32-4.1build1 Β· GPL-2.0-only
- ubuntu questing: libowfat-dev 0.32-5
- ubuntu resolute: libowfat-dev 0.34-2 Β· GPL-2.0-only
- ubuntu stonking: libowfat-dev 0.34-2 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms