stralloc_cats(3)

πŸ“¦
version 0.34 Β· 2 versions
  • 0.34 Β· alpine 3.24, debian bookworm, debian trixie, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 0.30 Β· fedora 43, fedora 44, ubuntu jammy
, in alpine 3.24, debian bookworm, debian trixie, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ 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 πŸ’œπŸ§š