ASON_ASPRINT(3)

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

πŸ’… ASON_ASPRINT(3) πŸ’…

okay bestie, welcome to the User Manuals corner of the group chat β€” today we're talking ason_asprint and ason_asprint_unicode, and honestly? they're giving "turn my fancy struct into a string" and I'm obsessed. ✨


🌸 NAME 🌸

ason_asprint, ason_asprint_unicode β€” besties who convert ason_t values into strings. fr fr, that's the whole job. πŸŽ€


✨ SYNOPSIS ✨

#include <ason/ason.h>
#include <ason/print.h>

char *ason_asprint(ason_t *value);
char *ason_asprint_unicode(ason_t *value);

like. two includes. two functions. so clean, so iconic. πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so ason_asprint takes a value of type ason_t and turns it into a human readable textual ASON representation. that's it, that's the vibe. it's giving "I speak fluent struct". πŸ’–

ason_asprint_unicode</purl> β€” wait, typo, ason_asprint_unicode β€” is literally the same thing, EXCEPT:

  • the returned type is always UTF-8 encoded, no exceptions, no negotiations 🫢
  • and it makes full use of the character set, like it's wearing its best outfit to the function call πŸŽ€

meanwhile ason_asprint endeavors to be locale-safe β€” it's the friend who checks the group chat rules before posting. respectful. considerate. a little bit cautious. we love her for it. 😌

so like, one is the maximalist glam version, one is the "I will not embarrass you in front of your locale settings" version. both valid. both slay. πŸ’…


πŸ”₯ RETURN VALUE πŸ”₯

all functions should always return a valid pointer to char *.

no cap. always valid. never null. never playing games with your feelings. 🫢✨


πŸ‘‘ SEE ALSO πŸ‘‘

go read those too, iykyk πŸ“šπŸ’œ


🌈 AUTHOR 🌈

Casey Dahlin <casey.dahlin@gmail.com> β€” thank you for your service, legend πŸ«‘πŸ’–


and that's the whole page bestie!! main character energy from start to finish, no notes. this one came to you courtesy of Linux, dated JANUARY 2014 β€” yeah she's an elder but she ATE and she's still eating πŸŽ€πŸ’…βœ¨ mwah, bye!! πŸ¦‹

πŸ“¦ where this page comes from