tld_check_4z(3)

✨ tld_check_4z ✨

okay bestie, welcome to libidn's tld_check_4z(3) β€” she's an API function and she's here to vibe-check your code points πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <tld.h>

int tld_check_4z(const uint32_t * in, size_t * errpos, const Tld_table
** overrides);

like yes, she's a function, she takes three things, and she has opinions 🌸


πŸ¦‹ ARGUMENTS πŸ¦‹

  • const uint32_t * in β€” a zero-terminated array of unicode code points, aka the lil squad you're about to interrogate. no cap.
  • size_t * errpos β€” the position of the offending character gets returned right here. the snitch slot, if you will πŸ™ˆ
  • const Tld_table ** overrides β€” a Tld_table array of extra domain restriction structures. these complement and supersede the built-in info, so they're giving main character energy over the defaults πŸ‘‘

πŸ’– DESCRIPTION πŸ’–

so what she does is: she tests each of the code points in in to see whether or not they're allowed β€” by the info in overrides, or by the built-in TLD restriction data. it's giving vibe check, but for unicode.

when data for the same TLD is available both internally and in overrides, the info in overrides takes precedence. sorry built-ins, the overrides ate πŸ’€

if several entries for a specific TLD are found, the first one is used. first come, first served, periodt.

if overrides is NULL, only the built-in information is used. no overrides, no drama, just defaults.

the position of the first offending character is returned in errpos. the first one, bestie β€” she's not gonna list every single one, she found the problem and she's telling you 🫢

Return value: returns the Tld_rc value TLD_SUCCESS if all code points are valid or when tld is null, TLD_INVALID if a character is not allowed, or additional error codes on general failure conditions. so like, three possible moods: slay, nope, and "something else went wrong, idk" 😭


πŸ› REPORTING BUGS πŸ›

found a bug? spill it, but do it officially:


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.

(translation: go off, just 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. as an alternative you may obtain the manual from:

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

fr fr, that's the whole page. go forth and validate those code points, bestie πŸ’œ

and that's a wrap on the libidn 1.44 edition of tld_check_4z(3) β€” she's iconic, she's specific, she's never leaving the group chat β­πŸ’…

πŸ“¦ where this page comes from