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 π
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
- arch rolling: libidn 1.44-1 Β· GPL3 AND LGPL
- epel 10: libidn-devel 1.44-1.el10_3 Β· (LGPL-3.0-or-later OR GPL-2.0-or-later) AND GPL-3.0-or-later AND GFDL-1.3-or-later
- fedora 43: libidn-devel 1.44-1.fc43 Β· (LGPL-3.0-or-later OR GPL-2.0-or-later) AND GPL-3.0-or-later AND GFDL-1.3-or-later
- fedora 43: libidn-devel 1.44-1.fc43 Β· (LGPL-3.0-or-later OR GPL-2.0-or-later) AND GPL-3.0-or-later AND GFDL-1.3-or-later
- fedora 44: libidn-devel 1.44-1.fc44 Β· (LGPL-3.0-or-later OR GPL-2.0-or-later) AND GPL-3.0-or-later AND GFDL-1.3-or-later
- fedora 44: libidn-devel 1.44-1.fc44 Β· (LGPL-3.0-or-later OR GPL-2.0-or-later) AND GPL-3.0-or-later AND GFDL-1.3-or-later
- ubuntu stonking: libidn-dev 1.44-1 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms