tld_check_4tz(3)

✨ tld_check_4tz(3) ✨

okay bestie, so this is a page from libidn, section 3 of the manual (the library-functions section, iykyk), and the function it's hyping up is called tld_check_4tz. yes it's a mouthful. yes it slays. let's get into it πŸ’…


πŸŽ€ NAME πŸŽ€

tld_check_4tz β€” it's an API function, bestie. that's the whole name section. iconic of it honestly.


🌸 SYNOPSIS 🌸

#include <tld.h>

int tld_check_4tz(const uint32_t * in, size_t * errpos, const Tld_table
* tld);

there she is. three args, one int coming back at you. no cap. ✨


πŸ¦‹ ARGUMENTS πŸ¦‹

  • const uint32_t * in β€” a zero terminated array of unicode code points that you want processed. so like, the actual string-ish thing, but as raw code points, and it has to end with a zero or it's giving chaos. πŸ™ˆ
  • size_t * errpos β€” this is where the position of the offending character gets returned. so if something's sus, this pointer tells you where. very main character of it.
  • const Tld_table * tld β€” a Tld_table data structure that represents the restrictions you're testing the input against. it's literally the rulebook. the vibe check reference sheet. πŸ‘‘

πŸ’– DESCRIPTION πŸ’–

so what this does: it tests each of the code points in in to see whether or not they're allowed by the data structure in tld. if something's not allowed, it returns the position of the first character for which that's not the case, and drops it into errpos. first offender gets named. periodt. πŸ”₯

Return value: it returns the Tld_rc value TLD_SUCCESS if all the code points are valid, or when tld is null (yes, null is a free pass here, that's just the rules). it returns TLD_INVALID if a character is not allowed. and it can throw additional error codes on general failure conditions, so don't assume it's always just those two, okay? πŸ‘€


😭 REPORTING BUGS 😭

found a bug? tell the libidn girlies about it, they want to know:


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.

(so basically: take it, remix it, ship it, just don't remove 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/

lowkey the whole lore lives in that Texinfo manual, so if you want the full tea, go read it. no skipping chapters. πŸ’€

and that's the page, bestie! it's from libidn, version 1.44, and it's the tld_check_4tz(3) manual page. go forth and validate those code points. slay πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from