tld_strerror(3)

✨ tld_strerror ✨

ok bestie, welcome to tld_strerror(3) from libidn πŸ’– this one's a lil API function and it's honestly so useful, it's giving "translator for your error codes" energy 🫢


🌸 SYNOPSIS 🌸

#include <tld.h>

const char * tld_strerror(Tld_rc rc);

πŸŽ€ ARGUMENTS πŸŽ€

  • Tld_rc rc β€” bestie this is the tld return code, like the lil number your function handed back that you're now staring at like ??? πŸ‘€

πŸ’… DESCRIPTION πŸ’…

okay so what this does: it takes a return code integer and converts it into a text string. That's it. That's the whole vibe. ✨ And why do you want that? So you can output a diagnostic message to the user β€” i.e. turn a cryptic number into actual words a human can read, no cap πŸ“’


the return codes, one by one πŸ¦‹

TLD_SUCCESS

Successful operation πŸŽ‰ This value is guaranteed to always be zero β€” like, always, it's the whole point. The remaining ones are only guaranteed to hold non-zero values, and that guarantee is for logical comparison purposes. So don't get cute and assume a specific nonzero number, bestie, just compare against zero 🫢

TLD_INVALID

Invalid character found πŸ™ˆ something in there was not it.

TLD_NODATA

No input data was provided 😭 you gave it nothing. empty. void. nada.

TLD_MALLOC_ERROR

Error during memory allocation πŸ’€ the allocator said no.

TLD_ICONV_ERROR

Character encoding conversion error 🌈 something got lost in translation, literally.

TLD_NO_TLD

No top-level domain found in domain string πŸ‘‘ the TLD was simply not in the building. it did not show up.


Return value πŸ’–

Returns a pointer to a statically allocated string containing a description of the error with the return code rc. (static = don't you dare free it, don't you dare modify it, just read it and move on ✨)


😭 REPORTING BUGS 😭

Found a bug? Report it to help-libidn@gnu.org β€” they wanna hear about it fr fr.

General guidelines for reporting bugs live at: https://www.gnu.org/gethelp/

GNU Libidn home page: https://www.gnu.org/software/libidn/


Copyright Β© 2002-2026 Simon Josefsson.

Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. slay, that's a very generous license πŸ’œ


🌈 SEE ALSO 🌈

The full documentation for libidn is maintained as a Texinfo manual. If the info and libidn programs are properly installed at your site, the command

info libidn

should give you access to the complete manual ✨ As an alternative you may obtain the manual from:

https://www.gnu.org/software/libidn/manual/

and that's the whole page, bestie πŸŽ€ this is from libidn version 1.44, page tld_strerror(3) β€” go forth and turn your error codes into sentences, you absolute main character πŸ‘‘πŸ’–

πŸ“¦ where this page comes from