tld_get_4(3)

πŸ’– tld_get_4 β€” the libidn glow-up πŸ’–

okay bestie, sit DOWN because we're talking about tld_get_4(3) from libidn, and she is lowkey doing the most important job in the whole DNS-adjacent friend group: she finds your top-level domain and hands it to you. main character energy, no cap. ✨


🌸 NAME 🌸

tld_get_4 β€” an API function. that's it, that's the girl. she's an API function and she knows it. πŸ’…


✨ SYNOPSIS ✨

#include <tld.h>

int tld_get_4(const uint32_t * in, size_t inlen, char ** out);

look at her. three args, one job, zero drama. iconic.


πŸŽ€ ARGUMENTS πŸŽ€

  • const uint32_t * in β€” the array of unicode code points you want processed. and bestie, real talk: she does NOT need to be zero terminated. she's flexible like that. πŸ¦‹
  • size_t inlen β€” how many unicode code points you're feeding her. just the count. that's the whole vibe.
  • char ** out β€” a pointer to your zero terminated ascii result string. this is where she drops the answer. 🫢

πŸ’œ DESCRIPTION πŸ’œ

so here's the tea: she isolates the top-level domain of in and returns it as an ASCII string in out. that's the entire plot. no subplots, no filler episode. πŸ“

Return value: she gives you TLD_SUCCESS when everything slays, or the corresponding Tld_rc error code when it does not slay. either way she's honest about it. 😭


πŸ™ˆ REPORTING BUGS πŸ™ˆ

found a bug? not me being the one to tell you, but you gotta report it to <help-libidn@gnu.org>. πŸ›

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

and the GNU Libidn home page, which is very much the group chat hub, is at: 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. (yes bestie, keep the receipts. always keep the receipts. πŸ’…)


🌈 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. the way that info command just works... obsessed. ✨

as an alternative you may obtain the manual from:

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

and that's the whole page, bestie!! this one shipped with libidn 1.44 β€” go forth, isolate those top-level domains, and remember: zero termination is optional but self-care is mandatory. mwah. πŸ«ΆπŸ’–πŸŽ€

πŸ“¦ where this page comes from