stralloc_copym(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

πŸ’– NAME πŸ’–

stralloc_copym β€” copy string(s) to a stralloc

okay so bestie, this is the one that copies a whole lil squad of strings into a stralloc for you. no cap. 🫢


✨ SYNTAX ✨

#include <libowfat/stralloc.h>

int stralloc_copym(stralloc* sa,const char* s, ...);

🌸 DESCRIPTION 🌸

stralloc_copym copies the \0-terminated strings from s... into sa, allocating space if necessary, and returns 1. and like, if there's already data chillin' in sa, it gets cleared first. bye bestie πŸ‘‹πŸ’…

if it runs out of memory, stralloc_copym returns 0. and at that point? it may already have copied a few of the strings to sa. so like, it's giving partial success but make it an L. 😭

bestie pls note: when it fails, some strings might already be in there. it does not roll back. that's just how it is. πŸ™ˆ

⭐ RETURN VALUE ⭐

  • 1 β€” success, slay πŸ‘‘
  • 0 β€” memory allocation failure, the vibes are off πŸ’€

πŸ¦‹ SEE ALSO πŸ¦‹


and that's the whole thing bestie!! this lil page is stralloc_copym(3) from the Library Functions Manual β€” go forth and copy those strings, periodt. πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ«Ά