67 for (tldtable = tables; *tldtable; tldtable++)
68 if (!strcmp ((*tldtable)->name, tld))
105 #define DOTP(c) ((c) == 0x002E || (c) == 0x3002 || \
106 (c) == 0xFF0E || (c) == 0xFF61)
122 tld_get_4 (
const uint32_t *in,
size_t inlen,
char **out)
124 const uint32_t *ipos;
128 if (!in || inlen == 0)
131 ipos = &in[inlen - 1];
134 while (ipos >= in && ((*ipos >= 0x41 && *ipos <= 0x5A) ||
135 (*ipos >= 0x61 && *ipos <= 0x7A)))
138 if (olen > 0 && ipos >= in &&
DOTP (*ipos))
141 char *out_s = malloc (
sizeof (
char) * (olen + 1));
149 for (; ipos < &in[inlen]; ipos++, opos++)
150 *opos = *ipos > 0x5A ? *ipos : *ipos + 0x20;
173 const uint32_t *ipos = in;
204 iucs = calloc (ilen,
sizeof (*iucs));
209 for (i = 0; i < ilen; i++)
232 _tld_checkchar (uint32_t ch,
const Tld_table *tld)
240 if ((ch >= 0x61 && ch <= 0x7A) ||
241 (ch >= 0x30 && ch <= 0x39) || ch == 0x2D ||
DOTP (ch))
248 m = s + ((e - s) >> 1);
251 else if (ch > m->
end)
283 const uint32_t *ipos;
290 while (ipos < &in[inlen])
292 rc = _tld_checkchar (*ipos, tld);
324 const uint32_t *ipos = in;
411 const uint32_t *ipos = in;
419 return tld_check_4 (in, ipos - in, errpos, overrides);
uint32_t * stringprep_utf8_to_ucs4(const char *str, ssize_t len, size_t *items_written)
IDNAPI char * stringprep_locale_to_utf8(const char *str)
const Tld_table_element * valid
int tld_check_8z(const char *in, size_t *errpos, const Tld_table **overrides)
int tld_check_4z(const uint32_t *in, size_t *errpos, const Tld_table **overrides)
const Tld_table * _tld_tables[]
const Tld_table * tld_get_table(const char *tld, const Tld_table **tables)
int tld_check_4(const uint32_t *in, size_t inlen, size_t *errpos, const Tld_table **overrides)
int tld_check_lz(const char *in, size_t *errpos, const Tld_table **overrides)
const Tld_table * tld_default_table(const char *tld, const Tld_table **overrides)
int tld_check_4tz(const uint32_t *in, size_t *errpos, const Tld_table *tld)
int tld_check_4t(const uint32_t *in, size_t inlen, size_t *errpos, const Tld_table *tld)
int tld_get_4z(const uint32_t *in, char **out)
int tld_get_4(const uint32_t *in, size_t inlen, char **out)
int tld_get_z(const char *in, char **out)