PX_STRDUP(3)

✨ PX_STRDUP ✨

okay bestie, welcome to the PX_STRDUP(3) page from the Library Functions Manual β€” yes that's the section 3 girly, the one for library functions, and she's here to duplicate a string for you πŸ’–


πŸŽ€ NAME πŸŽ€

PX_strdup β€” duplicate a string

πŸ¦‹ SYNOPSIS πŸ¦‹

#include <paradox.h>

char * PX_strdup(pxdoc_t *pxdoc, const char *str)

πŸ’… DESCRIPTION πŸ’…

so like. this function duplicates a string, fr fr. it's basically doing the strdup(3) thing you already know and love, except β€” and this is the part that's giving main character energy β€” it uses the memory allocation function that you passed to PX_new2(3). so the memory comes from your allocator, not just whatever the system felt like using. iconic behaviour honestly πŸ‘‘

🌸 RETURN VALUE 🌸

  • on success? you get a pointer to the string back. slay ✨
  • on failure? you get NULL. and that's it. that's the whole vibe. no cap 😭

πŸ”₯ SEE ALSO πŸ”₯

  • PX_new2(3) β€” go read it, that's where your memory allocation function comes from, iykyk

πŸ‘‘ AUTHOR πŸ‘‘

this manual page was written by Uwe Steinmann uwe@steinmann.cx. thank you for your service 🫢


and that's a wrap bestie!! the header up top and the footer down bottom both just say PX_STRDUP(3), from the Library Functions Manual β€” no date stamp, no version number, just her name in lights 🌟 go forth and duplicate responsibly πŸ’–πŸ¦‹πŸŒΈ