stralloc_init(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_init(3) ✨

okay bestie, so you know how we're deep in the libowfat cinematic universe? yeah. this is one of those little pages from the Library Functions Manual and honestly it's giving "short but essential." πŸŽ€


🌸 NAME 🌸

stralloc_init β€” initialize a stralloc πŸ’–


πŸ¦‹ SYNTAX πŸ¦‹

#include <libowfat/stralloc.h>

void stralloc_init(stralloc* sa);

✨ DESCRIPTION ✨

okay so stralloc_init initializes a stralloc to the empty string. that's it. that's the whole job. no cap. πŸ’…

but listen, bestie, because this part is important:

it does not free any memory previously associated with a stralloc. 🫢

so if you've got a stralloc that's holding onto stuff and you just yeet stralloc_init at it, the memory's still there, lowkey just vibing unattached. not the move if you wanted cleanup.

want that memory gone-gone? use stralloc_free(3) for that. 🧚

and if all you want is to empty a stralloc β€” like, make it the empty string but keep the memory situation chill β€” use stralloc_zero(sa) instead. ✨

so to recap the vibe check:

  • new stralloc, no memory yet β†’ stralloc_init πŸ‘‘
  • got memory, want it freed β†’ stralloc_free(3) πŸ“
  • got a stralloc, want it empty β†’ stralloc_zero(sa) 🌈

⭐ RETURN VALUE ⭐

none.

literally nothing. it returns void. it does the thing and walks away. main character energy. πŸ˜­πŸ’œ


🌸 SEE ALSO 🌸


k bye bestie, go init your strallocs responsibly πŸ¦‹βœ¨ this was stralloc_init(3) from the Library Functions Manual, signing off with love πŸ’–πŸ’