ASON_COPY(3)

πŸ“¦ version 0.1.2, in fedora 43, fedora 44

πŸ’– ason_copy β€” the manual page, but make it cute

okay bestie, we're doing the ason_copy page from the ASON manual (section 3, the library-call girlies πŸ’…). it's short, it's sweet, and it's lowkey important. let's go πŸ¦‹


✨ NAME ✨

ason_copy β€” Copy an ASON value. πŸŽ€

like. the name literally tells you what it does. copy. an ason. iconic behaviour fr.


🌸 SYNOPSIS 🌸

#include <ason/ason.h>

ason_t *ason_copy(ason_t *a);

that's it. that's the whole vibe. one include, one function, one pointer. no cap. ✨


πŸ’œ DESCRIPTION πŸ’œ

so ason_copy copys an ason_t value (yes the original says "copys", we do not fix the original's spelling, we simply respect it 🫢). the result is a new ason_t, and that new one has to have ason_destroy (3) called on it separately. like, its own separate cleanup. its own separate journey. you cannot skip it and you cannot merge it with anything else. periodt. πŸ’…

⚠️ okay this next bit is the real tea, so listen up bestie: libason may actually use refcounting internally to distinguish objects. but here's the thing β€” your program should always behave as though ason_copy returns a new pointer. always. no exceptions. πŸ™ˆ

and because of that: you should never use pointer comparison to inspect pointers to ason_t. like, don't be out here doing == on your ason_t pointers and expecting it to mean something. it doesn't. it will not. the internals are doing their own little refcount dance behind the curtain and you are NOT invited backstage. πŸ’€


πŸ”₯ RETURN VALUE πŸ”₯

ason_copy always returns a valid pointer to ason_t. πŸŽ‰

not sometimes. not maybe. always. she never misses. no NULL check anxiety required, queen πŸ‘‘


πŸ¦‹ SEE ALSO πŸ¦‹

  • ason (3) β€” the main character of this whole library, obviously πŸ‘‘
  • ason_destroy (3) β€” the one you MUST call on the copy you just made, do not forget her πŸ₯Ί

🧚 AUTHOR 🧚

Casey Dahlin <casey.dahlin@gmail.com> β€” the legend who wrote this, we stan πŸ’–


and that's the whole page bestie!! this one came from the Linux manual, the JANUARY 2014 edition, filed under ASON COPY(3) β€” so yeah, she's an elder but she's still slaying, go call ason_destroy on your copies and hydrate πŸ’§πŸ’…βœ¨

πŸ“¦ where this page comes from