tld

tld

Synopsis

#define             IDNAPI
typedef             Tld_table_element;
typedef             Tld_table;
enum                Tld_rc;
const char *        tld_strerror                        (Tld_rc rc);
int                 tld_get_4                           (const uint32_t *in,
                                                         size_t inlen,
                                                         char **out);
int                 tld_get_4z                          (const uint32_t *in,
                                                         char **out);
int                 tld_get_z                           (const char *in,
                                                         char **out);
const Tld_table *   tld_get_table                       (const char *tld,
                                                         const Tld_table **tables);
const Tld_table *   tld_default_table                   (const char *tld,
                                                         const Tld_table **overrides);
int                 tld_check_4t                        (const uint32_t *in,
                                                         size_t inlen,
                                                         size_t *errpos,
                                                         const Tld_table *tld);
int                 tld_check_4tz                       (const uint32_t *in,
                                                         size_t *errpos,
                                                         const Tld_table *tld);
int                 tld_check_4                         (const uint32_t *in,
                                                         size_t inlen,
                                                         size_t *errpos,
                                                         const Tld_table **overrides);
int                 tld_check_4z                        (const uint32_t *in,
                                                         size_t *errpos,
                                                         const Tld_table **overrides);
int                 tld_check_8z                        (const char *in,
                                                         size_t *errpos,
                                                         const Tld_table **overrides);
int                 tld_check_lz                        (const char *in,
                                                         size_t *errpos,
                                                         const Tld_table **overrides);

Description

Details

IDNAPI

#define             IDNAPI


Tld_table_element

  typedef struct Tld_table_element Tld_table_element;


Tld_table

  typedef struct Tld_table Tld_table;


enum Tld_rc

  typedef enum
  {
    TLD_SUCCESS = 0,
    TLD_INVALID = 1,		/* Invalid character found. */
    TLD_NODATA = 2,		/* Char, domain or inlen = 0. */
    TLD_MALLOC_ERROR = 3,
    TLD_ICONV_ERROR = 4,
    TLD_NO_TLD = 5,
    /* Workaround typo in earlier versions. */
    TLD_NOTLD = TLD_NO_TLD
  } Tld_rc;

Enumerated return codes of the TLD checking functions. The value 0 is guaranteed to always correspond to success.

TLD_SUCCESS

Successful operation. This value is guaranteed to always be zero, the remaining ones are only guaranteed to hold non-zero values, for logical comparison purposes.

TLD_INVALID

Invalid character found.

TLD_NODATA

No input data was provided.

TLD_MALLOC_ERROR

Error during memory allocation.

TLD_ICONV_ERROR

Error during iconv string conversion.

TLD_NO_TLD

No top-level domain found in domain string.

TLD_NOTLD


tld_strerror ()

const char *        tld_strerror                        (Tld_rc rc);

rc :

Returns :


tld_get_4 ()

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

in :

inlen :

out :

Returns :


tld_get_4z ()

int                 tld_get_4z                          (const uint32_t *in,
                                                         char **out);

in :

out :

Returns :


tld_get_z ()

int                 tld_get_z                           (const char *in,
                                                         char **out);

in :

out :

Returns :


tld_get_table ()

const Tld_table *   tld_get_table                       (const char *tld,
                                                         const Tld_table **tables);

tld :

tables :

Returns :


tld_default_table ()

const Tld_table *   tld_default_table                   (const char *tld,
                                                         const Tld_table **overrides);

tld :

overrides :

Returns :


tld_check_4t ()

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

in :

inlen :

errpos :

tld :

Returns :


tld_check_4tz ()

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

in :

errpos :

tld :

Returns :


tld_check_4 ()

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

in :

inlen :

errpos :

overrides :

Returns :


tld_check_4z ()

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

in :

errpos :

overrides :

Returns :


tld_check_8z ()

int                 tld_check_8z                        (const char *in,
                                                         size_t *errpos,
                                                         const Tld_table **overrides);

in :

errpos :

overrides :

Returns :


tld_check_lz ()

int                 tld_check_lz                        (const char *in,
                                                         size_t *errpos,
                                                         const Tld_table **overrides);

in :

errpos :

overrides :

Returns :