![]() |
libtld 2.0.14
A library to determine the Top-Level Domain name of any Internet URI.
|
Set of information returned by the tld() function. More...
Public Attributes | |
enum tld_category | f_category |
The category of the TLD. | |
char | f_country [48] |
The country where this TLD is used. | |
int | f_offset |
The offset to the TLD in the URI string you supplied. | |
enum tld_status | f_status |
The status of the TLD. | |
const char * | f_tld |
Pointer to the TLD in the URI string you supplied. | |
int | f_tld_index |
This structure is used by the tld() function to define the results to return to the caller.
Remember that this is a C structure. By default, the fields are undefined. The tld() function will first defined these fields, before returning any result.
It is acceptable to clear the structure before calling the tld() function but it is not required.
enum tld_category tld_info::f_category |
This represents the category of the TLD. One of the tld_category enumeration values can be found in this field.
Definition at line 103 of file tld.h.
Referenced by tld_object::category(), check_uri(), PHP_FUNCTION(), PHP_FUNCTION(), and tld_clear_info().
const char * tld_info::f_country |
When the f_category is set to TLD_CATEGORY_COUNTRY then this field is a pointer to the name of the country in English (although some may include accents, the strings are in UTF-8.)
This field is set to NULL if the category is not Country or the TLD was not found.
Definition at line 105 of file tld.h.
Referenced by check_uri(), tld_object::country(), PHP_FUNCTION(), PHP_FUNCTION(), and tld_clear_info().
int tld_info::f_offset |
This offset, when added to the URI string pointer, gets you to the TLD of that URI. The offset can also be used to start searching for the beginning of the domain name by searching for the previous period from that offset minus one. In effect, this gives you a way to determine the list of sub-domain.
Definition at line 107 of file tld.h.
Referenced by check_uri(), PHP_FUNCTION(), PHP_FUNCTION(), tld(), tld_check_uri(), tld_clear_info(), and tld_next_tld().
enum tld_status tld_info::f_status |
This value defines the current status of the TLD. Most of the TLDs we define are valid, but some are either deprecated, unused, or proposed.
Only a TLD marked as TLD_STATUS_VALID should be considered valid, although otherwise may be accepted in some circumstances.
Definition at line 104 of file tld.h.
Referenced by check_uri(), tld_object::is_valid(), PHP_FUNCTION(), PHP_FUNCTION(), tld_object::status(), tld(), tld_clear_info(), and tld_next_tld().
const char * tld_info::f_tld |
This is a pointer to the TLD section that the tld() function found in your URI. Note that it is valid only as long as your URI string pointer.
It is also possible to make use of the tld_info::f_offset value to extract the TLD, domain, or sub-domains.
If the TLD is not found, this field is NULL.
Definition at line 106 of file tld.h.
Referenced by check_uri(), tld_object::domain_only(), tld_object::full_domain(), PHP_FUNCTION(), PHP_FUNCTION(), tld_object::sub_domains(), tld(), tld_check_uri(), tld_clear_info(), tld_next_tld(), and tld_object::tld_only().
This document is part of the Snap! Websites Project.
Copyright by Made to Order Software Corp.